next up previous contents index
Next: Note on Interpolation Schemes Up: Compiling the Source Code Previous: Keywords for the Makefile   Contents   Index

Modifying the Makefile

  1. Changing the TARGET
     
    If you do not intend to run DL_POLY_2 on one of the specified machines, you must add appropriate lines to the makefile to suit your circumstances. The safest way to do this is to modify an existing TARGET option for your purposes. The makefile supplied with DL_POLY_2 contains examples for serial and MPI environments as well as for Intel and Cray (T3E) parallel machines so you should find one close to your requirements. You must of course be familiar with the appropriate invocation of the FORTRAN compiler for your local machine and also any alternatives to MPI your local machine may be running. After DL_POLY_2 Version 2.12, the required C preprocessor is supplied with the source code, and is called dpp.c (written by J. Genornowicz, Southampton University, 1999). If you wish to compile for MPI systems remember to ensure the appropriate library directories are accessible to you. If you intend the program for a single processor machine use the flag -DSERIAL (see the examples in the makefile).
  2. Enabling the Smoothed Particle Mesh Ewald
     
    Users of DL_POLY_2 Version 2.12 (and above) should note that modifications to the makefile will be needed if a system specific Fast Fourier Transform (FFT) routine is required for the Smoothed Particle Mesh Ewald (SPME), otherwise a non-optimal default is used. . A good replacement is the public domain FFTW library, for ehich examples exist in the makefile. The user who wishes to use FFTW should check the relevant part of the makefile to see how this is enabled (this is generally made clear in the makefile comments). The FFTW option is enabled by setting the parameter FFTW_LIBRARY to specify the location of the FFTW software, and by inserting the flag -DFFTW in the CPFLAGS list (see above). Note that for most parallel systems represented in the makefile the appropriate FFT is already enabled (which is usually not FFTW). This is particularly the case for Cray T3E, IBM SP/2 and parallel SGI machines.
  3. MPI implementations
     
    The implementation of MPI may differ between sites. On some systems the Fortran callable subroutine names are expected to end with an underscore (``_''). If this is the case the flag -DMPIU must be included as part of the C-preprocessing flags and the file ``mpif.h'' copied from the MPI library directory into the source directory. Alternatively you can set the path to the MPI library either the ``-I'' option on the C-preprocessing flags. The DL_POLY_2 makefile assumes you have copied the file over (see the entry hp-mpi: in the makefile). This appends an underscore to all MPI subroutine names and to the name of the MPI common block. If the underscores are not required the flag must be omitted (see the entry ``sp2-mpi:).

    When using MPI you need a copy of the MPI include file ``mpif.h'' in the source directory. On many machines this is stored in the /usr/include directory, in which case the make procedure should find it automatically (as it also does for IBM SP/2 and Cray T3E machines, where it is stored elsewhere). However, if the make reports a failure to find the ``mpif.h'' file, you must amend the makefile to ensure that it copied from the true location before C-preprocessing is attempted. There are several examples in the makefile of how this is done.

  4. Problems with optimization ?
     
    Some subroutines do not compile correctly when using optimization on some compilers. This is not the fault of the DL_POLY_2 code, but of the compiler concerned. This is circumvented by compiling the offending subroutines unoptimised. See the entries for various machines in the makefile to see how this is done if you experience problems with other subroutines.
  5. Changing the Timer
     
    The only other routine likely to cause problems is TIMCHK, which requires a machine specific timer. The makefile should select the appropriate timer for you, but if the timer routine you require is not included you will need to add the appropriate lines of code. TIMCHK returns the elapsed time in seconds. Note that the C routine ETIME may be used on many unix systems. It is used as the default timer by DL_POLY_2 on serial systems.
  6. Adding new functionality
     
    To include a new subroutine in the code simply add subroutine.o to the list of object names in the makefile. The simpliest way is to add names to the ``OBJ_ALL'' list.


next up previous contents index
Next: Note on Interpolation Schemes Up: Compiling the Source Code Previous: Keywords for the Makefile   Contents   Index
W Smith 2003-05-12