/[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.10 - (hide annotations) (download)
Sun Feb 3 22:47:41 2013 UTC (11 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64i, checkpoint64h, checkpoint64j, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f
Changes since 1.9: +2 -2 lines
add "-shared-intel" to LINK also for non MPI built (needed for big executable)

1 ce107 1.1 #!/bin/bash
2     #
3 jmc 1.10 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_ifort11,v 1.9 2012/08/05 16:35:54 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     # and also 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.7 CPP='cpp -traditional -P'
46 jmc 1.2 F90FIXEDFORMAT='-fixed -Tf'
47 ce107 1.1 EXTENDED_SRC_FLAG='-132'
48 jmc 1.5 GET_FC_VERSION="--version"
49 jmc 1.2 OMPFLAG='-openmp'
50 ce107 1.1
51 jmc 1.5 NOOPTFLAGS='-O0 -g'
52 ce107 1.1 NOOPTFILES=''
53    
54 jmc 1.6 if test "x$GENERIC" != x ; then
55     PROCF=-axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2
56 ce107 1.1 else
57 jmc 1.6 PROCF=-xHost
58 ce107 1.1 fi
59 jmc 1.6
60     FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian -assume byterecl"
61 jmc 1.2 #- might want to use '-r8' for fizhi pkg:
62     #FFLAGS="$FFLAGS -r8"
63 ce107 1.1
64 jmc 1.6 if test "x$IEEE" = x ; then #- with optimisation:
65 ce107 1.1 FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF"
66     else
67 jmc 1.6 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
68     FOPTIM="-O0 -fp-model source -noalign $PROCF"
69     else #- development/check options:
70     #FFLAGS="$FFLAGS -debug all -debug-parameters all -fp-model strict"
71 jmc 1.8 FOPTIM="-O0 -noalign -g -traceback $PROCF"
72     NOOPTFLAGS=$FOPTIM
73 jmc 1.9 NOOPTFILES='adread_adwrite.F mdsio_rw_field.F mdsio_rw_slice.F'
74     NOOPTFILES="$NOOPTFILES mdsio_readvector.F mdsio_writevector.F"
75 jmc 1.8 FOPTIM="$FOPTIM -warn all -warn nounused"
76     FOPTIM="$FOPTIM -fpe0 -ftz -fp-stack-check -check all -ftrapuv"
77 jmc 1.6 fi
78 ce107 1.1 fi
79 jmc 1.6
80 ce107 1.1 F90FLAGS=$FFLAGS
81     F90OPTIM=$FOPTIM
82 jmc 1.6 CFLAGS="-O0 -ip -m64 -fPIC $PROCF"
83 ce107 1.1
84 jmc 1.7 INCLUDEDIRS=''
85     INCLUDES=''
86     LIBS=''
87    
88 ce107 1.1 if [ "x$NETCDF_ROOT" != x ] ; then
89     INCLUDEDIRS="${NETCDF_ROOT}/include"
90     INCLUDES="-I${NETCDF_ROOT}/include"
91     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_ROOT}/lib"
92     elif [ "x$NETCDF_HOME" != x ]; then
93     INCLUDEDIRS="${NETCDF_HOME}/include"
94     INCLUDES="-I${NETCDF_HOME}/include"
95     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_HOME}/lib"
96     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
97     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
98     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
99     INCLUDEDIRS="${NETCDF_INC}"
100     INCLUDES="-I${NETCDF_INC}"
101     LIBS="-L${NETCDF_LIB}"
102     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
103     INCLUDEDIRS="${NETCDF_INCDIR}"
104     INCLUDES="-I${NETCDF_INCDIR}"
105     LIBS="-L${NETCDF_LIBDIR}"
106     elif test -d /usr/include/netcdf-3 ; then
107     INCLUDEDIRS='/usr/include/netcdf-3'
108     INCLUDES='-I/usr/include/netcdf-3'
109     LIBS='-L/usr/lib64/netcdf-3 -L/usr/lib/netcdf-3'
110     elif test -d /usr/local/pkg/netcdf ; then
111     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
112     INCLUDES='-I/usr/local/pkg/netcdf/include'
113     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'
114     elif test -d /usr/include/netcdf ; then
115     INCLUDEDIRS='/usr/include/netcdf'
116     INCLUDES='-I/usr/include/netcdf'
117     elif test -d /usr/local/netcdf ; then
118     INCLUDEDIRS='/usr/include/netcdf/include'
119     INCLUDES='-I/usr/local/netcdf/include'
120     LIBS='-L/usr/local/netcdf/lib64 -L/usr/local/netcdf/lib'
121     elif test -f /usr/local/include/netcdf.inc ; then
122     INCLUDEDIRS='/usr/local/include'
123     INCLUDES='-I/usr/local/include'
124     LIBS='-L/usr/local/lib64 -L/usr/local/lib'
125     fi
126    
127 jmc 1.7 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
128     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
129     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
130     MPIINCLUDEDIR="$MPI_INC_DIR"
131     MPI_HEADER_FILES='mpif.h mpiof.h'
132     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
133     fi

  ViewVC Help
Powered by ViewVC 1.1.22