Difference between revisions of "VASP make"

From UFRC
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Software]]
 
[[Category:Software]]
 
[[VASP|Back to VASP page]]
 
[[VASP|Back to VASP page]]
=== Makefile for VASP 5 ===
 
<source lang=make>
 
.SUFFIXES: .inc .f .f90 .F
 
#-----------------------------------------------------------------------
 
# Makefile for Intel Fortran compiler at UF HPC
 
#-----------------------------------------------------------------------
 
  
# all CPP processed fortran files have the extension .f90
+
The latest VASP uses makefile.include to set up compiler options/flags. Here is one example makefile.include file that was used to build VASP with OpenMPI on HiPerGator. Before compiling, you need to load intel and openmpi modules.  
SUFFIX=.f90
 
  
#-----------------------------------------------------------------------
+
=== makefile.include for VASP 5 ===
# fortran compiler and linker
+
<source lang=make>
#-----------------------------------------------------------------------
+
# Precompiler options
FC=mpif90
+
CPP_OPTIONS= -DMPI -DHOST=\"IFC91_ompi\" -DIFC \
FCL=$(FC)
+
            -DnoAugXCmeta \
 
+
            -DPGF90 \
CPP_=fpp -f_com=no -free -w0 $*.F $*$(SUFFIX)
+
            -DMPI -DMPI_BLOCK=8000 \
 
+
            -Duse_collective \
#-----------------------------------------------------------------------
+
            -DCACHE_SIZE=4000 \
# possible options for CPP:
+
            -Davoidalloc \
# NGXhalf            charge density  reduced in X direction
+
            -Duse_bse_te \
# wNGXhalf            gamma point only reduced in X direction
+
            -Dtbdyn \
# avoidalloc          avoid ALLOCATE if possible
+
            -Duse_shmem
# PGF90              work around some for some PGF90 / IFC bugs
 
# CACHE_SIZE          1000 for PII,PIII, 5000 for Athlon, 8000-12000 P4, PD
 
# RPROMU_DGEMV        use DGEMV instead of DGEMM in RPRO (depends on used BLAS)
 
# RACCMU_DGEMV        use DGEMV instead of DGEMM in RACC (depends on used BLAS)
 
# tbdyn                MD package of Tomas  Bucko
 
#-----------------------------------------------------------------------
 
 
 
CPP_=fpp -f_com=no -free -w0 $*.F $*$(SUFFIX)
 
CPP = $(CPP_) \
 
-DHOST=\"Linux-UFHPC\" \
 
-DMPI \
 
-DIFC \
 
-DPGF90 \
 
-Davoidalloc \
 
-DMPI_BLOCK=8000 \
 
-DCACHE_SIZE=4000 \
 
-Duse_collective \
 
-DscaLAPACK
 
 
 
#-----------------------------------------------------------------------
 
# optimization
 
# we have tested whether higher optimisation improves performance
 
# -axK  SSE1 optimization,  but also generate code executable on all mach.
 
#      xK improves performance somewhat on XP, and a is required in order
 
#      to run the code on older Athlons as well
 
# -xW  SSE2 optimization
 
# -axW  SSE2 optimization,  but also generate code executable on all mach.
 
# -tpp6 P3 optimization
 
# -tpp7 P4 optimization
 
#-----------------------------------------------------------------------
 
 
 
 
 
FFLAGS =  -free -names lowercase -assume byterecl
 
 
 
OFLAG=-O2 -xSSE2 -axSSE4.2,SSE4.1,SSSE3,SSE3 -unroll-aggressive -warn general
 
 
 
OFLAG_HIGH = $(OFLAG)
 
OBJ_HIGH =
 
OBJ_NOOPT =
 
DEBUG  = -free -O0
 
INLINE = $(OFLAG)
 
  
#------------------------------MKL--------------------------------------
+
CPP        = fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)
   
 
MKLDIR    = $(HPC_MKL_DIR)
 
MKLLIBS  = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
 
MKLLIBDIR = $(HPC_MKL_DIR)/lib/intel64
 
MKL      = -L$(MKLLIBDIR) $(MKLLIBS)
 
#-----------------------------------------------------------------------
 
SCA      = -lmkl_scalapack_lp64
 
BLACS    = -lmkl_blacs_openmpi_lp64
 
SCALAPACK = $(SCA) $(BLACS)
 
#-----------------------------------------------------------------------
 
# MKL FFTs w/ FFTW wrappers
 
#
 
FFTLIB  =
 
#-----------------------------------------------------------------------
 
# Miscellaneous VASP routines
 
#
 
MISC = -Llib -ldmy
 
  
#-----------------------------------------------------------------------
+
FC        = mpif90 -msse3 -axcore-avx2,core-avx-i
LIBS = $(FFTLIB) $(SCALAPACK) $(BLAS) $(MKL) $(MISC)
+
FCL        = mpif90 -mkl
RPATH  = -Wl,-rpath -Wl,$(MKLDIR)
 
LINK  = -shared-intel $(RPATH)
 
  
#-----------------------------------------------------------------------
+
FREE      = -free -names lowercase
FFT3D = fftmpi_map.o fftmpiw.o fftw3d.o fft3dlib.o
 
  
#-----------------------------------------------------------------------
+
FFLAGS    = -assume byterecl -w
# general rules and compile lines
+
OFLAG      = -O2 -msse3 -axcore-avx2,core-avx-i
#-----------------------------------------------------------------------
+
OFLAG_IN  = $(OFLAG)
BASIC=  symmetry.o symlib.o  lattlib.o  random.o
+
DEBUG      = -O0
  
SOURCE= base.o    mpi.o      smart_allocate.o      xml.o  \
+
INCS      =-I$(MKLROOT)/include/fftw
        constant.o jacobi.o  main_mpi.o  scala.o  \
 
        asa.o      lattice.o  poscar.o  ini.o  mgrid.o  xclib.o  vdw_nl.o  xclib_grad.o \
 
        radial.o  pseudo.o  gridq.o    ebs.o  \
 
        mkpoints.o wave.o    wave_mpi.o  wave_high.o  spinsym.o \
 
        $(BASIC)   nonl.o    nonlr.o    nonl_high.o dfast.o    choleski2.o \
 
        mix.o      hamil.o    xcgrad.o  xcspin.o    potex1.o  potex2.o  \
 
        constrmag.o cl_shift.o relativistic.o LDApU.o \
 
        paw_base.o metagga.o  egrad.o    pawsym.o  pawfock.o  pawlhf.o  rhfatm.o  hyperfine.o paw.
 
o  \
 
        mkpoints_full.o      charge.o  Lebedev-Laikov.o  stockholder.o dipol.o    pot.o \
 
        dos.o      elf.o      tet.o      tetweight.o hamil_rot.o \
 
        chain.o    dyna.o    k-proj.o    sphpro.o    us.o  core_rel.o \
 
        aedens.o  wavpre.o  wavpre_noio.o broyden.o \
 
        dynbr.o    hamil_high.o  rmm-diis.o reader.o  writer.o  tutor.o xml_writer.o \
 
        brent.o    stufak.o  fileio.o  opergrid.o stepver.o  \
 
        chgloc.o  fast_aug.o fock_multipole.o  fock.o  mkpoints_change.o sym_grad.o \
 
        mymath.o  internals.o npt_dynamics.o  dynconstr.o dimer_heyden.o dvvtrajectory.o vdwforcef
 
ield.o \
 
        nmr.o      pead.o    subrot.o  subrot_scf.o \
 
        force.o    pwlhf.o    gw_model.o optreal.o  steep.o    davidson.o  david_inner.o \
 
        electron.o rot.o  electron_all.o shm.o    pardens.o  paircorrection.o \
 
        optics.o  constr_cell_relax.o  stm.o    finite_diff.o elpol.o    \
 
        hamil_lr.o rmm-diis_lr.o  subrot_cluster.o subrot_lr.o \
 
        lr_helper.o hamil_lrf.o  elinear_response.o ilinear_response.o \
 
        linear_optics.o \
 
        setlocalpp.o  wannier.o electron_OEP.o electron_lhf.o twoelectron4o.o \
 
        mlwf.o    ratpol.o screened_2e.o wave_cacher.o chi_base.o wpot.o \
 
        local_field.o ump2.o ump2kpar.o fcidump.o ump2no.o \
 
        bse_te.o bse.o acfdt.o chi.o sydmat.o dmft.o \
 
        rmm-diis_mlr.o  linear_response_NMR.o wannier_interpol.o linear_response.o
 
  
INCS = -I$(MKLDIR)/include/fftw
+
#LAPACK    = -lmkl_scalapack_lp64
vasp: $(SOURCE) $(FFT3D) $(INC) main.o
+
BLACS      = -lmkl_blacs_openmpi_lp64
rm -f vasp
+
#SCALAPACK = $(LAPACK) $(BLACS)
$(FCL) -o vasp main.o $(SOURCE)  $(FFT3D) $(LINK) $(LIBS)
+
BLAS      = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
makeparam: $(SOURCE) $(FFT3D) makeparam.o main.F $(INC)
+
FFTLIB    = -lfftw3xf
$(FCL) -o makeparam  $(LINK) makeparam.o $(SOURCE) $(FFT3D) $(LIBS)
 
zgemmtest: zgemmtest.o base.o random.o $(INC)
 
$(FCL) -o zgemmtest $(LINK) zgemmtest.o random.o base.o $(LIBS)
 
dgemmtest: dgemmtest.o base.o random.o $(INC)
 
$(FCL) -o dgemmtest $(LINK) dgemmtest.o random.o base.o $(LIBS)
 
ffttest: base.o smart_allocate.o mpi.o mgrid.o random.o ffttest.o $(FFT3D) $(INC)
 
$(FCL) -o ffttest $(LINK) ffttest.o mpi.o mgrid.o random.o smart_allocate.o base.o $(FFT3D) $
 
(LIBS)
 
kpoints: $(SOURCE) $(FFT3D) makekpoints.o main.F $(INC)
 
$(FCL) -o kpoints $(LINK) makekpoints.o $(SOURCE) $(FFT3D) $(LIBS)
 
  
clean:
+
#OBJECTS    = fftmpi.o fftmpi_map.o fft3dfurth.o fft3dlib.o
-rm -f *.g *.f *.o *.L *.mod ; touch *.F
+
OBJECTS    = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o \
  
main.o: main$(SUFFIX)
+
LLIBS      = -L$(HPC_MKL_LIB) $(BLAS)  
$(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)
+
OBJECTS_O1 += fft3dfurth.o fftw3d.o fftmpi.o fftmpiw.o
$(FC) $(FFLAGS)$(DEBUG)  $(INCS) -c makeparam$(SUFFIX)
+
OBJECTS_O2 += fft3dlib.o
  
makeparam$(SUFFIX): makeparam.F main.F
+
# For what used to be vasp.5.lib
#
+
CPP_LIB    = $(CPP)
# MIND: I do not have a full dependency list for the include
+
FC_LIB    = $(FC)
# and MODULES: here are only the minimal basic dependencies
+
CC_LIB    = icc -msse3 -axcore-avx2,core-avx-i
# if one strucuture is changed then touch_dep must be called
+
CFLAGS_LIB = -O
# with the corresponding name of the structure
+
FFLAGS_LIB = -O1
#
+
FREE_LIB  = $(FREE)
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
 
mkpoints.o: mkpoints.inc mkpoints.F
 
wave.o: wave.F
 
nonl.o: nonl.inc nonl.F
 
nonlr.o: nonlr.inc nonlr.F
 
  
$(OBJ_HIGH):
+
OBJECTS_LIB= linpack_double.o getshmem.o
$(CPP)
 
$(FC) $(FFLAGS) $(OFLAG_HIGH) $(INCS) -c $*$(SUFFIX)
 
$(OBJ_NOOPT):
 
$(CPP)
 
$(FC) $(FFLAGS) $(INCS) -c $*$(SUFFIX)
 
  
fft3dlib_f77.o: fft3dlib_f77.F
+
# For the parser library
$(CPP)
+
CXX_PARS  = icpc
$(F77) $(FFLAGS_F77) -c $*$(SUFFIX)
 
  
.F.o:
+
LIBS      += parser
$(CPP)
+
LLIBS      += -Lparser -lparser -lstdc++
$(FC) $(FFLAGS) $(OFLAG) $(INCS) -c $*$(SUFFIX)
 
.F$(SUFFIX):
 
$(CPP)
 
$(SUFFIX).o:
 
$(FC) $(FFLAGS) $(OFLAG) $(INCS) -c $*$(SUFFIX)
 
  
# special rules
+
# Normally no need to change this
#-----------------------------------------------------------------------
+
SRCDIR    = ../../src
# these special rules have been tested for ifc.11 and ifc.12 only
+
BINDIR    = ../../bin
  
fft3dlib.o : fft3dlib.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O2 -c $*$(SUFFIX)
 
fft3dfurth.o : fft3dfurth.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O1 -c $*$(SUFFIX)
 
fftw3d.o : fftw3d.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O1 $(INCS) -c $*$(SUFFIX)
 
fftmpi.o : fftmpi.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O1 -c $*$(SUFFIX)
 
fftmpiw.o : fftmpiw.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O1 $(INCS) -c $*$(SUFFIX)
 
wave_high.o : wave_high.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O1 -c $*$(SUFFIX)
 
# the following rules are probably no longer required (-O3 seems to work)
 
wave.o : wave.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O2 -c $*$(SUFFIX)
 
paw.o : paw.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O2 -c $*$(SUFFIX)
 
cl_shift.o : cl_shift.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O2 -c $*$(SUFFIX)
 
us.o : us.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O2 -c $*$(SUFFIX)
 
LDApU.o : LDApU.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O2 -c $*$(SUFFIX)
 
radial.o : radial.F
 
$(CPP)
 
$(FC) -FR -names lowercase -O1 -c $*$(SUFFIX)
 
  
 
</source>
 
</source>

Latest revision as of 03:23, 17 April 2018

Back to VASP page

The latest VASP uses makefile.include to set up compiler options/flags. Here is one example makefile.include file that was used to build VASP with OpenMPI on HiPerGator. Before compiling, you need to load intel and openmpi modules.

makefile.include for VASP 5

# Precompiler options
CPP_OPTIONS= -DMPI -DHOST=\"IFC91_ompi\" -DIFC \
             -DnoAugXCmeta \
             -DPGF90 \
             -DMPI -DMPI_BLOCK=8000 \
             -Duse_collective \
             -DCACHE_SIZE=4000 \
             -Davoidalloc \
             -Duse_bse_te \
             -Dtbdyn \
             -Duse_shmem 

CPP        = fpp -f_com=no -free -w0  $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)

FC         = mpif90 -msse3 -axcore-avx2,core-avx-i
FCL        = mpif90 -mkl

FREE       = -free -names lowercase

FFLAGS     = -assume byterecl -w
OFLAG      = -O2 -msse3 -axcore-avx2,core-avx-i 
OFLAG_IN   = $(OFLAG)
DEBUG      = -O0

INCS       =-I$(MKLROOT)/include/fftw

#LAPACK     = -lmkl_scalapack_lp64
BLACS      = -lmkl_blacs_openmpi_lp64
#SCALAPACK  = $(LAPACK) $(BLACS)
BLAS       = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
FFTLIB     = -lfftw3xf

#OBJECTS    = fftmpi.o fftmpi_map.o fft3dfurth.o fft3dlib.o
OBJECTS    = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o \

LLIBS      = -L$(HPC_MKL_LIB) $(BLAS) 

OBJECTS_O1 += fft3dfurth.o fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

# For what used to be vasp.5.lib
CPP_LIB    = $(CPP)
FC_LIB     = $(FC)
CC_LIB     = icc -msse3 -axcore-avx2,core-avx-i
CFLAGS_LIB = -O
FFLAGS_LIB = -O1
FREE_LIB   = $(FREE)

OBJECTS_LIB= linpack_double.o getshmem.o

# For the parser library
CXX_PARS   = icpc

LIBS       += parser
LLIBS      += -Lparser -lparser -lstdc++

# Normally no need to change this
SRCDIR     = ../../src
BINDIR     = ../../bin