# ./mkconfig.sh PLATFORM > Makefile
NOTE: Due to filesystem implementation limitations, compilation under Mac OS-X, and Windows NT/XP requires the compilation outside of the SOURCES directory. See below.
To display additional information about a configuration type:
# ./mkconfig.sh -i PLATFORM
The executable can then be compiled using the make command. The mkconfig.sh script will also set the parameter IRAT (in irat.inc according to the target platform. To see all possible options use
# ./mkconfig.sh -help
A common problem is that the default names of the libraries and the path to the libraries are not correct in the Makefile. In this case you have to change the corresponding entries in the Makefile manually.
If you are changing the preprocessor flags, e.g. going from a serial to a parallel compilation, you have to delete all ".f" and ".o" files first, preferably by executing
# make clean
Alternatively you can compile CPMD outside the source directory.
This is highly recommended, if you need to compile several executables
concurrently, e.g. if you are doing development on several platforms.
This is done by creating a directory for each platform
(e.g. by 'mkdir ../cpmd-pc-pgi; mkdir ../cpmd-pc-pgi-mpi' ) and then
create a makefile for each of those directories and pointing to the
original source directory with with SRC and DEST
flags. For the above examples this would be:
# ./mkconfig.sh -m -SRC=$PWD -DEST=../cpmd-pc-pgi PC-PGI
# ./mkconfig.sh -m -SRC=$PWD -DEST=../cpmd-pc-pgi-mpi PC-PGI-MPI
Now you can do development in the original source directory and only
need to recompile the altered modules by typing 'make' in the
respective subdirectories.
NOTE: For compilation under Mac OS-X this procedure is currently required.
Compiling CPMD on Linux platforms can be particularly tricky,
since there are several Fortran compilers available and there
are no standard locations for supporting libraries (which on top
of that usually have to be compiled with the same or a compatible
compiler). If you run into problems, you may want to check out the
CPMD Mailing list archives at
to see, whether your specific problem has already been dealt with.
Some tips and tricks on how to get CPMD running on various Linux
platforms and precompiled binaries of supporting libraries
can be also found at:
Please also note that neither the GNU Fortran 77 compiler,
g77, nor the GNU Fortran 90/95 compiler, g95,
are not sufficient to compile CPMD.