5 |
# |
# |
6 |
# Constantinos Evangelinos |
# Constantinos Evangelinos |
7 |
# |
# |
8 |
# Build options for the intel 10.1 fortran compiler |
# Build options for the intel 10.1 fortran compiler (with/without MPI) |
9 |
|
# |
10 |
|
# with MPI : need to set environment variable MPI_INC_DIR to the include |
11 |
|
# directory of your MPI implementation |
12 |
|
|
13 |
#------- |
#------- |
14 |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
21 |
# > setenv KMP_STACKSIZE 400m |
# > setenv KMP_STACKSIZE 400m |
22 |
#------- |
#------- |
23 |
|
|
24 |
FC=ifort |
if test "x$MPI" = xtrue ; then |
25 |
F90C=ifort |
CC=${CC:=mpicc} |
26 |
CC=icc |
FC=${FC:=mpif77} |
27 |
LINK=ifort |
F90C=${F90C:=mpif90} |
28 |
|
LINK="$F90C -shared-intel" |
29 |
|
else |
30 |
|
CC=icc |
31 |
|
FC=ifort |
32 |
|
F90C=ifort |
33 |
|
LINK=$FC |
34 |
|
fi |
35 |
|
|
36 |
DEFINES='-DWORDLENGTH=4' |
DEFINES='-DWORDLENGTH=4' |
37 |
CPP='cpp -traditional -P' |
CPP='cpp -traditional -P' |
42 |
NOOPTFLAGS='-O0 -g' |
NOOPTFLAGS='-O0 -g' |
43 |
NOOPTFILES='' |
NOOPTFILES='' |
44 |
|
|
45 |
INCLUDEDIRS='' |
FFLAGS="$FFLAGS -convert big_endian -assume byterecl" |
|
INCLUDES='' |
|
|
LIBS='' |
|
|
|
|
|
if test "x$DEVEL" != x ; then |
|
|
FFLAGS="$FFLAGS -convert big_endian -assume byterecl -O0 -g -debug all -debug-parameters all -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model strict -warn all" |
|
|
else |
|
|
FFLAGS="$FFLAGS -W0 -WB -convert big_endian -assume byterecl" |
|
|
fi |
|
46 |
#- might want to use '-r8' for fizhi pkg: |
#- might want to use '-r8' for fizhi pkg: |
47 |
#FFLAGS="$FFLAGS -r8" |
#FFLAGS="$FFLAGS -r8" |
48 |
|
|
91 |
PROCF=-xK |
PROCF=-xK |
92 |
fi |
fi |
93 |
fi |
fi |
94 |
|
|
95 |
|
if test "x$DEVEL" = x ; then |
96 |
|
FFLAGS="$FFLAGS -W0 -WB" |
97 |
|
else |
98 |
|
FFLAGS="$FFLAGS -O0 -g -debug all -debug-parameters all -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model strict -warn all" |
99 |
|
fi |
100 |
|
|
101 |
# Note that the -mp switch is for ieee "maintain precision" and is |
# Note that the -mp switch is for ieee "maintain precision" and is |
102 |
# roughly equivalent to -ieee |
# roughly equivalent to -ieee |
103 |
if test "x$IEEE" = x ; then |
if test "x$IEEE" = x ; then #- with optimisation: |
104 |
FOPTIM="-O3 -align -ip -opt-streaming-stores auto $PROCF" |
FOPTIM="-O3 -align -ip -opt-streaming-stores auto $PROCF" |
105 |
else |
else |
106 |
if test "x$DEVEL" != x ; then |
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
107 |
FOPTIM="$PROCF" |
FOPTIM="-O0 -mp -noalign $PROCF" |
108 |
else |
else #- development/check options: |
109 |
FOPTIM="-O0 -mp -noalign $PROCF" |
FOPTIM="$PROCF" |
110 |
fi |
fi |
111 |
fi |
fi |
112 |
|
|
113 |
F90FLAGS=$FFLAGS |
F90FLAGS=$FFLAGS |
114 |
F90OPTIM=$FOPTIM |
F90OPTIM=$FOPTIM |
115 |
CFLAGS="-O2 -ip $PROCF" |
CFLAGS="-O0 $PROCF" |
116 |
|
|
117 |
|
INCLUDEDIRS='' |
118 |
|
INCLUDES='' |
119 |
|
LIBS='' |
120 |
|
|
121 |
if [ "x$NETCDF_ROOT" != x ] ; then |
if [ "x$NETCDF_ROOT" != x ] ; then |
122 |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
157 |
LIBS='-L/usr/local/lib' |
LIBS='-L/usr/local/lib' |
158 |
fi |
fi |
159 |
|
|
160 |
|
if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then |
161 |
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
162 |
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
163 |
|
MPIINCLUDEDIR="$MPI_INC_DIR" |
164 |
|
MPI_HEADER_FILES='mpif.h mpiof.h' |
165 |
|
MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h' |
166 |
|
fi |