/[MITgcm]/MITgcm/tools/build_options/linux_amd64_ifort11
ViewVC logotype

Annotation of /MITgcm/tools/build_options/linux_amd64_ifort11

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


Revision 1.13 - (hide annotations) (download)
Mon Sep 23 23:32:59 2013 UTC (10 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64p, checkpoint64o
Changes since 1.12: +5 -5 lines
to compile big setup, try to use "-mcmodel=medium" instead of "-fPIC":
 check that both works on baudelaire & acesgrid; but only the 1rst one
 works with FC.19

1 ce107 1.1 #!/bin/bash
2     #
3 jmc 1.13 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_ifort11,v 1.12 2013/09/20 00:15:03 jmc Exp $
4 jmc 1.2 # $Name: $
5 jmc 1.7
6     # Build options for version 11 and newer of intel compiler on Linux AMD64 platform
7     # Author: Constantinos Evangelinos
8    
9     # Tested on baudelaire (FC 13) with intel compiler v.11.1.073 (20100806)
10 jmc 1.2 #
11 jmc 1.6 # OpenMP : tested on danton (FC 14) using intel compiler v.11.1.046 (20090630)
12 jmc 1.12 # and also (FC 14,17 & 19) v.12.0.4 (20110427)
13 jmc 1.7 #
14     # MPI : Tested on danton (FC 14), with and without OpenMP, using
15     # intel compiler v.11.1.046 (20090630) and also v.12.0.4 (20110427)
16     # ==> DON'T FORGET to set environment variable MPI_INC_DIR to the include
17     # directory of your MPI implementation
18 ce107 1.1
19 jmc 1.2 #-------
20     # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
21     # and generally, needs to increase the stack-size:
22     # - sh,bash:
23     # > export OMP_NUM_THREADS=2
24     # > export KMP_STACKSIZE=400m
25     # - csh,tcsh:
26     # > setenv OMP_NUM_THREADS 2
27     # > setenv KMP_STACKSIZE 400m
28 jmc 1.7 # NOTE, MPI+OpenMP: might need to set KMP_STACKSIZE in ~/.tcshrc
29     # (but curiously, works without OMP_NUM_THREADS in ~/.tcshrc).
30 jmc 1.2 #-------
31    
32 jmc 1.7 if test "x$MPI" = xtrue ; then
33     CC=${CC:=mpicc}
34     FC=${FC:=mpif77}
35     F90C=${F90C:=mpif90}
36     LINK="$F90C -shared-intel -no-ipo"
37     else
38     CC=icc
39     FC=ifort
40     F90C=ifort
41 jmc 1.10 LINK="$F90C -shared-intel"
42 jmc 1.7 fi
43 ce107 1.1
44     DEFINES='-DWORDLENGTH=4'
45 jmc 1.2 F90FIXEDFORMAT='-fixed -Tf'
46 ce107 1.1 EXTENDED_SRC_FLAG='-132'
47 jmc 1.5 GET_FC_VERSION="--version"
48 jmc 1.2 OMPFLAG='-openmp'
49 ce107 1.1
50 jmc 1.5 NOOPTFLAGS='-O0 -g'
51 ce107 1.1 NOOPTFILES=''
52    
53 jmc 1.6 if test "x$GENERIC" != x ; then
54     PROCF=-axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2
55 ce107 1.1 else
56 jmc 1.6 PROCF=-xHost
57 ce107 1.1 fi
58 jmc 1.6
59 jmc 1.12 CFLAGS="-O0 -ip -m64 $PROCF"
60     FFLAGS="$FFLAGS -m64 -convert big_endian -assume byterecl"
61     #- for big setups, compile & link with "-fPIC" or set memory-model to "medium":
62 jmc 1.13 #CFLAGS="$CFLAGS -fPIC"
63     #FFLAGS="$FFLAGS -fPIC"
64 jmc 1.12 #- with FC 19, need to use this without -fPIC (which cancels -mcmodel option):
65 jmc 1.13 CFLAGS="$CFLAGS -mcmodel=medium"
66     FFLAGS="$FFLAGS -mcmodel=medium"
67 jmc 1.2 #- might want to use '-r8' for fizhi pkg:
68     #FFLAGS="$FFLAGS -r8"
69 ce107 1.1
70 jmc 1.6 if test "x$IEEE" = x ; then #- with optimisation:
71 ce107 1.1 FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF"
72     else
73 jmc 1.6 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
74     FOPTIM="-O0 -fp-model source -noalign $PROCF"
75     else #- development/check options:
76     #FFLAGS="$FFLAGS -debug all -debug-parameters all -fp-model strict"
77 jmc 1.8 FOPTIM="-O0 -noalign -g -traceback $PROCF"
78     NOOPTFLAGS=$FOPTIM
79 jmc 1.9 NOOPTFILES='adread_adwrite.F mdsio_rw_field.F mdsio_rw_slice.F'
80     NOOPTFILES="$NOOPTFILES mdsio_readvector.F mdsio_writevector.F"
81 jmc 1.8 FOPTIM="$FOPTIM -warn all -warn nounused"
82     FOPTIM="$FOPTIM -fpe0 -ftz -fp-stack-check -check all -ftrapuv"
83 jmc 1.6 fi
84 ce107 1.1 fi
85 jmc 1.6
86 ce107 1.1 F90FLAGS=$FFLAGS
87     F90OPTIM=$FOPTIM
88    
89 jmc 1.7 INCLUDEDIRS=''
90     INCLUDES=''
91     LIBS=''
92    
93 ce107 1.1 if [ "x$NETCDF_ROOT" != x ] ; then
94     INCLUDEDIRS="${NETCDF_ROOT}/include"
95     INCLUDES="-I${NETCDF_ROOT}/include"
96     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_ROOT}/lib"
97     elif [ "x$NETCDF_HOME" != x ]; then
98     INCLUDEDIRS="${NETCDF_HOME}/include"
99     INCLUDES="-I${NETCDF_HOME}/include"
100     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_HOME}/lib"
101     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
102     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
103     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
104     INCLUDEDIRS="${NETCDF_INC}"
105     INCLUDES="-I${NETCDF_INC}"
106     LIBS="-L${NETCDF_LIB}"
107     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
108     INCLUDEDIRS="${NETCDF_INCDIR}"
109     INCLUDES="-I${NETCDF_INCDIR}"
110     LIBS="-L${NETCDF_LIBDIR}"
111     elif test -d /usr/include/netcdf-3 ; then
112     INCLUDEDIRS='/usr/include/netcdf-3'
113     INCLUDES='-I/usr/include/netcdf-3'
114     LIBS='-L/usr/lib64/netcdf-3 -L/usr/lib/netcdf-3'
115     elif test -d /usr/local/pkg/netcdf ; then
116     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
117     INCLUDES='-I/usr/local/pkg/netcdf/include'
118     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'
119     elif test -d /usr/include/netcdf ; then
120     INCLUDEDIRS='/usr/include/netcdf'
121     INCLUDES='-I/usr/include/netcdf'
122     elif test -d /usr/local/netcdf ; then
123     INCLUDEDIRS='/usr/include/netcdf/include'
124     INCLUDES='-I/usr/local/netcdf/include'
125     LIBS='-L/usr/local/netcdf/lib64 -L/usr/local/netcdf/lib'
126     elif test -f /usr/local/include/netcdf.inc ; then
127     INCLUDEDIRS='/usr/local/include'
128     INCLUDES='-I/usr/local/include'
129     LIBS='-L/usr/local/lib64 -L/usr/local/lib'
130     fi
131    
132 jmc 1.7 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
133     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
134     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
135 jmc 1.11 #- used for parallel (MPI) DIVA
136 jmc 1.7 MPIINCLUDEDIR="$MPI_INC_DIR"
137 jmc 1.11 #MPI_HEADER_FILES='mpif.h mpiof.h'
138 jmc 1.7 fi

  ViewVC Help
Powered by ViewVC 1.1.22