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

Contents of /MITgcm/tools/build_options/linux_amd64_pathf90

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


Revision 1.13 - (show annotations) (download)
Wed Jul 23 22:54:51 2014 UTC (9 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: 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.12: +3 -3 lines
change from "-O3" to "-O2": this fix isomip restart and seems safer.

1 #! /usr/bin/env bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pathf90,v 1.12 2014/07/16 18:45:15 jmc Exp $
4 # $Name: $
5 #
6 # Build options for PathScale (EKOPATH) Compiler on Linux x86-64
7 # first version tested on Fedore Core 3 x86-64 Opteron (Linux batsi)
8 # updated and tested on acesgrid (Fedora Core 15), using:
9 # module load ekopath (Version 4.0.10)
10 # Also tested with MPI on acesgrid, using:
11 # module load ekopath (Version 4.0.10)
12 # and with mpich1:
13 # module load mvapich
14 # or with mpich2:
15 # module load mvapich2
16 # or with openmpi:
17 # module load openmpi
18
19 #-------
20 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
21 # and generally, needs to increase the thread stack-size:
22 # - sh,bash:
23 # > export OMP_NUM_THREADS=2
24 # > export PSC_OMP_STACK_SIZE=400m
25 # - csh,tcsh:
26 # > setenv OMP_NUM_THREADS 2
27 # > setenv PSC_OMP_STACK_SIZE 400m
28 #-------
29
30 if test "x$MPI" = xtrue ; then
31 CC=mpicc
32 FC=mpif90
33 LINK=mpif90
34 else
35 CC=pathcc
36 FC=pathf90
37 LINK=pathf90
38 fi
39
40 DEFINES='-DWORDLENGTH=4'
41 EXTENDED_SRC_FLAG='-extend-source'
42 GET_FC_VERSION="--version"
43 OMPFLAG='-openmp'
44 #OMPFLAG='-openmp -OPT:early_mp=ON'
45
46 NOOPTFLAGS='-O0 -g'
47 NOOPTFILES=''
48
49 CFLAGS='-O0 -m64'
50 FFLAGS="$FFLAGS -m64 -convert big_endian"
51
52 #- for big setups, compile & link with "-fPIC" or set memory-model to "medium":
53 CFLAGS="$CFLAGS -fPIC"
54 FFLAGS="$FFLAGS -fPIC"
55 #- with FC 19, need to use this without -fPIC (which cancels -mcmodel option):
56 #CFLAGS="$CFLAGS -mcmodel=medium"
57 #FFLAGS="$FFLAGS -mcmodel=medium"
58 #- might want to use '-r8' for fizhi pkg:
59 #FFLAGS="$FFLAGS -r8"
60
61 if test "x$IEEE" = x ; then #- with optimisation:
62 #- full optimisation, trips over MITgcm code because of compiler problems:
63 #FOPTIM='-Ofast -LNO:fusion=2 -funsafe-math-optimizations'
64 #- high optimisation (-O3 & (loop)fusion=2), might find Pb with few S/R:
65 #FOPTIM='-O3 -LNO:fusion=2 -funsafe-math-optimizations'
66 #FOPTIM='-O3 -funsafe-math-optimizations'
67 #- fully safe: switch to -O2 without (loop)fusion=2 (to fix some restart Pb):
68 FOPTIM='-O2 -funsafe-math-optimizations'
69 NOOPTFILES="$NOOPTFILES exf_interpolate.F"
70 #- multi-threaded: mon_set_iounit.F needs lower optimisation (lower than -02)
71 NOOPTFILES="$NOOPTFILES mon_set_iounit.F"
72 NOOPTFLAGS='-O1'
73 else
74 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
75 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
76 else #- development/check options:
77 FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
78 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
79 fi
80 fi
81
82 F90FLAGS=$FFLAGS
83 F90OPTIM=$FOPTIM
84 GSLLIB='-lgsl -lgslcblas'
85
86 INCLUDEDIRS=''
87 INCLUDES=''
88 LIBS=''
89
90 if [ "x$NETCDF_ROOT" != x ] ; then
91 INCLUDEDIR="${NETCDF_ROOT}/include"
92 INCLUDES="-I${NETCDF_ROOT}/include"
93 LIBDIR="${NETCDF_ROOT}/lib"
94 LIBS="-L${NETCDF_ROOT}/lib"
95 elif [ "x$NETCDF_HOME" != x ]; then
96 INCLUDEDIR="${NETCDF_HOME}/include"
97 INCLUDES="-I${NETCDF_HOME}/include"
98 LIBDIR="${NETCDF_HOME}/lib"
99 LIBS="-L${NETCDF_HOME}/lib"
100 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
101 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
102 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
103 INCLUDEDIR="${NETCDF_INC}"
104 INCLUDES="-I${NETCDF_INC}"
105 LIBDIR="${NETCDF_LIB}"
106 LIBS="-L${NETCDF_LIB}"
107 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
108 INCLUDEDIR="${NETCDF_INCDIR}"
109 INCLUDES="-I${NETCDF_INCDIR}"
110 LIBDIR="${NETCDF_LIBDIR}"
111 LIBS="-L${NETCDF_LIBDIR}"
112 elif test -d /usr/include/netcdf-3 ; then
113 INCLUDES='-I/usr/include/netcdf-3'
114 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
115 elif test -d /usr/include/netcdf ; then
116 INCLUDES='-I/usr/include/netcdf'
117 elif test -d /usr/local/netcdf ; then
118 INCLUDES='-I/usr/local/netcdf/include'
119 LIBS='-L/usr/local/netcdf/lib'
120 elif test -d /usr/local/include/netcdf.inc ; then
121 INCLUDES='-I/usr/local/include'
122 LIBS='-L/usr/local/lib64'
123 fi
124
125 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
126 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
127 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
128 #- used for parallel (MPI) DIVA
129 MPIINCLUDEDIR="$MPI_INC_DIR"
130 #MPI_HEADER_FILES='mpif.h mpiof.h'
131 fi

  ViewVC Help
Powered by ViewVC 1.1.22