#
# flags that should be defined for this platform. example below is for Intel 64 bit under linux
# this file is necessary for our s.f77, s.f90, s.compile utilities to work properly
#
define="-DLittle_Endian -DWITH_intel -DAMD64 -DLINUX_X86_64"

# name of the mpi library -l${MPI_LIB} will be added for loading
MPI_LIB=${MPI_LIB}
# mpi compiler calls for FORTRAN and C (depends on the local mpi implementation, this is for mpich/openmpi)
MPI_FC="mpif90 "
MPI_F90C="mpif90"
MPI_CC=mpicc

# name of the FORTRAN compiler to use for .f/.F files
FC=${F77C:-ifort}
# name of the FORTRAN compiler to use for .f90/.F90 files
F90C=${F90C:-ifort}

# name of the C compiler
#CC="${CC:-icc}"
CC=cc
# name of the C++ compiler
#CPP=${CPP:-icpc}
CPP=g++

# flags if building shared objects is desired or not
FC_STATIC="${FC_STATIC:--static-intel}"
FC_SHARED="-shared"
CC_SHARED="-shared"

# in some cases the compiler does not use -D -I -L or -l
Dprefix=""
Iprefix="-I"
Lprefix="-L"
lprefix="-l"

# basic options to the FORTRAN compiler. position independent code is desirable, BIG ENDIAN I/O is necessary
#                                        include path should include current directory
FC_options=${FC_options:-"-assume byterecl -convert big_endian -fp-model source -msse3 -fpe0 -fpic -reentrancy threaded -traceback -threads ${Iprefix}. "}
FC_LD_options="-Wl,--allow-shlib-undefined -fpic"   # added when linking/loading

# flags to add to the FORTRAN compiler to get OpenMP support
#OPENMP="-openmp"
OPENMP="-lpthread -fopenmp"
# flags to add to the C compiler to get OpenMP support
#OPENMPCC="-D_REENTRANT -D_THREAD_SAFE -openmp"
OPENMPCC="-D_REENTRANT -D_THREAD_SAFE  -lpthread"

# basic options to the C compiler, example below is for gcc , position independent code is desirable
#                                        include path should include current directory
#CC_options="-Wl,--allow-shlib-undefined -Wtrigraphs -fpic -I. -traceback -msse3 -fp-model precise"
#CC_options_NOLD="-fpic -I. -traceback -msse3  -fp-model precise "
CC_options="-D_REENTRANT -Wtrigraphs -fpic -march=core2 -mno-sse3 -mno-ssse3 -I. "
CC_LD_options="-Wl,--allow-shlib-undefined"
# flags for the FORTRAN compiler to get different optimization levels
# level 2 is agggressive but still safe, level 0 is no optimization at all, level 4 is no holds barred
F_Opt[0]=-O0
F_Opt[1]=-O1
F_Opt[2]=-O2
F_Opt[3]="-O2 -simd"
F_Opt[4]="-O3 -simd"

# flags for the FORTRAN compiler to get the DEBUG mode
O_DEBUG="-g -ftrapuv -traceback"

# flags for the C compiler to get different optimization levels
# level 2 is agggressive but still safe, level 0 is no optimization at all, level 4 is no holds barred
C_Opt[0]=-O0
C_Opt[1]=-O1
C_Opt[2]=-O2
C_Opt[3]=-O3
C_Opt[4]=-O4

# flags for the FORTRAN compiler to get the PROFILE mode
prof_option="-p"

# the ar archiver, normally ar
AR=ar

# libraries containing the massv (IBM vector library) entry points, standard and safe versions
# -l$VECTOR_LIBS or -l$VECTOR_LIBS_safe added to compiler call
#VECTOR_LIBS=massvp4_safe
#VECTOR_LIBS_safe=massvp4_safe
echo "Compiler Rules applied for Linux intel composer 13 (14.0.3)"
