Before building Relax, you must have

  Fortran 90 and C compilers (e.g. gfortran)
  GMT 4.5 or greater
  Proj 4.7.1 or greater
  Python 2.4 or greater

***************************** NOTE ***********************************
Versions 4.5.1 and 4.5.2 of gfortran (and perhaps others) are
unable to compile Relax with OpenMP and optimizations.  This manifests
itself as a compiler error when compiling viscoelastic3D.f90.  One
workaround is to compile Relax without optimizations, but a better
solution is to use a different compiler.
**********************************************************************

A fast fft library, such as FFTW or MKL, is also highly recommended.
An implementation of the Cooley-Tukey FFT algorithm is included, but
it will be significantly slower.

The first step in building Relax is to configure the build system.  Relax uses Waf

  http://code.google.com/p/waf/

for configuration and building.  To configure, run

  ./waf configure

To get basic help and a list of configuration options, run

  ./waf --help

Once configuration works, build Relax with the command

  ./waf

As one example, to compile the code on Mac OS X with the Intel fortran
compiler, the MKL libraries, and the Fink-provided GMT and Proj
libraries, we configured with the command

  ./waf configure --proj-dir=/sw --gmt-dir=/sw --mkl-libdir=/opt/intel/Compiler/11.1/084/Frameworks/mkl/lib/em64t/ --mkl-incdir=/opt/intel/Compiler/11.1/084/Frameworks/mkl/include --check-c-compiler=icc --check-fortran-compiler=ifort

As another example, to build Relax on Caltech's CITerra, we first built and
install gmt and proj into /home/walter/src/relax/relax-bin.  We then
configured Relax with the command

  CPPFLAGS="-I/usr/include/netcdf-4" LDFLAGS="-L/usr/lib64" ./waf configure  --proj-dir=/home/walter/src/relax/relax-bin --gmt-dir=/home/walter/src/relax/relax-bin/ --mkl-incdir=/opt/intel/composerxe-2011.1.107/mkl/include/ --mkl-libdir=/opt/intel/composerxe-2011.1.107/mkl/lib/intel64/ --check-c-compiler=icc --check-fortran-compiler=ifort

Depending on how your libraries were built, you may have to set
LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (Mac) so that Relax can
find them.  For example, on Mac OS X using Fink, you may have to run the command

  export DYLD_LIBRARY_PATH=/sw/lib:/sw/lib/netcdf-gfortran/lib

To build Relax on Caltech's Fram cluster, use the commands:

module load ifort
module load gmt

CPPFLAGS="-I/opt/GMT-4.5.7/netcdf/include" LDFLAGS="-L/usr/lib64 -lgdal" ./waf configure --gmt-dir=/opt/GMT-4.5.7 --mkl-incdir=/opt/intel/composer_xe_2011_sp1.6.233/mkl/include/ --mkl-libdir=/opt/intel/composer_xe_2011_sp1.6.233/mkl/lib/intel64/ --check-c-compiler=icc --check-fortran-compiler=ifort

./waf build

-------
Doxygen
-------

You can generate a doxygen interface with the commands

  mkdir doc
  doxygen ./doxygen


---------------------
Environment Variables
---------------------

The valid environment variables for Waf are slightly different from
autoconf.  Specifically, they are

CFLAGS

    Selects compilation options for when the C compiler is used,
    e.g. "-Wall".

CXXFLAGS

    Selects compilation options for when the C++ compiler is used,
    e.g. "-Wall".

FCFLAGS

    Selects compilation options for when the Fortran compiler is used,
    e.g. "-Wall".

CPPFLAGS

    Selects C preprocessor options, e.g. "-DFOO=bar"

LINKFLAGS

    Extra linker options, e.g. "-L/usr/local -lsome-library"

CC

    The C compiler that will be used instead of the platform
    default. Example CC=/usr/bin/gcc-2.95

CXX

    The C++ compiler that will be used instead of the platform
    default. Example CXX=/usr/bin/g++-2.95

FC

    The fortran compiler that will be used instead of the platform
    default. Example CXX=/usr/bin/gfortran

PREFIX

    The default installation prefix to be used, if no --prefix option
    is given.
