5 |
# |
# |
6 |
# Constantinos Evangelinos |
# Constantinos Evangelinos |
7 |
# |
# |
8 |
# Build options for the intel 11 fortran compiler |
# Build options for the intel 11 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 |
18 |
# > export KMP_STACKSIZE=400m |
# > export KMP_STACKSIZE=400m |
19 |
# - csh,tcsh: |
# - csh,tcsh: |
20 |
# > setenv OMP_NUM_THREADS 2 |
# > setenv OMP_NUM_THREADS 2 |
21 |
# > setenv KMP_STACK |
# > 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 |
|
|
49 |
if test "x$GENERIC" != x ; then |
if test "x$GENERIC" != x ; then |
50 |
PROCF=-mia32 -axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2 |
PROCF='-mia32 -axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2' |
51 |
else |
else |
52 |
PROCF=-xHost |
PROCF=-xHost |
53 |
fi |
fi |
54 |
|
|
55 |
|
if test "x$DEVEL" = x ; then |
56 |
|
FFLAGS="$FFLAGS -W0 -WB" |
57 |
|
else |
58 |
|
FFLAGS="$FFLAGS -O0 -g -debug all -debug-parameters all -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model strict -warn all" |
59 |
|
fi |
60 |
|
|
61 |
# Note that the -mp switch is for ieee "maintain precision" and is |
# Note that the -mp switch is for ieee "maintain precision" and is |
62 |
# roughly equivalent to -ieee |
# roughly equivalent to -ieee |
63 |
if test "x$IEEE" = x ; then |
if test "x$IEEE" = x ; then #- with optimisation: |
64 |
FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF" |
FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF" |
65 |
else |
else |
66 |
if test "x$DEVEL" != x ; then |
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
67 |
FOPTIM="$PROCF" |
FOPTIM="-O0 -fp-model source -noalign $PROCF" |
68 |
else |
else #- development/check options: |
69 |
FOPTIM="-O0 -fp-model source -noalign $PROCF" |
FOPTIM="$PROCF" |
70 |
fi |
fi |
71 |
fi |
fi |
72 |
|
|
73 |
F90FLAGS=$FFLAGS |
F90FLAGS=$FFLAGS |
74 |
F90OPTIM=$FOPTIM |
F90OPTIM=$FOPTIM |
75 |
CFLAGS="-O2 -ip $PROCF" |
CFLAGS="-O0 $PROCF" |
76 |
|
|
77 |
|
INCLUDEDIRS='' |
78 |
|
INCLUDES='' |
79 |
|
LIBS='' |
80 |
|
|
81 |
if [ "x$NETCDF_ROOT" != x ] ; then |
if [ "x$NETCDF_ROOT" != x ] ; then |
82 |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
117 |
LIBS='-L/usr/local/lib' |
LIBS='-L/usr/local/lib' |
118 |
fi |
fi |
119 |
|
|
120 |
|
if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then |
121 |
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
122 |
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
123 |
|
MPIINCLUDEDIR="$MPI_INC_DIR" |
124 |
|
MPI_HEADER_FILES='mpif.h mpiof.h' |
125 |
|
MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h' |
126 |
|
fi |