.SUFFIXES: .inc .f .f90 .F #----------------------------------------------------------------------- # Makefile for Portland Group F90/HPF compiler release 3.0-1, 3.1 # and release 1.7 # (http://www.pgroup.com/ & ftp://ftp.pgroup.com/x86/, you need # to order the HPF/F90 suite # if you have already installed release 1.7 there is no need to upgrad to # 3.0.1 since there are no measurable performance enhancement) # # The makefile was tested only under Linux on Intel platforms # (Suse 5.3, libc 6 <-> glibc 2.X) # The CPP_ line must be changed for other releases (i.e. Red Hat) ! # # Mind that some Linux distributions (Suse 6.1) have a bug in # libm causing small errors in the error-function (total energy # is therefore wrong by about 1meV/atom). The recommended # solution is an update of libc. # # MIND: blas must be installed on the machine # there are several options: # 1) PGI pgf90 release 3.0.1 includes "optimized" blas libraries # but their performance is quite bad (not to say very bad 50 Mflops!) # option 3) is certainly more desireable # 2) also slow but works too: # retrieve the lapackage from ftp.netlib.org # and compile the blas routines (BLAS/SRC directory) # please use g77 or f77 for the compilation. When I tried to # use pgf77 or pgf90 for BLAS, VASP hang up when calling # ZHEEV (however this was with lapack 1.1 now I use lapack 2.0) # 3) most desirable: get an optimized BLAS # for a list of optimized BLAS try # http://www.kachinatech.com/~hjjou/scilib/opt_blas.html # 3a) I have downloaded and tested # http://www.cs.utk.edu/~ghenry/distrib/ # and found a peak performance of 250 MFlops on a PII 400 MHz # which is really excellent # This library definitely outperforms the pgi blas library # or the public domain blas libraries by a factor of 2-4. # 3b) or obtain the atlas based blas routines # http://www.netlib.org/atlas/index.html # you certainly need atlas on the K7 Athlon, since the PII optimised # routines are not optimal on the Athlon. # f you want to use atlas based BLAS, check the lines around LIB= # #----------------------------------------------------------------------- # all CPP processed fortran files have the extension .f SUFFIX=.f # fortran compiler FC=mpif90 -f90=/usr/local/intel-6.0/compiler60/ia64/bin/efc # C-preprocessor define any of the flags given below # single_precission single precission BLAS/LAPACK calls # vector # essl use ESSL call sequence for DSYGV # NGXhalf charge density reduced in X direction # NGZhalf charge density reduced in Z direction # wNGXhalf gamma point only reduced in X direction # wNGZhalf gamma point only reduced in Z direction # whereis CPP ?? (I need CPP, can't use gcc with proper options) # that's the location of gcc for SUSE 5.3 #CPP_ = /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -P -C # that's probably the right line for Red Hat #CPP_ = /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/cpp -P -C # SUSE 6.X, maybe Red Hat as well CPP_ = /usr/bin/cpp -P -C -ansi CPP = $(CPP_) \ -Dkind8 -DNGXhalf -DCACHE_SIZE=4000 -DINTEL <$*.F >$*.f # general fortran flags (there must a trailing blank on this line) FFLAGS = -FR -w -ftz -r8 # optimization OFLAG = -O2 OFLAG_HIGH = $(OFLAG) OBJ_HIGH = OBJ_NOOPT = DEBUG = -g -O0 INLINE = $(OFLAG) # options for linking LINK = # it is assumed that the blas library is called libblas.a # and located in /usr/local/lib LIB = -L../vasp.4.lib -ldmy ../vasp.4.lib/linpack_double.o \ ../vasp.4.lib/lapack_double.o -L$(HOME) -lblas -Vaxlib # # the following lines should allow you to link to mkl library #LIB = -L../vasp.4.lib -ldmy ../vasp.4.lib/linpack_double.o \ # ../vasp.4.lib/lapack_double.o -L/usr/local/mkl/lib -lpthread -lmkl_itp -Vaxlib FFT3D = fft3dfurth.o fft3dlib.o #----------------------------------------------------------------------- # MPI section, uncomment the lines starting with #CPP # # one comment for users of mpich or lam: # You must *not* compile mpi with g77/f77, because f77/g77 # appends *two* underscores to symbols that contain already an # underscore (i.e. MPI_SEND becomes mpi_send__). The pgf90 # compiler however appends only one underscore. # Precompiled mpi version will also not work !!! # # We found that mpich.1.2.1 and lam-6.5.X are stable # mpich.1.2.1 was configured with # ./configure -prefix=/usr/local/mpich_nodvdbg -fc="pgf77 -Mx,119,0x200000" \ # -f90="pgf90 -Mx,119,0x200000" \ # --without-romio --without-mpe -opt=-O \ # # lam was configured with the line # ./configure -prefix /usr/local/lam-6.5.X --with-cflags=-O -with-fc=pgf90 \ # --with-f77flags=-O --without-romio # # lam was generally faster and we found an average communication # band with of roughly 160 MBit/s (full duplex) # # for LAM and MPICH please change the line that links VASP # from # $(FC) -o vasp $(LINK) main.o $(SOURCE) $(FFT3D) $(LIB) # to # mpif77 -o vasp $(LINK) main.o $(SOURCE) $(FFT3D) $(LIB) # # !!! Please do not send me any queries on how to install mpich, I will # certainly not answer them !!!! #----------------------------------------------------------------------- CPP = $(CPP_) -DMPI \ -Dkind8 -DNGZhalf -DCACHE_SIZE=4000 -DINTEL <$*.F >$*.f # link to /usr/local/lib/libblas.a LIB = -L../vasp.4.lib -ldmy ../vasp.4.lib/linpack_double.o \ ../vasp.4.lib/lapack_double.o -L$(HOME) -lblas -Vaxlib # the following lines should allow you to link to mkl library #LIB = -L../vasp.4.lib -ldmy ../vasp.4.lib/linpack_double.o \ # ../vasp.4.lib/lapack_double.o -L/usr/local/mkl/lib -lpthread -lmkl_itp -Vaxlib # FFT3D = fftmpi.o fftmpi_map.o fft3dlib.o #----------------------------------------------------------------------- # general rules and compile lines #----------------------------------------------------------------------- BASIC= symmetry.o symlib.o lattlib.o random.o SOURCE= base.o mpi.o smart_allocate.o \ constant.o jacobi.o main_mpi.o scala.o \ asa.o lattice.o poscar.o ini.o setex.o radial.o \ pseudo.o mgrid.o mkpoints.o wave.o wave_mpi.o $(BASIC) \ nonl.o nonlr.o dfast.o choleski2.o \ mix.o charge.o xcgrad.o xcspin.o potex1.o potex2.o \ pot.o force.o dos.o elf.o \ tet.o hamil.o steep.o hamil_rot.o \ sphpro.o chain.o dyna.o paw.o us.o \ rot.o ebs.o wavpre.o wavpre_noio.o broyden.o \ dynbr.o rmm-diis.o reader.o tutor.o \ brent.o stufak.o fileio.o opergrid.o stepver.o \ dipol.o xclib.o chgloc.o subrot.o optreal.o \ edtest.o electron.o shm.o pardens.o paircorrection.o \ optics.o constr_cell_relax.o cl_shift.o stm.o elpol.o INC= vasp: $(SOURCE) $(FFT3D) $(INC) main.o rm -f vasp $(FC) -o vasp $(LINK) main.o $(SOURCE) $(FFT3D) $(LIB) makeparam: $(SOURCE) $(FFT3D) makeparam.o main.F $(INC) $(FC) -o makeparam $(LINK) makeparam.o $(SOURCE) $(FFT3D) $(LIB) zgemmtest: zgemmtest.o base.o random.o $(INC) $(FC) -o zgemmtest $(LINK) zgemmtest.o random.o base.o $(LIB) dgemmtest: dgemmtest.o base.o random.o $(INC) $(FC) -o dgemmtest $(LINK) dgemmtest.o random.o base.o $(LIB) ffttest: base.o smart_allocate.o mpi.o mgrid.o random.o ffttest.o $(FFT3D) $(INC) $(FC) -o ffttest $(LINK) ffttest.o mpi.o mgrid.o random.o smart_allocate.o base.o $(FFT3D) $(LIB) kpoints: $(SOURCE) $(FFT3D) makekpoints.o main.F $(INC) $(FC) -o kpoints $(LINK) makekpoints.o $(SOURCE) $(FFT3D) $(LIB) clean: -rm -f *.f *.o *.L ; touch *.F main.o: main$(SUFFIX) $(FC) $(FFLAGS)$(DEBUG) $(INCS) -c main$(SUFFIX) xcgrad.o: xcgrad$(SUFFIX) $(FC) $(FFLAGS) $(INLINE) $(INCS) -c xcgrad$(SUFFIX) xcspin.o: xcspin$(SUFFIX) $(FC) $(FFLAGS) $(INLINE) $(INCS) -c xcspin$(SUFFIX) makeparam.o: makeparam$(SUFFIX) $(FC) $(FFLAGS)$(DEBUG) $(INCS) -c makeparam$(SUFFIX) makeparam$(SUFFIX): makeparam.F main.F # # MIND: I do not have a full dependency list for the include # and MODULES: here are only the minimal basic dependencies # if one strucuture is changed then touch_dep must be called # with the corresponding name of the structure # base.o: base.inc base.F mgrid.o: mgrid.inc mgrid.F constant.o: constant.inc constant.F lattice.o: lattice.inc lattice.F setex.o: setexm.inc setex.F pseudo.o: pseudo.inc pseudo.F poscar.o: poscar.inc poscar.F mkpoints.o: mkpoints.inc mkpoints.F wave.o: wave.inc wave.F nonl.o: nonl.inc nonl.F nonlr.o: nonlr.inc nonlr.F $(OBJ_HIGH): $(CPP) $(FC) $(FFLAGS) $(OFLAG_HIGH) $(INCS) -c $*$(SUFFIX) $(OBJ_NOOPT): $(CPP) $(FC) $(FFLAGS) $(INCS) -c $*$(SUFFIX) fft3dlib_f77.o: fft3dlib_f77.F $(CPP) $(F77) $(FFLAGS_F77) -c $*$(SUFFIX) .F.o: $(CPP) $(FC) $(FFLAGS) $(OFLAG) $(INCS) -c $*$(SUFFIX) .F$(SUFFIX): $(CPP) $(SUFFIX).o: $(FC) $(FFLAGS) $(OFLAG) $(INCS) -c $*$(SUFFIX) # additional rules dummy.o: dummy.f f77 dummy.f -c -o dummy.o