Doug Rohde's Utilities C Library

version 2.21

DRUtils is a general C library used by me in several of the programs I've written, including Tgrep2 and SLG. It includes extensions to C with improved interfaces for memory allocation, file IO, string manipulation, error reporting, time measurement, random number generation, binary data IO, and generalized hash tables.

You will need to compile the library for your own system. First click here to download the latest source distribution.

Put this file in your home directory or other favorite location and type "tar xvzf drutils.tgz". This will create a DRUtils directory. Go there.

Now you should be able to just type "make" to build the libdrutils.a library. If you need the debug version (libdrutils-dbg.a), which allows you to perform memory allocation analyses, use "make debug".

The compiled libraries will be placed in a directory whose name is your machine's HOSTTYPE. Typically for Linux systems this would be "i586", or something like that. A symbolic link in the main DRUtils directory will also be created.

If there are compile errors, you may need to customize things for your machine. You can do this by adding definitions or overriding other definitions in the sysext.h file, which is included by system.h

If you need to compile this on more than one machine (that are not already handled okay), you should create a new machine definition in the Makefile, like -DMACHINE_FOOBAR, for each of your machines.

Then place the code in sysext.h that is specific to the FOOBAR machine inside:

#endif /* MACHINE_FOOBAR */

Once DRUtils is compiled, you will probably want to go on to compile another of my programs that uses the library. When you do so, you may need to edit the first few lines of the Makefile for that other program so that correct location of the DRUtils directory is used. By default, it assumes that DRUtils is located in your home directory.

Version Notes

2.21 2.2 2.0


Comments, questions, and bug reports should be addressed to dr+utils@tedlab.mit.edu.

Doug Rohde, dr+utils@tedlab.mit.edu,
Department of Brain and Cognitive Science,
Massachusetts Institute of Technology