next up previous contents index
Next: Periodic Boundary Conditions in Up: The DL_POLY_2 Makefile Previous: DL_POLY_2   Contents   Index

DL_MULTI

# Sample makefile for DL_POLY_2.0 
# Author: W. Smith November 1999
# With DPP tool by J. Geronowicz
# Original by T. Forester 1995
# DL_MULTI version : copy this file to 'Makefile' before use
# 
#     $Author: wl $
#     $Date: 2003/05/08 09:48:50 $
#     $Revision: 1.1 $
#     $State: Exp $

# Define default settings

#=======================================================================

FFTW_LIBRARY = ""
BINROOT = .
CC  = cc
DPP = ./dpp
EX = DLPOLY.X
EXE = $(BINROOT)/$(EX)
FC=undefined
PVM_EX=\'$(EX)\'
SHELL=/bin/sh
STRESS=STRESS
TYPE=3ptmp

# Define object files

#=====================================================================

OBJ_ALL = angfrc.o bndfrc.o cfgscan.o corshl.o coul0.o coul4.o \
	coul2.o coul3.o conscan.o dblstr.o dcell.o diffsn0.o \
	diffsn1.o dlpoly.o duni.o error.o ewald1.o ewald3.o \
	exclude.o exclude_atom.o fldscan.o exclude_link.o \
	exitcomms.o extnfld.o fbpfrc.o fcap.o forces.o freeze.o gauss.o \
	gdsum.o getrec.o gimax.o gisum.o gstate.o images.o initcomms.o \
	intlist.o intstr.o invert.o invfrc.o jacobi.o lowcase.o lrcmetal.o \
	lrcorrect.o machine.o merge.o merge1.o merge4.o multiple.o  \
	multiple_nsq.o npt_b1.o nt_b1.o parset.o npt_h1.o nst_h1.o nve_1.o \
	nvt_b1.o nvt_e1.o nvt_h1.o parlst_nsq.o parlink.o parlst.o passcon.o \
	passpmf.o pmf_1.o pmf_shake.o primlst.o quench.o rdf0.o rdf1.o \
	rdshake_1.o result.o revive.o scdens.o shellsort.o shlfrc.o \
	shlmerge.o shlqnch.o shmove.o simdef.o splice.o static.o strip.o \
	strucopt.o sysdef.o sysgen.o systemp.o sysbook.o sysinit.o \
	tethfrc.o thbfrc.o timchk.o traject.o vertest.o vscaleg.o \
	warning.o xscale.o zden0.o zden1.o

OBJ_SPME = bspcoe.o bspgen.o cpy_rtc.o ele_prd.o ewald_spme.o \
	 scl_csum.o set_block.o spl_cexp.o spme_for.o dlpfft3.o

OBJ_HKE = hkgen.o hkewald1.o hkewald2.o hkewald3.o hkewald4.o cerfr.o

OBJ_NEU = coul0neu.o coul2neu.o coul3neu.o excludeneu.o forcesneu.o \
	multipleneu.o neutlst.o parneulst.o prneulst.o \
	parlinkneu.o rdf0neu.o 

OBJ_RIG = nptq_b1.o nptq_b2.o nstq_b1.o nstq_b2.o nptq_h1.o nptq_h2.o \
	nstq_h1.o nstq_h2.o nveq_1.o nveq_2.o nvtq_b1.o nvtq_b2.o \
	nvtq_h1.o nvtq_h2.o passquat.o qshake.o	quatbook.o quatqnch.o

OBJ_RRR = denloc.o dihfrc.o erfcgen.o ewald2.o ewald4.o forgen.o \
	fortab.o metgen.o srfrce.o srfrceneu.o suttchen.o

OBJ_4PT = denloc_4pt.o dihfrc_4pt.o erfcgen.o ewald2_4pt.o ewald4_4pt.o \
	forgen.o fortab.o metgen.o srfrce_4pt.o srfrceneu_4pt.o \
	suttchen_4pt.o

OBJ_RSQ = denloc_rsq.o dihfrc_rsq.o erfcgen_rsq.o ewald2_rsq.o ewald4_rsq.o \
	forgen_rsq.o fortab_rsq.o metgen_rsq.o srfrce_rsq.o srfrceneu_rsq.o\
	suttchen_rsq.o 

OBJ_EXT = crecv.o csend.o gsync.o mynode.o nodedim.o numnodes.o

OBJ_MULTI = cmxma.o erfcmpg.o erfcmpr.o ewald5.o ewald5a.o \
         ewald5b.o ewald5c.o ewald5d.o ewald5e.o ewald6.o \
         prrcon.o wigner.o bsctr.o bsctd.o merge3.o setcut.o \
         ewhlp6.o ffunc.o accdir.o accrec.o

OBJ_MULTIINLINE =  ewhlp6.o ffunc.o accdir.o accrec.o

FILES = angfrc.f bndfrc.f cfgscan.f corshl.f coul0.f coul4.f \
	coul2.f coul3.f dblstr.f dcell.f diffsn0.f diffsn1.f \
	duni.f ewald3.f exclude.f exclude_atom.f exclude_link.f \
	exitcomms.f extnfld.f fbpfrc.f fcap.f freeze.f gauss.f \
	gdsum.f getrec.f gimax.f gisum.f gstate.f images.f \
	initcomms.f intlist.f intstr.f invert.f invfrc.f jacobi.f \
	lowcase.f lrcmetal.f lrcorrect.f machine.f merge.f \
	merge1.f multiple_nsq.f npt_b1.f nst_b1.f npt_h1.f \
	nst_h1.f nve_1.f nvt_b1.f nvt_e1.f nvt_h1.f parlst_nsq.f \
	parlink.f parlst.f passcon.f passpmf.f pmf_1.f pmf_shake.f \
	primlst.f quench.f rdf0.f rdf1.f rdshake_1.f result.f \
	revive.f scdens.f shellsort.f shlfrc.f shlmerge.f shlqnch.f \
	shmove.f splice.f static.f strip.f tethfrc.f thbfrc.f \
	timchk.f traject.f vertest.f warning.f xscale.f zden0.f \
	zden1.f denloc.f dihfrc.f erfcgen.f ewald2.f ewald4.f \
	forgen.f fortab.f metgen.f srfrce.f srfrceneu.f suttchen.f \
	coul0neu.f coul2neu.f coul3neu.f excludeneu.f forcesneu.f \
	multipleneu.f neutlst.f parneulst.f prneulst.f parlinkneu.f \
	rdf0neu.f qshake.f crecv.f csend.f gsync.f mynode.f \
	nodedim.f numnodes.f hkgen.f hkewald1.f hkewald2.f hkewald3.f \
	hkewald4.f cerfr.f

F_ALL = angfrc.f bndfrc.f cfgscan.f corshl.f coul0.f coul4.f \
	coul2.f coul3.f conscan.f dblstr.f dcell.f diffsn0.f \
	diffsn1.f dlpoly.f duni.f error.f ewald1.f ewald3.f \
	exclude.f exclude_atom.f fldscan.f exclude_link.f \
	exitcomms.f extnfld.f fbpfrc.f fcap.f forces.f freeze.f gauss.f \
	gdsum.f getrec.f gimax.f gisum.f gstate.f images.f initcomms.f \
	intlist.f intstr.f invert.f invfrc.f jacobi.f lowcase.f lrcmetal.f \
	lrcorrect.f machine.f merge.f merge1.f merge4.f multiple.f  \
	multiple_nsq.f npt_b1.f nst_b1.f parset.f npt_h1.f nst_h1.f nve_1.f \
	nvt_b1.f nvt_e1.f nvt_h1.f parlst_nsq.f parlink.f parlst.f passcon.f \
	passpmf.f pmf_1.f pmf_shake.f primlst.f quench.f rdf0.f rdf1.f \
	rdshake_1.f result.f revive.f scdens.f shellsort.f shlfrc.f \
	shlmerge.f shlqnch.f shmove.f simdef.f splice.f static.f strip.f \
	strucopt.f sysdef.f sysgen.f systemp.f sysbook.f sysinit.f \
	tethfrc.f thbfrc.f timchk.f traject.f vertest.f vscaleg.f \
	warning.f xscale.f zden0.f zden1.f

F_SPME = bspcoe.f bspgen.f cpy_rtc.f ele_prd.f ewald_spme.f \
	 scl_csum.f set_block.f spl_cexp.f spme_for.f dlpfft3.f

F_HKE = hkgen.f hkewald1.f hkewald2.f hkewald3.f hkewald4.f cerfr.f

F_NEU = coul0neu.f coul2neu.f coul3neu.f excludeneu.f forcesneu.f \
	multipleneu.f neutlst.f parneulst.f prneulst.f \
	parlinkneu.f rdf0neu.f 

F_RIG = nptq_b1.f nptq_b2.f nstq_b1.f nstq_b2.f nptq_h1.f nptq_h2.f \
	nstq_h1.f nstq_h2.f nveq_1.f nveq_2.f nvtq_b1.f nvtq_b2.f \
	nvtq_h1.f nvtq_h2.f passquat.f qshake.f	quatbook.f quatqnch.f

F_RRR = denloc.f dihfrc.f erfcgen.f ewald2.f ewald4.f forgen.f \
	fortab.f metgen.f srfrce.f srfrceneu.f suttchen.f

F_4PT = denloc_4pt.f dihfrc_4pt.f erfcgen.f ewald2_4pt.f ewald4_4pt.f \
	forgen.f fortab.f metgen.f srfrce_4pt.f srfrceneu_4pt.f \
	suttchen_4pt.f

F_RSQ = denloc_rsq.f dihfrc_rsq.f erfcgen_rsq.f ewald2_rsq.f ewald4_rsq.f \
	forgen_rsq.f fortab_rsq.f metgen_rsq.f srfrce_rsq.f srfrceneu_rsq.f\
	suttchen_rsq.f 

F_EXT = crecv.f csend.f gsync.f mynode.f nodedim.f numnodes.f

F_MULTI = cmxma.f erfcmpg.f erfcmpr.f ewald5.f ewald5a.f \
         ewald5b.f ewald5c.f ewald5d.f ewald5e.f ewald6.f \
         prrcon.f wigner.f bsctr.f bsctd.f merge3.f setcut.f \
         ewhlp6.f ffunc.f accdir.f accrec.f

F_MULTIINLINE =  ewhlp6.f ffunc.f accdir.f accrec.f

TIMER = etime.o

# Define targets

#=====================================================================
all:
	@echo "Error - please specify a target machine!"
	@echo "Permissible targets for this Makefile are:"
	@echo "                                          "
	@echo "beowulf-absoft               (parallel)"
	@echo "sp2-mpi                      (parallel)"
	@echo "sp2-mpi-debug                (parallel)"
	@echo "sp2-mpi-fftw                 (parallel)"
	@echo "sun-ultra                    (serial)"
	@echo "         "
	@echo "Please examine Makefile for details"

# system specific targets follow :

#================== IBM SP2 version =======================================
sp2-mpi: dpp 
	cp /usr/lpp/ppe.poe/include/mpif.h mpif.h 
	$(MAKE) FC=mpxlf FFLAGS="-c -NS2048 -qnosave" \
	CPFLAGS="-D$(STRESS) -DMPI -DESSL -D'POINTER=integer'" intlist.o 
	$(MAKE) LD="mpxlf -o" LDFLAGS="-lesslp2" FC=mpxlf \
	FFLAGS="-c -O3 -NS2048  -qarch=pwr2 -qnosave" \
	CPFLAGS="-D$(STRESS) -DMPI -DESSL -D'POINTER=integer'" \
	EX=$(EX) BINROOT=$(BINROOT) $(TYPE)

#================== IBM SP2 debug version ==============================
sp2-mpi-debug: dpp 
	cp /usr/lpp/ppe.poe/include/mpif.h mpif.h 
	$(MAKE) LD="mpxlf -o" LDFLAGS="-lesslp2" FC=mpxlf \
	FFLAGS="-g -c -C -NS2048  -qarch=pwr2 -qnosave"  \
	CPFLAGS="-D$(STRESS) -DMPI -DESSL -D'POINTER=integer'" \
	EX=$(EX) BINROOT=$(BINROOT) $(TYPE)

#================== IBM SP2 FFTW version ===============================
sp2-mpi-fftw: dpp 
	cp /usr/lpp/ppe.poe/include/mpif.h mpif.h 
	$(MAKE) FC=mpxlf FFLAGS="-c -NS2048 -qarch=pwr2 -qnosave" \
	CPFLAGS="-D$(STRESS) -DMPI -D'POINTER=integer' -DFFTW
	$(MAKE) LD="mpxlf -o" LDFLAGS="-lesslp2 -lfftw -lrfftw -L$(FFTW_LIBRARY)" \
	FC=mpxlf FFLAGS="-c -O3 -NS2048  -qarch=pwr2 -qnosave" \
	CPFLAGS="-D$(STRESS) -DMPI -D'POINTER=integer' -DFFTW -DESSL" \
	EX=$(EX) BINROOT=$(BINROOT) $(TYPE)

#======== Sun Ultra-2 (serial) =======================================
sun-ultra: dpp 
	$(MAKE) LD="/opt/SUNWspro/bin/f90 -o" LDFLAGS=""  \
	FC=/opt/SUNWspro/bin/f90 \
	FFLAGS="-c -xtarget=ultra2i -xcache=16/32/1:2048/64/1 -g " \
	TIMER="" OBJ_SPME="" \
	CPFLAGS="-D$(STRESS) -DSERIAL -D'POINTER=integer'" \
	EX=$(EX) BINROOT=$(BINROOT) $(TYPE)

#========= Daresbury Beowulf (Absoft compiler) =======================
beowulf-absoft: dpp
	cp /usr/local/lam-6.2/h/mpif.h mpif.h
	$(MAKE) LD="/usr/bin/f90 -o" \
	LDFLAGS="-L/home/kcm/mpich-absoft/mpich/lib/LINUX/ch_p4/ -lmpich" \
	FC=/usr/bin/f90 FFLAGS="-c -O -B100" TIMER="" \
	CPFLAGS="-D$(STRESS) -DMPI -P -D'POINTER=integer' \
	-I/home/kcm/mpich-absoft/mpich/include" \
	EX=$(EX) BINROOT=$(BINROOT) $(TYPE)

#=====================================================================
# Interpolation tables options

# Default code. Force tables interpolation in r-space 3pt interpolation
3pt: check $(OBJ_ALL) $(OBJ_RRR) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(TIMER) $(OBJ_SPME) \
	$(OBJ_HKE)
	$(LD) $(EXE) $(OBJ_ALL) $(OBJ_RRR) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(TIMER) \
	$(LDFLAGS) $(LDLIBS) $(OBJ_SPME) $(OBJ_HKE)

# Force tables interpolation in r-space, 4pt interpolation
4pt: check $(OBJ_ALL) $(OBJ_4PT) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(TIMER) $(OBJ_SPME) \
	$(OBJ_HKE)
	$(LD) $(EXE) $(OBJ_ALL) $(OBJ_4PT) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(TIMER) \
	$(LDFLAGS) $(LDLIBS) $(OBJ_SPME) $(OBJ_HKE)

# Force tables interpolation in  r-squared
rsq: check $(OBJ_ALL) $(OBJ_RSQ)  $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(TIMER) $(OBJ_SPME) \
	$(OBJ_HKE)
	$(LD) $(EXE) $(OBJ_ALL) $(OBJ_RSQ) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(TIMER) \
	$(LDFLAGS) $(LDLIBS) $(OBJ_SPME) $(OBJ_HKE)

3ptmp: check $(OBJ_ALL) $(OBJ_RRR) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(OBJ_MULTI) $(TIMER) $(OBJ_HKE)
	$(LD) $(EXE) $(LDFLAGS) $(LDLIBS) $(OBJ_ALL) $(OBJ_RRR) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(OBJ_MULTI) $(TIMER) $(OBJ_HKE)

# Force tables interpolation in r-space, 4pt interpolation
4ptmp: check $(OBJ_ALL) $(OBJ_4PT) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(OBJ_MULTI) $(TIMER) $(OBJ_SPME) $(OBJ_HKE)
	$(LD) $(EXE) $(OBJ_ALL) $(OBJ_4PT) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(OBJ_MULTI) $(TIMER) \
	$(LDFLAGS) $(LDLIBS) $(OBJ_SPME) $(OBJ_HKE)

# Force tables interpolation in  r-squared
rsqmp: check $(OBJ_ALL) $(OBJ_RSQ)  $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(OBJ_MULTI) $(TIMER) $(OBJ_SPME) $(OBJ_HKE)
	$(LD) $(EXE) $(OBJ_ALL) $(OBJ_RSQ) $(OBJ_NEU) $(OBJ_RIG) $(OBJ_EXT) $(OBJ_MULTI) $(TIMER) \
	$(LDFLAGS) $(LDLIBS) $(OBJ_SPME) $(OBJ_HKE)

#=====================================================================
# Check that a machine has been specified
check:
	@if test $(FC) = "undefined";\
	then echo "You must specify a target machine!"; \
	exit 99;\
	fi

#=====================================================================
# Clean up the source directory
clean:
	rm -f $(OBJ_ALL) $(OBJ_RRR) $(OBJ_EXT) $(OBJ_NEU) $(OBJ_HKE) \
	$(OBJ_RIG) $(TIMER) $(OBJ_SPME) $(OBJ_4PT) $(OBJ_RSQ) $(OBJ_MULTI) \
	*.tmp.f mpif.h

$(FILES):
	make links1

links1:
	@for file in ${FILES} ; do \
	echo linking to $$file ;\
	rm -f $$file ;\
	ln -s ../source/$$file $$file ;\
	done


#=====================================================================
# Compile preprocessor code
dpp: dpp.c
	$(CC) dpp.c -o dpp

#=====================================================================
# Declare dependencies : c preprocess all .f files
.f.o: 
	$(DPP) $(CPFLAGS)  $*.f > $*.tmp.f
	$(FC) $(FFLAGS) $*.tmp.f
	mv $*.tmp.o $*.o

.c.o: 
	$(CC) -c $*.c

#=====================================================================
# Export
tar : 
	tar -cf dlmulti.tar $(F_ALL) $(F_RRR) $(F_4PT) $(F_RSQ) $(F_NEU) $(F_RIG) $(F_EXT) $(F_MULTI) $(F_SPME) $(F_HKE) comms.inc dl_params.inc etime.c dpp.c Makefile README
	gzip dlmulti.tar

#=====================================================================
# Concatenation
listing : 
	cat $(F_ALL) $(F_RRR) $(F_HKE) $(F_NEU) $(F_RIG) $(F_EXT) $(F_MULTI) $(F_SPME) > all/f.f

#=====================================================================
# Declare dependency on parameters file

$(OBJ_ALL): dl_params.inc
$(OBJ_RRR): dl_params.inc
$(OBJ_4PT): dl_params.inc
$(OBJ_RSQ): dl_params.inc
$(OBJ_NEU): dl_params.inc
$(OBJ_RIG): dl_params.inc
$(OBJ_EXT): dl_params.inc
$(OBJ_SPME): dl_params.inc
$(OBJ_HKE): dl_params.inc


W Smith 2003-05-12