1 |
ce107 |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
jmc |
1.4 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_ifort11,v 1.3 2010/03/21 18:00:26 jmc Exp $ |
4 |
jmc |
1.2 |
# $Name: $ |
5 |
|
|
# |
6 |
ce107 |
1.1 |
# Constantinos Evangelinos |
7 |
|
|
# |
8 |
|
|
# Build options for the intel 11 fortran compiler |
9 |
|
|
|
10 |
jmc |
1.2 |
#------- |
11 |
|
|
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
12 |
|
|
# and generally, needs to increase the stack-size: |
13 |
|
|
# - sh,bash: |
14 |
|
|
# > export OMP_NUM_THREADS=2 |
15 |
|
|
# > export KMP_STACKSIZE=400m |
16 |
|
|
# - csh,tcsh: |
17 |
|
|
# > setenv OMP_NUM_THREADS 2 |
18 |
|
|
# > setenv KMP_STACKSIZE 400m |
19 |
|
|
#------- |
20 |
|
|
|
21 |
ce107 |
1.1 |
FC=ifort |
22 |
|
|
F90C=ifort |
23 |
|
|
CC=icc |
24 |
|
|
LINK=ifort |
25 |
|
|
|
26 |
|
|
DEFINES='-DWORDLENGTH=4' |
27 |
|
|
CPP='cpp -traditional -P' |
28 |
jmc |
1.2 |
F90FIXEDFORMAT='-fixed -Tf' |
29 |
ce107 |
1.1 |
EXTENDED_SRC_FLAG='-132' |
30 |
jmc |
1.4 |
GET_FC_VERSION="-v" |
31 |
jmc |
1.2 |
OMPFLAG='-openmp' |
32 |
ce107 |
1.1 |
|
33 |
|
|
NOOPTFLAGS='-O0 -g -m64 -fPIC' |
34 |
|
|
NOOPTFILES='' |
35 |
|
|
|
36 |
|
|
INCLUDEDIRS='' |
37 |
|
|
INCLUDES='' |
38 |
|
|
LIBS='' |
39 |
|
|
|
40 |
|
|
if test "x$DEVEL" != x ; then |
41 |
jmc |
1.3 |
FFLAGS="$FFLAGS -m64 -fPIC -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" |
42 |
ce107 |
1.1 |
else |
43 |
jmc |
1.3 |
FFLAGS="$FFLAGS -m64 -fPIC -W0 -WB -convert big_endian -assume byterecl" |
44 |
ce107 |
1.1 |
fi |
45 |
jmc |
1.2 |
#- might want to use '-r8' for fizhi pkg: |
46 |
|
|
#FFLAGS="$FFLAGS -r8" |
47 |
ce107 |
1.1 |
|
48 |
|
|
if test "x$GENERIC" != x ; then |
49 |
|
|
PROCF=-axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2 |
50 |
|
|
else |
51 |
|
|
PROCF=-xHost |
52 |
|
|
fi |
53 |
|
|
# Note that the -mp switch is for ieee "maintain precision" and is |
54 |
|
|
# roughly equivalent to -ieee |
55 |
|
|
# Note the addition of -g to circumvent bug with Intel 11. |
56 |
|
|
if test "x$IEEE" = x ; then |
57 |
|
|
FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF" |
58 |
|
|
else |
59 |
|
|
if test "x$DEVEL" != x ; then |
60 |
|
|
FOPTIM="$PROCF" |
61 |
|
|
else |
62 |
|
|
FOPTIM="-O0 -fp-model source -noalign $PROCF" |
63 |
|
|
fi |
64 |
|
|
fi |
65 |
|
|
F90FLAGS=$FFLAGS |
66 |
|
|
F90OPTIM=$FOPTIM |
67 |
|
|
CFLAGS="-O2 -ip -m64 -fPIC $PROCF" |
68 |
|
|
|
69 |
|
|
if [ "x$NETCDF_ROOT" != x ] ; then |
70 |
|
|
INCLUDEDIRS="${NETCDF_ROOT}/include" |
71 |
|
|
INCLUDES="-I${NETCDF_ROOT}/include" |
72 |
|
|
LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_ROOT}/lib" |
73 |
|
|
elif [ "x$NETCDF_HOME" != x ]; then |
74 |
|
|
INCLUDEDIRS="${NETCDF_HOME}/include" |
75 |
|
|
INCLUDES="-I${NETCDF_HOME}/include" |
76 |
|
|
LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_HOME}/lib" |
77 |
|
|
elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then |
78 |
|
|
NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'` |
79 |
|
|
NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'` |
80 |
|
|
INCLUDEDIRS="${NETCDF_INC}" |
81 |
|
|
INCLUDES="-I${NETCDF_INC}" |
82 |
|
|
LIBS="-L${NETCDF_LIB}" |
83 |
|
|
elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then |
84 |
|
|
INCLUDEDIRS="${NETCDF_INCDIR}" |
85 |
|
|
INCLUDES="-I${NETCDF_INCDIR}" |
86 |
|
|
LIBS="-L${NETCDF_LIBDIR}" |
87 |
|
|
elif test -d /usr/include/netcdf-3 ; then |
88 |
|
|
INCLUDEDIRS='/usr/include/netcdf-3' |
89 |
|
|
INCLUDES='-I/usr/include/netcdf-3' |
90 |
|
|
LIBS='-L/usr/lib64/netcdf-3 -L/usr/lib/netcdf-3' |
91 |
|
|
elif test -d /usr/local/pkg/netcdf ; then |
92 |
|
|
INCLUDEDIRS='/usr/local/pkg/netcdf/include' |
93 |
|
|
INCLUDES='-I/usr/local/pkg/netcdf/include' |
94 |
|
|
LIBS='-L/usr/local/pkg-x86_64/netcdf/lib64 -L/usr/local/pkg-x86_64/netcdf/lib -L/usr/local/pkg/netcdf/lib64 -L/usr/local/pkg/netcdf/lib' |
95 |
|
|
elif test -d /usr/include/netcdf ; then |
96 |
|
|
INCLUDEDIRS='/usr/include/netcdf' |
97 |
|
|
INCLUDES='-I/usr/include/netcdf' |
98 |
|
|
elif test -d /usr/local/netcdf ; then |
99 |
|
|
INCLUDEDIRS='/usr/include/netcdf/include' |
100 |
|
|
INCLUDES='-I/usr/local/netcdf/include' |
101 |
|
|
LIBS='-L/usr/local/netcdf/lib64 -L/usr/local/netcdf/lib' |
102 |
|
|
elif test -f /usr/local/include/netcdf.inc ; then |
103 |
|
|
INCLUDEDIRS='/usr/local/include' |
104 |
|
|
INCLUDES='-I/usr/local/include' |
105 |
|
|
LIBS='-L/usr/local/lib64 -L/usr/local/lib' |
106 |
|
|
fi |
107 |
|
|
|