# Information about how to set the various options here.
# Ideally you can use a file already created for your platform.
# Otherwise, you can work from the one most similar that is here.

# Select the Fortran compiler you are using.
# if you have a different one than these, modifications in Common/compiler.h
# and Common/common-rules.mk will be necessary.
COMPFLAG  = -D{INTEL, PGI, GNU, PATH, XLF, G95, ABSOFT, NAG, OPEN64, SUN, CRAY}

# Use -DMPI to compile Fortran in parallel with MPI. Otherwise is serial.
PARAFLAG  = -DMPI
# -DUSESCALAPACK enables usage of ScaLAPACK (required in parallel for BSE).
# -DUSEESSL uses ESSL instead of LAPACK in some parts of the code.
# -DUNPACKED uses unpacked rather packed representation of the Hamiltonian
# in EPM. Packed LAPACK operations give bad results eventually in Si-EPM kernel
# test for ACML and Cray LibSci sometimes.
MATHFLAG  = -DUSESCALAPACK -DUSEESSL -DUNPACKED
# For Fortran and C++. -DDEBUG enables extra checking. -DVERBOSE writes extra information.
DEBUGFLAG = -DDEBUG -DVERBOSE
# Same, but for C. Currently, no use of VERBOSE in the code.
C_DEBUGFLAG = -DDEBUG

# Command for the preprocessor. -ansi should generally be used.
# add -P if the Fortran compiler will not accept indication of line numbers.
# Use gcc's (often in /lib/cpp) or a C compiler (even mpicc) with "-E". Some need "-x c" as well.
FCPP    = cpp -ansi
# Fortran compiler and its flags for F90 and f90 files (free source form)
# With openmp flags you can use threaded libraries.
F90free = {mpif90, mpiifort, ftn, ifort, pgf90, gfortran, ...}
# Fortran compiler and any flag(s) required for linking
LINK    = {mpif90, mpiifort, ftn, ifort, pgf90, gfortran, ...}
# Fortran optimization flags. The levels below will generally work.
FOPTS   = {-fast, -O3}
# Fortran optimization flags for epsilon_main and sigma_main which can have
# trouble in high optimization due to their long length. If below does not
# work, try -O2.
FNOOPTS = $(FOPTS)
# Fortran compiler flag to specify location where module should be created.
# different for each compiler, refer to examples.
MOD_OPT =
# Fortran compiler flag to specify where to look for modules.
INCFLAG = -I

# Use this to compile C++ in parallel with MPI. Leave blank for serial.
# MPICH, MVAPICH, Intel MPI require also -DMPICH_IGNORE_CXX_SEEK, or an error may occur such as:
# "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
C_PARAFLAG  = -DPARA
# C++ compiling command and any needed flags
CC_COMP = {mpiCC, mpicxx, mpiicpc, CC, icpc, pgCC, g++, ...}
# C compiling command and any needed flags
C_COMP  = {mpicc, mpiicc, cc, icc, pgcc, gcc, ...}
# C/C++ link command and any needed flags
C_LINK  = {mpiCC, mpicxx, mpiicpc, CC, icpc, pgCC, g++, ...}
# C/C++ optimization flags
C_OPTS  = -fast
# Note: for Intel compilers, it is equivalent to use icc or icpc on C++ files.

# command to remove, for make clean
REMOVE  = /bin/rm -f

# Math Libraries
# path for FFTW2 library, used in lines below
FFTWPATH     = 
# link line for FFTW2 library. sometimes needs to be -ldfftw
FFTWLIB      = -L$(FFTWPATH)/lib -lfftw
# where include file fftw_f77.i from FFTW is located.
# Sometimes supercomputer installations will not have it.
# If not, find it online and copy it
# (e.g. http://www.fifi.org/doc/fftw-dev/fortran/fftw_f77.i)
FFTWINCLUDE  = $(FFTWPATH)/include

# Different styles will apply depending on the package used.
# Must provide BLAS as well as LAPACK: some packages will do this in one library file,
# others will not. See examples in this directory for how to link with MKL, ACML,
# ATLAS, Ubuntu packages, etc. For MKL, if you will use ScaLAPACK, it is most
# convenient to include BLACS here too. For further info on linking with MKL, see
# the link-line advisor at http://software.intel.com/sites/products/mkl/
LAPACKLIB    = 
# BLACS must be provided here too, if it is not provided in LAPACKLIB above. See
# examples in this directory for different packages, as with LAPACKLIB. Note that
# you may have problems if ScaLAPACK was not built with the same LAPACK used above.
SCALAPACKLIB =

# Flags for performance profiling with an external tool such as IPM on NERSC
PERFORMANCE  = 

# Command to submit testsuite job script from testsuite directory.
# qsub is for PBS. If no scheduler, put make check-parallel here.
# In serial, delete this line.
TESTSCRIPT = qsub {architecture}.scr
