/[MITgcm]/MITgcm/tools/build_options/linux_ia32_ifort10.1
ViewVC logotype

Contents of /MITgcm/tools/build_options/linux_ia32_ifort10.1

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Mon Jul 22 18:40:45 2013 UTC (10 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64k, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.5: +3 -3 lines
- remove MPI_HEADER_FILES_INC setting (no longer used)
- for now, comment out MPI_HEADER_FILES list (let genmake2 find which
   MPI header is needed)

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_ifort10.1,v 1.5 2011/09/07 23:20:23 jmc Exp $
4 # $Name: $
5 #
6 # Constantinos Evangelinos
7 #
8 # 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
15 # and generally, needs to increase the stack-size:
16 # - sh,bash:
17 # > export OMP_NUM_THREADS=2
18 # > export KMP_STACKSIZE=400m
19 # - csh,tcsh:
20 # > setenv OMP_NUM_THREADS 2
21 # > setenv KMP_STACKSIZE 400m
22 #-------
23
24 if test "x$MPI" = xtrue ; then
25 CC=${CC:=mpicc}
26 FC=${FC:=mpif77}
27 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'
37 CPP='cpp -traditional -P'
38 F90FIXEDFORMAT='-fixed -Tf'
39 EXTENDED_SRC_FLAG='-132'
40 OMPFLAG='-openmp'
41
42 NOOPTFLAGS='-O0 -g'
43 NOOPTFILES=''
44
45 FFLAGS="$FFLAGS -convert big_endian -assume byterecl"
46 #- might want to use '-r8' for fizhi pkg:
47 #FFLAGS="$FFLAGS -r8"
48
49 if test "x$GENERIC" != x ; then
50 PROCF=-axSOTPNWK
51 else
52 has_sse4a=f
53 has_sse4=f
54 has_ssse3=f
55 has_sse3=f
56 has_sse2=f
57 has_sse=f
58 is_opteron=f
59 is_pentiumm=f
60 grep flags /proc/cpuinfo | grep " sse4a " > /dev/null 2>&1 && has_sse4a=t
61 grep flags /proc/cpuinfo | grep " sse4 " > /dev/null 2>&1 && has_sse4=t
62 grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_ssse3=t
63 grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_sse3=t
64 grep flags /proc/cpuinfo | grep " sse2 " > /dev/null 2>&1 && has_sse2=t
65 grep flags /proc/cpuinfo | grep " sse " > /dev/null 2>&1 && has_sse=t
66 grep "model name" /proc/cpuinfo | grep " Opteron" > /dev/null 2>&1 && is_opteron=t
67 grep "model name" /proc/cpuinfo | grep " Phenom" > /dev/null 2>&1 && is_opteron=t
68 grep "model name" /proc/cpuinfo | grep " Athlon 64" > /dev/null 2>&1 && is_opteron=t
69 grep "model name" /proc/cpuinfo | grep " Pentium(R) M" > /dev/null 2>&1 && is_pentiumm=t
70 if test "x$has_sse4a" = xt ; then
71 PROCF=-xO
72 elif test "x$has_sse4" = xt ; then
73 PROCF=-xS
74 elif test "x$has_ssse3" = xt ; then
75 PROCF=-xT
76 elif test "x$has_sse3" = xt ; then
77 if test "x$is_opteron" = xt ; then
78 PROCF=-xO
79 else
80 PROCF=-xP
81 fi
82 elif test "x$has_sse2" = xt ; then
83 if test "x$is_pentiumm" = xt ; then
84 PROCF=-xB
85 elif test "x$is_opteron" = xt ; then
86 PROCF=-xW
87 else
88 PROCF=-xN
89 fi
90 elif test "x$has_sse" = xt ; then
91 PROCF=-xK
92 fi
93 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
102 # roughly equivalent to -ieee
103 if test "x$IEEE" = x ; then #- with optimisation:
104 FOPTIM="-O3 -align -ip -opt-streaming-stores auto $PROCF"
105 else
106 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
107 FOPTIM="-O0 -mp -noalign $PROCF"
108 else #- development/check options:
109 FOPTIM="$PROCF"
110 fi
111 fi
112
113 F90FLAGS=$FFLAGS
114 F90OPTIM=$FOPTIM
115 CFLAGS="-O0 $PROCF"
116
117 INCLUDEDIRS=''
118 INCLUDES=''
119 LIBS=''
120
121 if [ "x$NETCDF_ROOT" != x ] ; then
122 INCLUDEDIRS="${NETCDF_ROOT}/include"
123 INCLUDES="-I${NETCDF_ROOT}/include"
124 LIBS="-L${NETCDF_ROOT}/lib"
125 elif [ "x$NETCDF_HOME" != x ]; then
126 INCLUDEDIRS="${NETCDF_HOME}/include"
127 INCLUDES="-I${NETCDF_HOME}/include"
128 LIBS="-L${NETCDF_HOME}/lib"
129 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
130 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
131 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
132 INCLUDEDIRS="${NETCDF_INC}"
133 INCLUDES="-I${NETCDF_INC}"
134 LIBS="-L${NETCDF_LIB}"
135 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
136 INCLUDEDIRS="${NETCDF_INCDIR}"
137 INCLUDES="-I${NETCDF_INCDIR}"
138 LIBS="-L${NETCDF_LIBDIR}"
139 elif test -d /usr/include/netcdf-3 ; then
140 INCLUDEDIRS='/usr/include/netcdf-3'
141 INCLUDES='-I/usr/include/netcdf-3'
142 LIBS='-L/usr/lib/netcdf-3'
143 elif test -d /usr/local/pkg/netcdf ; then
144 INCLUDEDIRS='/usr/local/pkg/netcdf/include'
145 INCLUDES='-I/usr/local/pkg/netcdf/include'
146 LIBS='-L/usr/local/pkg/netcdf/lib'
147 elif test -d /usr/include/netcdf ; then
148 INCLUDEDIRS='/usr/include/netcdf'
149 INCLUDES='-I/usr/include/netcdf'
150 elif test -d /usr/local/netcdf ; then
151 INCLUDEDIRS='/usr/include/netcdf/include'
152 INCLUDES='-I/usr/local/netcdf/include'
153 LIBS='-L/usr/local/netcdf/lib'
154 elif test -f /usr/local/include/netcdf.inc ; then
155 INCLUDEDIRS='/usr/local/include'
156 INCLUDES='-I/usr/local/include'
157 LIBS='-L/usr/local/lib'
158 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 #- used for parallel (MPI) DIVA
164 MPIINCLUDEDIR="$MPI_INC_DIR"
165 #MPI_HEADER_FILES='mpif.h mpiof.h'
166 fi

  ViewVC Help
Powered by ViewVC 1.1.22