Building and installing HAVEGE library.

Debian users should follow this guideline instead.

Step 1: grab the latest HAVEGE library archive (libhavege_x.y.orig.tar.gz) from this page.

Step 2: unpack the archive with:

$ gunzip libhavege_x.y.orig.tar.gz | tar xvf -

Step 3: move into the newly created libhavege-x.y directory

$ cd libhavege-x.y

Step 4: create a build directory. We recommend to create one build directory per architecture.

$ mkdir build
$ cd build

Step 4: configuring, building and installing the HAVEGE library in "install_directory"

$ ../configure --prefix=install_directory
$ make
$ make install

Once the above steps done, move to "install_directory" and check if the following files are installed:

For Unix/Linux users:

lib/libhavege.so.x.x.x HAVEGE shared library
lib/libhavege.a HAVEGE static library
include/havege.h HAVEGE header

and for Cygwin users:

bin/cyghavege-x.dll HAVEGE dll
lib/libhavege.a HAVEGE static library
lib/libhavege.dll.a Import library
lib/libhavege.la Libtool library
include/havege.h HAVEGE header

Note for Cygwin users

We noticed that HAVEGE fails to build properly on cygwin with some gcc versions. Upon encountering this issue, we recommend upgrading your compiler and associated libraries.

Note for non-x86 systems

HAVEGE's configure script might fail guessing some architectural parameters depending on the target processor type (only x86-based systems are supported so far). The current solution to this problem is to provide extra arguments to the configure script, as described below.

Configuration parameters

Specify the L1 data-cache size, SIZE is the size in Kbytes.

$ ./configure --with-l1-dcache=SIZE

Tuning HAVEGE

The number of unrolled steps (YY) in the main loop of HAVEGE should be tuned to get the inner loop body code just fitting in the instruction cache. This maximizes the number of instruction blocks (and associated branch prediction information) removed from the instruction cache on each system interrupt.

HAVEGE: User-Level Software Heuristic for Strong Random Numbers, André SEZNEC and Nicolas SENDRIER, ACM TMCS, October 2003.

It is NOT recommended to modify the optimization flags (e.g. "-O3" on x86-based systems) as the number of unrolled steps provided by default strongly depends upon them.

Users still interested in fine tuning the number fo unrolled steps could resort to advanced profiling tools such as OProfile.