COMPILING AND INSTALLING CFOUR ================================
This document describes how to configure, compile and install CFOUR on your system. In oder to compile CFOUR you need to have GNU make installed, no other version of make will work! If you intend to do more advanced development work on CFOUR, you might also need to install GNU autoconf and GNU automake on your system.
In the top-level directory type './configure' to configure CFOUR. 'configure' examines your system and looks for Fortran compilers and math libraries needed to compile CFOUR. If 'configure' finishes successfully, type 'make' to build CFOUR and then 'make install' to install CFOUR in /usr/local/cfour. Then add /usr/local/cfour/bin to your path, and you are ready to do that CCSD(T) on that huge protein you have been dreaming about! That's it!
If you are not happy with the defaults provided by 'configure', there are a number of flags you can pass to 'configure' to change it's behavior. For a complete listing of options run './configure --help'. Below is a listing of the most important options:
To install CFOUR in an alternative location (e.g. /work/bin/cfour_dec) use --prefix=/work/bin/cfour_dec. If you want the binaries installed directly in that directory (and not in $prefix/bin) use also the --bindir=/work/bin/cfour_dec flag to 'configure'.
'configure' also lets you choose which compliers to use, by setting the appropriate environment variables, e.g. to use the Intel Fortran and C
complers: $ CC=icc F77=ifc ./configure.
SELECTING BLAS/LAPACK LIBRARIES:
By default, configure tries to automagically figure which blas/lapack libs to use. If you want to use libraries in non-default locations, or some non-supported libraries, you can use the --with-blas-dir=/path/to/blas and --with-blas=myblas flags. If configure fails, it might be that you need to supply some aditional libraries to link against (look in config.log for error messages), e.g. --with-blas="-lmyblas -lmyextrlib".
The top-level Makefile provides a number of rules not discussed above:
'make lib' builds the CFOUR static libraries and puts them in lib/ in the
'make prog' builds all the individual modules and puts the binaries in bin/.
'make clean' removes all object files in all subdirectories, but not the
libraries and binaries.
'make realclean' does exactly the same as 'make clean', but removes the
binaries and libraries as well.
'make distclean' does what 'make realclean' does, but removes the
configurations produced by 'configure' as well. You must re-run './configure' to compile CFOUR again.
'make install' installs the binaries and basis sets in the directory decided
'make install_bin' installs only the binaries.
'make install_lib' installs the libraries.
'make install_basis' installs the basis sets.
It's strictly not necessary to actually install CFOUR, since you can just run it out of the build directory, but it might be useful to install a working version in some standard location.
The same make rules also apply in the individual subdirectories, with a couple of exceptions, and a few additions. 'make install_basis' works only in the top-level directory, and 'make lib' and 'make prog' does not work either! Just a simple 'make' will build the relevant module. There are two additional rules which apply in the individual source directories: 'make tags' and 'make TAGS', builds the 'tags' and 'TAGS' files respectively for use with either 'vi' or 'emacs' (great stuff...).
Furthermore, the srcdir Makefiles provided a number of useful options which can be set either by editing the Makefile or by setting them from the command line (e.g. $ DEBUG=1 make). The options are:
DEBUG: turns on debugging flags and disables optimizations
PROFILE: turns on profiling flags
RANGE: turns on range checking
NOWARN: turns off compiler warnings
For example to compile the xcfour program with debugging turned on, go to the cfour subdir, type 'make clean' and then 'DEBUG=1 make'. This places the compiled module in the current directory, _not_ in bin/ or lib/! This is simply to avoid installing slow binaries by mistake. If you want to enable debugging for just one or two files, and not the whole program, start by compiling normally and then touch the files in question and run make with the debug option turned on.