in the makefile.
For VASP 4.6, starting with makefile.linux_ifc_ath coming with VASP, we did the following modifications
compiler flags:
.SUFFIXES: .inc .f .f90 .F
#-----------------------------------------------------------------------
# Makefile for Intel Fortran compiler for Athlon XP systems
#
# The makefile was tested only under Linux on Intel platforms
# (Suse 5.3- Suse 9.0)
# the followin compiler versions have been tested
# 5.0, 6.0, 7.0 and 7.1 (some 8.0 versions seem to fail compiling the code)
# presently we recommend version 7.1 or 7.0, since these
# releases have been used to compile the present code versions
#
# it might be required to change some of library pathes, since
# LINUX installation vary a lot
# Hence check ***ALL**** options in this makefile very carefully
#-----------------------------------------------------------------------
#
# BLAS must be installed on the machine
# there are several options:
# 1) very slow but works:
# 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)
# 2) most desirable: get an optimized BLAS
#
# the two most reliable packages around are presently:
# 3a) Intels own optimised BLAS (PIII, P4, Itanium)
#
http://developer.intel.com/software/products/mkl/ # this is really excellent when you use Intel CPU's
#
# 3b) or obtain the atlas based BLAS routines
#
# you certainly need atlas on the Athlon, since the mkl
# routines are not optimal on the Athlon.
# If you want to use atlas based BLAS, check the lines around LIB=
#
# 3c) mindblowing fast SSE2 (4 GFlops on P4, 2.53 GHz)
# Kazushige Goto's BLAS
#
#
#-----------------------------------------------------------------------
# all CPP processed fortran files have the extension .f90
SUFFIX=.f90
#-----------------------------------------------------------------------
# fortran compiler and linker
#-----------------------------------------------------------------------
#FC=ifc
# fortran linker
#FCL=$(FC)
#-----------------------------------------------------------------------
# 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 some Red Hat distribution:
#
# CPP_ = /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/cpp -P -C
#
# SUSE X.X, maybe some Red Hat distributions:
CPP_ = ./preprocess <$*.F | /usr/bin/cpp -P -C -traditional >$*$(SUFFIX)
#-----------------------------------------------------------------------
# possible options for CPP:
# NGXhalf charge density reduced in X direction
# wNGXhalf gamma point only reduced in X direction
# avoidalloc avoid ALLOCATE if possible
# IFC work around some IFC bugs
# CACHE_SIZE 1000 for PII,PIII, 5000 for Athlon, 8000-12000 P4
# 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)
# for Atlas -DRPROMU_DGEMV is recommended
#-----------------------------------------------------------------------
CPP = $(CPP_) -DHOST=\"LinuxIFC_ath\" \
-Dkind8 -DNGXhalf -DCACHE_SIZE=5000 -DPGF90 -Davoidalloc \
-DMPI
# -DRPROMU_DGEMV \
#-----------------------------------------------------------------------
# general fortran flags (there must a trailing blank on this line)
#-----------------------------------------------------------------------
FFLAGS = -FR -lowercase -assu byterecl
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
# -axW Can generate specialized code paths for SSE2 and SSE instructions
# for Intel processors, and it can optimize for Intel
# Pentium(R) 4 processors and Intel(R) Xeon(R) processors with SSE2.
OFLAG=-O3 -axW -tpp6
OFLAG=-O3 -axW
# It seems to be necessary a low-level optimization when compiling the parallel version
# ("very serious problems the old and the new charge density differ") at least for FFTs
OFLAG2=-O1 -axW
OFLAG_HIGH = $(OFLAG)
OBJ_HIGH =
OBJ_NOOPT =
DEBUG = -FR -O0
INLINE = $(OFLAG)
#-----------------------------------------------------------------------
# the following lines specify the position of BLAS and LAPACK
# on Athlon, VASP works fastest with the Atlas library
# so that's what I recommend
#-----------------------------------------------------------------------
# Atlas based libraries
ATLASHOME= $(HOME)/archives/BLAS_OPT/ATLAS/lib/Linux_ATHLONXP_SSE1/
BLAS= -L$(ATLASHOME) -lf77blas -latlas
# use the mkl Intel libraries for p4 ()
# mkl.5.1
# set -DRPROMU_DGEMV -DRACCMU_DGEMV in the CPP lines
#BLAS=-L/opt/intel/mkl/lib/32 -lmkl_p4 -lpthread
# mkl.5.2 requires also to -lguide library
# set -DRPROMU_DGEMV -DRACCMU_DGEMV in the CPP lines
#BLAS=-L/opt/intel/mkl/lib/32 -lmkl_p4 -lguide -lpthread
# even faster Kazushige Goto's BLAS
#
#BLAS= /opt/libs/libgoto/libgoto_p4_512-r0.6.so
# LAPACK, simplest use vasp.4.lib/lapack_double
#LAPACK= ../vasp.4.lib/lapack_double.o
# use atlas optimized part of lapack
LAPACK= ../vasp.4.lib/lapack_atlas.o -llapack -lcblas
# use the mkl Intel lapack
#LAPACK= -lmkl_lapack
# MKL pure layered model (10 style). BLAS/LAPACK libraries
# with parallel MKL supporting LP64 interface. -lm if for FFT interface.
# RTL library iomp5 is preferred over traditional guide since it fully
# supports threaded and non-threaded user's applications with both
# intel and gnu compilers
# Make sure that -lpthread appears at the end of the link line.
BLAS= -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -liomp5 -lpthread
LAPACK=
#-----------------------------------------------------------------------
#LIB = -L../vasp.4.lib -ldmy \
# ../vasp.4.lib/linpack_double.o $(LAPACK) \
# $(BLAS)
# options for linking (for compiler version 6.X, 7.1) nothing is required
LINK =
# compiler version 7.0 generates some vector statments which are located
# in the svml library, add the LIBPATH and the library (just in case)
#LINK = -L/opt/intel/compiler70/ia32/lib/ -lsvml
#-----------------------------------------------------------------------
# fft libraries:
# VASP.4.6 can use fftw.3.0.X (
) # since this version is faster on P4 machines, we recommend to use it
#-----------------------------------------------------------------------
#FFT3D = fft3dfurth.o fft3dlib.o
#FFT3D = fftw3d.o fft3dlib.o /opt/libs/fftw-3.0.1/lib/libfftw3.a
#=======================================================================
# MPI section, uncomment the following lines
#
# 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/ifc
# compilers however append only one underscore.
# Precompiled mpi version will also not work !!!
#
# We found that mpich.1.2.1 and lam-6.5.X to lam-7.0.4 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 /opt/libs/lam-7.0.4 --with-cflags=-O -with-fc=ifc \
# --with-f77flags=-O --without-romio
#
# please note that you might be able to use a lam or mpich version
# compiled with f77/g77, but then you need to add the following
# options: -Msecond_underscore (compilation) and -g77libs (linking)
#
# !!! Please do not send me any queries on how to install MPI, I will
# certainly not answer them !!!!
#=======================================================================
#-----------------------------------------------------------------------
# fortran linker for mpi: if you use LAM and compiled it with the options
# suggested above, you can use the following line
#-----------------------------------------------------------------------
FC=mpif90
FCL=$(FC)
#-----------------------------------------------------------------------
# additional options for CPP in parallel version (see also above):
# NGZhalf charge density reduced in Z direction
# wNGZhalf gamma point only reduced in Z direction
# scaLAPACK use scaLAPACK (usually slower on 100 Mbit Net)
# 1000 or 2000 are the optimal CACHE_SIZE for the parallel version
# and IFC on Athlon XP (gK)
#-----------------------------------------------------------------------
CPP = $(CPP_) -DMPI -DHOST=\"LinuxIFC_ath\" -DIFC \
-Dkind8 -DNGZhalf -DCACHE_SIZE=2000 -DPGF90 -Davoidalloc \
# -DRPROMU_DGEMV
#-----------------------------------------------------------------------
# location of SCALAPACK
# if you do not use SCALAPACK simply uncomment the line SCA
#-----------------------------------------------------------------------
BLACS=$(HOME)/archives/SCALAPACK/BLACS/
SCA_=$(HOME)/archives/SCALAPACK/SCALAPACK
SCA= $(SCA_)/libscalapack.a \
$(BLACS)/LIB/blacsF77init_MPI-LINUX-0.a $(BLACS)/LIB/blacs_MPI-LINUX-0.a $(BLACS)/LI
B/blacsF77init_MPI-LINUX-0.a
SCA=
#-----------------------------------------------------------------------
# libraries for mpi
#-----------------------------------------------------------------------
LIB = -L../vasp.4.lib -ldmy \
../vasp.4.lib/linpack_double.o $(LAPACK) \
$(SCA) $(BLAS)
# FFT: fftmpi.o with fft3dlib of Juergen Furthmueller
FFT3D = fftmpi.o fftmpi_map.o fft3dlib.o
# fftw.3.0.1 is slighly faster and should be used if available
# No way to use FFTW (copy /prg/fftw/include/fftw3.f in the dir or use -I)
# FFT3D = fftmpiw.o fftmpi_map.o fft3dlib.o /prg/fftw/lib/libfftw3.a
#[nodo08:05111] [ 0] /lib64/libpthread.so.0 [0x2b47c7924e80]
#[nodo08:05111] [ 1] /prg/Source/VASP/bin/vasp-orgw(fftw_destroy_plan+0xa) [
;0x68df72]
#[nodo08:05111] [ 2] /prg/Source/VASP/bin/vasp-orgw(dfftw_destroy_plan_+0x9)
91;0x68c785]
#[nodo08:05111] [ 3] /prg/Source/VASP/bin/vasp-orgw(fftbas_plan_+0x1ed) [0x
674193]
#[nodo08:05111] [ 4] /prg/Source/VASP/bin/vasp-orgw(fftmakeplan_+0x1e) [0x6
73f8c]
#[nodo08:05111] [ 5] /prg/Source/VASP/bin/vasp-orgw(MAIN__+0x17885) [0x431f
55]
#[nodo08:05111] [ 6] /prg/Source/VASP/bin/vasp-orgw(main+0x2a) [0x41a6c2
93;
#[nodo08:05111] [ 7] /lib64/libc.so.6(__libc_start_main+0xf4) [0x2b47c8d558
b4]
#[nodo08:05111] [ 8] /prg/Source/VASP/bin/vasp-orgw [0x41a5e9]
# No way to use FFTW with MKL wrappers (using both fftw.f from MKL and original one):
# FFT3D = fftmpiw.o fftmpi_map.o fft3dlib.o