Installation

The project consist of Fortran and C source codes. Moreover, common scientific libraries (FFTW, BLAS and LAPACK) are used. The compilation is done with make utility. Machine dependent settings are collected in a file arch.inc (architecture file). The Makefiles (which control make utility execution) are created automatically with a python script detect-deps.py. The script supports an out of source compilation (i.e. in a user-specified directory, which can be different to the source-code directory). The architecture file must be put to the same directory where the Makefiles are generated. Examples of architecture files can be found in examples/arch/ sub directory. One can start the compilation by creating a compilation sub directory

mkdir build

After, we step inside the compilation directory

cd build

and generate Makefiles

python <path/to/source>/detect-deps.py -C <path/to/source>

As soon as Makefiles are generated, one can copy an example arch.inc file from trunk/examples/arch/ subdirectory to the build directory and adjust it to your machine. As soon as arch.inc is adjusted to your particular machine, the compilation can be started by typing

make

By default several executables are build. The names of these executables are printed after compilation.
Each executable has its own Makefile. For instance, the executable tddft is build according to Makefile.tddft; only given set of modules is compiled for each executable. To keep track on module's dependencies, there is dependencies.inc include file (generated together with other Makefiles).

Tips and tricks concerning compilation phase can be found in section Compilation.

Inner design of Makefile system is described in section Makefiles design.

Short FAQ:
Q: I have almost compiled on my Mac, but I get errors during linking stage
A: Maybe there is not fortran bindings in the fftw-3 library? Try

port install fftw-3 +gfortran

Q: I have compiled tddft on my Mac, but I get segmentation fault while running the program
A: Maybe you forgot to use -DUSE_OWN_CZDOT option in arch.inc ?

Q: I got strange errors during compilation with g95
Reading module parallel at line 2 column 780: Unexpected EOF
While reading module 'm_precision' found module version 0, expected 8.
A: This could happen if one has .mod files from other compiler laying in one directory with source (normally in trunk/). The cure would be to clean source directory and avoid using 'in source' builds. There is no option in g95 to override its default behaviour to search .mod files first in the source directory. This problem does not affect ifort or gfortran compilers.

Q: I got an error message saying that cputime.c cannot be compiled.
A: Maybe you need to install the development headers. On recent Ubuntu/Debian distributions it would be done with a command
apt-get install g++-multilib

Q: During linking any libraries could be found.
A: The package depends on lapack, and fftw3 libraries. On recent Ubuntu/Debian distributions it would be solved with a command
apt-get install libopenblas-dev libfftw3-dev

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License