# ./mkconfig.sh PLATFORM > Makefile
NOTE: Due to file system implementation limitations, compilation under MacOS X, and Windows NT/XP/Vista requires the compilation outside of the SOURCES directory. See below.
Most likely the generated makefile will not perfectly match the setup on your machine and you have to adapt the various definitions of compilers, optimization flags, library locations and so on. To display additional information about a configuration type:
# ./mkconfig.sh -i PLATFORM
The executable can then be compiled using the make command. 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 (the CPPFLAGS entry), 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 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.
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.
Please also note that the now obsolete GNU Fortran 77 compiler, g77,
and the G95 FORTRAN compiler, g95, do not support the ``Cray pointer''
feature and thus cannot be used to compile CPMD.