/[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.7 - (hide annotations) (download)
Mon Aug 22 03:51:11 2011 UTC (12 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63b
Changes since 1.6: +36 -16 lines
merge linux_amd64_ifort11+mpi_generic into linux_amd64_ifort11 optfile
(towards single optfile for MPI and non-MPI built).

1 ce107 1.1 #!/bin/bash
2     #
3 jmc 1.7 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_ifort11,v 1.6 2011/07/07 22:58:36 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     LINK=ifort
42     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     FFLAGS="$FFLAGS -warn all -warn nounused"
72     FOPTIM="-fpe0 -ftz -fp-stack-check -check all -ftrapuv"
73     FOPTIM="$FOPTIM -O0 -noalign -g -traceback $PROCF"
74     fi
75 ce107 1.1 fi
76 jmc 1.6
77 ce107 1.1 F90FLAGS=$FFLAGS
78     F90OPTIM=$FOPTIM
79 jmc 1.6 CFLAGS="-O0 -ip -m64 -fPIC $PROCF"
80 ce107 1.1
81 jmc 1.7 INCLUDEDIRS=''
82     INCLUDES=''
83     LIBS=''
84    
85 ce107 1.1 if [ "x$NETCDF_ROOT" != x ] ; then
86     INCLUDEDIRS="${NETCDF_ROOT}/include"
87     INCLUDES="-I${NETCDF_ROOT}/include"
88     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_ROOT}/lib"
89     elif [ "x$NETCDF_HOME" != x ]; then
90     INCLUDEDIRS="${NETCDF_HOME}/include"
91     INCLUDES="-I${NETCDF_HOME}/include"
92     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_HOME}/lib"
93     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
94     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
95     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
96     INCLUDEDIRS="${NETCDF_INC}"
97     INCLUDES="-I${NETCDF_INC}"
98     LIBS="-L${NETCDF_LIB}"
99     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
100     INCLUDEDIRS="${NETCDF_INCDIR}"
101     INCLUDES="-I${NETCDF_INCDIR}"
102     LIBS="-L${NETCDF_LIBDIR}"
103     elif test -d /usr/include/netcdf-3 ; then
104     INCLUDEDIRS='/usr/include/netcdf-3'
105     INCLUDES='-I/usr/include/netcdf-3'
106     LIBS='-L/usr/lib64/netcdf-3 -L/usr/lib/netcdf-3'
107     elif test -d /usr/local/pkg/netcdf ; then
108     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
109     INCLUDES='-I/usr/local/pkg/netcdf/include'
110     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'
111     elif test -d /usr/include/netcdf ; then
112     INCLUDEDIRS='/usr/include/netcdf'
113     INCLUDES='-I/usr/include/netcdf'
114     elif test -d /usr/local/netcdf ; then
115     INCLUDEDIRS='/usr/include/netcdf/include'
116     INCLUDES='-I/usr/local/netcdf/include'
117     LIBS='-L/usr/local/netcdf/lib64 -L/usr/local/netcdf/lib'
118     elif test -f /usr/local/include/netcdf.inc ; then
119     INCLUDEDIRS='/usr/local/include'
120     INCLUDES='-I/usr/local/include'
121     LIBS='-L/usr/local/lib64 -L/usr/local/lib'
122     fi
123    
124 jmc 1.7 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
125     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
126     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
127     MPIINCLUDEDIR="$MPI_INC_DIR"
128     MPI_HEADER_FILES='mpif.h mpiof.h'
129     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
130     fi

  ViewVC Help
Powered by ViewVC 1.1.22