========================================================================
                      QUICK BUILD/INSTALL INSTRUCTIONS
========================================================================

Dieharder should build from the freshly unpacked tarball if you enter:

 ./autogen.sh
 make

from the toplevel source directory, IF you have the required libraries
and tools installed.

========================================================================
                           BUILD REQUIREMENTS

Dieharder requires the Gnu Scientific Library (GSL) and the Gnu Build
Tools (GBT) for its build, and it is strongly recommended that they be
up to date versions.  This precludes building or running dieharder on a
truly old linux (or other) distribution.  In practical terms, if your
linux distribution is older than two years (say, pre-FC 4) it is
unlikely to build smoothly without signicant work.  For many of you
reading this, then, my first instruction is "update to a relatively
modern build environment that contains a contemporary GSL and GBT".

A few required components may not be installed on your system by default
even if your system is quite modern.  The GSL is one example -- you may
need to use yum or apt-get or whatever package manager your system uses
to install its packages to install it, e.g. "yum install gsl\*" (to get
both the library and its header files) or you may have to get the GSL
sources and build/install from scratch.

Also be sure your system has libtool installed and on your path or else
the build will fail.  In particular its definition on your system needs
to be in aclocal's search path.  Running ./autogen.sh "should" fix all
of that, but in an imperfect world there are probably systems missing
this or that or configured very differently from my test/development
systems where it doesn't.

Note that there are MANY options you may want to give configure to tune
up a build for your particular architecture.  We will mention only two.
The first is the --prefix option, which can be used to change the
toplevel install path for packaging or to build and install a private
(non-root) copy.  The default (run automatically at the end of
./autogen.sh) is to run:

 ./configure --prefix=/usr

AS ROOT for a traditional FHS-compliant build and install.  However, you
may instead with to enter some other toplevel path path such as:

 ./configure --prefix=$(HOME)/usr

for an alternative install into your own home directory.  If you do the
latter, you will have to make sure that ~/usr/bin is on your default
path (set with the PATH environment variable) and ~/usr/lib is on your
default library path (set with the LD_LIBRARY_PATH variable).

dieharder uses GNU Libtool in order to automatically build against a
shared libdieharder library on a variety of systems.  This enables one
to build dieharder tests into your own applications, into a GUI version
that is planned, and into existing tools such as R.  

While shared libraries are very nice for making usable binaries and
efficiently using system resources, they can be a pain when trying to
debug a program or if you are building a single copy of dieharder for
your personal and private use.  For that reason, compilation of shared
libraries can be turned off by specifying the `--disable-shared' option
to configure:

 ./configure --prefix=$(HOME)/usr --disable-shared

This should produce a static-linked binary of dieharder that can be run
without the need to install the library at all.

Finally, to just build the software in place, enter:

 make

or to build it and install it on the path defined in the configure step
above, enter:

 make install

This last step will need to be done as root if the install is into a
root-owned directory such as /usr and must be followed as noted by
rerunning ldconfig.

NOTE WELL:  Be aware that the application is DYNAMICALLY LINKED and will
not work unless the libdieharder library is installed and made available
to the dynamic linker by running ldconfig (for the FHS install) or the
use of

 LD_LIBRARY_PATH=$(HOME)/usr/lib
 export LD_LIBRARY_PATH

for a private one.

                        RPM BUILD INSTRUCTIONS

There are two ways one should be able to build a functional set of RPMs
for the dieharder user interface application and libdieharder, the core
library of RNG testing routines.  The easiest, when it works, is to
download the source rpm and use

 rpmbuild --rebuild dieharder-whatever-src.rpm

where "whatever" should of course be the version of the source rpm you
seek to rebuild.  In order for this to work, you will need something
like the following in ~/.rpmmacros:

%_topdir	/home/rgb/Src/rpm_tree

# Don't do fascist build policy -- unpackaged files ignored.
%define _unpackaged_files_terminate_build 0

where the topdir macro should point to a valid RPM build tree.

Alternatively, once you have run the configure step above using
--prefix=/usr (only) you should be able to build the rpms using:

 make rpm

where once again a suitable rpm tree must exist and be pointed to in
.rpmmacros.


                Debian / Ubuntu Package Build Instructions

As Dieharder is provided as an actively maintained, simply do

   sudo apt-get build-dep dieharder

to install all build requirements for Dieharder, and 

   sudo apt-get source dieharder

to install the current sources.
