next up previous contents index
Next: Optimizing CPMD Up: Installation Previous: Linux Specific Issues   Contents   Index


Compiling CPMD

CPMD is equipped with a shell script to create an initial Makefile for a number of given platforms. If you run the shell script mkconfig.sh without any options it will tell you what platforms are available. Choose the label for a target platform close to what your machine is and run the script again.



# ./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

http://www.cpmd.org/pipermail/cpmd-list/

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.



Subsections
next up previous contents index
Next: Optimizing CPMD Up: Installation Previous: Linux Specific Issues   Contents   Index
Costas Bekas 2008-09-04