next up previous contents index
Next: Keywords for the Makefile Up: Compiling and Running DL_POLY_2 Previous: Compiling and Running DL_POLY_2   Contents   Index


Compiling the Source Code

When you have obtained DL_POLY_2 from Daresbury Laboratory and unpacked it, your next task will be to compile it. To aid compilation a general makefile (called ``Makefile'') has been provided in the sub-directory build (see Appendix A.1 to this document). The general DL_POLY_2 makefile will build an executable with a wide range of functionality - sufficient for the test cases and for most users' requirements. Other makefiles are found in the build sub-directory for variants of DL_POLY_2 , such as the respa version. Users will need to modify the makefile if they are to add additional functionality to the code, or if it requires adaptation for a non specified computer. Modifications may also be necessary for the Smoothed Particle Mesh Ewald method if a system specific 3D FFT routine is desired (see below: ``Modifying the makefile'').

Note the following system requirements for a successful build of DL_POLY_2 .

  1. a FORTRAN 90 compiler;
  2. a C compiler;
  3. the Java SDK from Sun Microsystems (if the GUI is required).
  4. a UNIX operating system (or Windows if a PC version is required).

Copy the makefile from the build sub-directory to the source sub-directory and run it there - it will create the executable in the execute sub-directory. The compilation of the program is initiated by typing the command:

 

make $target$

 

where $target$ is the specification of the required machine (e.g. sp2-mpi). For many computer systems this is all that is required to compile a working version of DL_POLY_2 . (To determine which targets are already defined in the makefile, typing the command make without a nominated target will produce a list of known targets.)

The full specification of the make command is as follows

 

make $<$TARGET= $\ldots >$ $<$ STRESS=$\ldots >$ $<$ TYPE=$\ldots >$ $<$ EX=$\ldots >$ $<$ BINROOT=$\ldots >$

 

where some (or all) of the keywords may be omitted. The keywords and their uses are described below. Note that keywords may also be set in the unix environment (e.g. with the ``setenv'' command in a C-shell).

The makefile first checks for the existence of the DL_POLY_2 C preprocessor DPP. If the executable version is not present it will be compiled. Afterwards each FORTRAN routine is taken in turn and scanned by DPP. The purpose of this is to activate the required features in the code (and extract non-selected features from the original source code). For example if MPI is specified, all other non-MPI message passing calls are removed. If NOSTRESS is specified, the statements for calculating the stress tensor are removed. The result of the preprocessing is a temporary FORTRAN file which is then compiled to produce the object code. If all is well, the makefile will combine the object code with the system libraries and produce the executable.

For PCs running Windows, the makefile assumes the user has installed the Cygwin Unix API available from http://sources.redhat.com/cygwin. The recommended FORTRAN 90 compiler is Compaq Visual Fortran (see: http://www.compaq.com/fortran/visual). Both of these are copyrighted products.



Subsections
next up previous contents index
Next: Keywords for the Makefile Up: Compiling and Running DL_POLY_2 Previous: Compiling and Running DL_POLY_2   Contents   Index
W Smith 2003-05-12