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

Contents of /MITgcm/tools/build_options/linux_amd64_gfortran

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


Revision 1.19 - (show annotations) (download)
Mon Jul 2 16:39:59 2012 UTC (11 years, 9 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint64i, checkpoint64h, checkpoint64j, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint64
Changes since 1.18: +8 -1 lines
Add instructions for use on Southampton's IRIDIS
http://www.southampton.ac.uk/isolutions/computing/hpc/iridis/

1 #!/bin/bash
2
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_gfortran,v 1.18 2012/06/22 17:04:39 jmc Exp $
4 # $Name: $
5
6 # Build options for gfortran compiler (GNU) on Linux AMD64 platform
7 #
8 # Tested with gcc-gfortran v4.1.x as shipped with Fedora Core 6,7,8
9 # with gcc-gfortran v4.3.x as shipped with Fedora Core 9,10
10 #
11 # OpenMP : Tested on dickens with gcc-gfortran v4.3.2 as shipped with FC 10
12 # on baudelaire with gcc-gfortran v4.4.5 as shipped with FC 13
13 # on danton with gcc-gfortran v4.5.1 as shipped with FC 14
14 # on acesgrid with gcc-gfortran v4.6.0 as shipped with FC 15
15 #
16 # MPI : Tested on acesgrid (Fedora Core 15), using:
17 # module load gcc (Version 4.6.0)
18 # and with mpich1:
19 # module load mvapich
20 # or with mpich2:
21 # module load mvapich2
22 # or with openmpi:
23 # module load openmpi
24 # and on baudelaire.csail.mit.edu (FC13), using:
25 # export MPI_GCC_DIR=/srv/software/gcc/gcc-packages/gcc-4.4.5/mpich2/mpich2-1.3
26 # export MPI_INC_DIR=$MPI_GCC_DIR/include
27 # export PATH=$MPI_GCC_DIR/bin:$PATH
28 #
29 # and on IRIDIS at Southampton
30 # http://www.southampton.ac.uk/isolutions/computing/hpc/iridis/
31 # with
32 # module load openmpi/1.4.3/gcc-4.3.3
33 # and
34 # export MPI_INC_DIR=$MPIROOT/include
35
36 #-------
37 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
38 # and generally, needs to increase the thread stack-size:
39 # - sh,bash:
40 # > export OMP_NUM_THREADS=2
41 # > export GOMP_STACKSIZE=400m
42 # - csh,tcsh:
43 # > setenv OMP_NUM_THREADS 2
44 # > setenv GOMP_STACKSIZE 400m
45 #-------
46
47 if test "x$MPI" = xtrue ; then
48 CC=${CC:=mpicc}
49 FC=${FC:=mpif77}
50 F90C=${F90C:=mpif90}
51 else
52 CC=gcc
53 FC=gfortran
54 F90C=gfortran
55 fi
56
57 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
58 CPP='cpp -traditional -P'
59 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
60 F90FIXEDFORMAT='-ffixed-form'
61 GET_FC_VERSION="--version"
62 OMPFLAG='-fopenmp'
63
64 NOOPTFLAGS='-O0'
65 NOOPTFILES=''
66
67 # Requires gfortran from 2006 onwards for -fconvert=big-endian
68 FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
69 # for big objects:
70 FFLAGS="$FFLAGS -fPIC"
71 #- might want to use '-fdefault-real-8' for fizhi pkg:
72 #FFLAGS="$FFLAGS -fdefault-real-8 -fdefault-double-8"
73
74 if test "x$IEEE" = x ; then #- with optimisation:
75 #- full optimisation
76 FOPTIM='-O3 -funroll-loops'
77 NOOPTFILES="$NOOPTFILES ini_masks_etc.F"
78 #- can use -O2 (safe optimisation) to avoid Pb with some gcc version of -O3:
79 #FOPTIM='-O2 -funroll-loops'
80 else
81 # these may also be useful, but require specific gfortran versions:
82 # -Wnonstd-intrinsics for gfortran <= 4.3
83 # -Wintrinsics-std for gfortran >= 4.4
84 # -Wno-tabs for gfortran >= 4.3
85 FFLAGS="$FFLAGS -Waliasing -Wampersand -Wsurprising -Wline-truncation"
86 #- to get plenty of warnings: -Wall -Wextra (older form: -Wall -W) or:
87 #FFLAGS="$FFLAGS -Wconversion -Wimplicit-interface -Wunused-labels"
88 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
89 FOPTIM='-O0'
90 else #- development/check options:
91 FOPTIM='-O0 -g -fbounds-check'
92 FOPTIM="$FOPTIM -ffpe-trap=invalid,zero,overflow -finit-real=inf"
93 fi
94 fi
95
96 F90FLAGS=$FFLAGS
97 F90OPTIM=$FOPTIM
98 CFLAGS='-O0 -fPIC'
99
100 INCLUDEDIRS=''
101 INCLUDES=''
102 LIBS=''
103
104 if [ "x$NETCDF_ROOT" != x ] ; then
105 INCLUDEDIR="${NETCDF_ROOT}/include"
106 INCLUDES="-I${NETCDF_ROOT}/include"
107 LIBDIR="${NETCDF_ROOT}/lib"
108 LIBS="-L${NETCDF_ROOT}/lib"
109 elif [ "x$NETCDF_HOME" != x ]; then
110 INCLUDEDIR="${NETCDF_HOME}/include"
111 INCLUDES="-I${NETCDF_HOME}/include"
112 LIBDIR="${NETCDF_HOME}/lib"
113 LIBS="-L${NETCDF_HOME}/lib"
114 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
115 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
116 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
117 INCLUDEDIR="${NETCDF_INC}"
118 INCLUDES="-I${NETCDF_INC}"
119 LIBDIR="${NETCDF_LIB}"
120 LIBS="-L${NETCDF_LIB}"
121 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
122 INCLUDEDIR="${NETCDF_INCDIR}"
123 INCLUDES="-I${NETCDF_INCDIR}"
124 LIBDIR="${NETCDF_LIBDIR}"
125 LIBS="-L${NETCDF_LIBDIR}"
126 elif test -d /usr/include/netcdf-3 ; then
127 INCLUDES='-I/usr/include/netcdf-3'
128 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
129 elif test -d /usr/include/netcdf ; then
130 INCLUDES='-I/usr/include/netcdf'
131 elif test -d /usr/local/netcdf ; then
132 INCLUDES='-I/usr/local/netcdf/include'
133 LIBS='-L/usr/local/netcdf/lib'
134 elif test -d /usr/local/include/netcdf.inc ; then
135 INCLUDES='-I/usr/local/include'
136 LIBS='-L/usr/local/lib64'
137 elif test -d /usr/include/netcdf.inc ; then
138 INCLUDES='-I/usr/include'
139 LIBS='-L/usr/lib64'
140 fi
141
142 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
143 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
144 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
145 MPIINCLUDEDIR="$MPI_INC_DIR"
146 MPI_HEADER_FILES='mpif.h mpiof.h'
147 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
148 fi

  ViewVC Help
Powered by ViewVC 1.1.22