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

Annotation of /MITgcm/tools/build_options/linux_amd64_open64

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


Revision 1.10 - (hide annotations) (download)
Wed Jul 16 18:45:15 2014 UTC (9 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65, 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.9: +3 -3 lines
fast (no ieee) case: add (safer, lower optimisation) compiler option that
fixes the restart test on acesgrid (login), but leave it commented out.

1 ce107 1.1 #!/bin/bash
2     #
3 jmc 1.10 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_open64,v 1.9 2013/09/23 23:36:05 jmc Exp $
4 ce107 1.1 # $Name: $
5     #
6 jmc 1.2 # Build options for Open64 Compiler on Linux x86-64
7     # first version tested on Fedore Core 4 x86-64 Opteron (Linux batsi)
8     # updated and tested on acesgrid (Fedora Core 15), using:
9     # module load open64 (Version 4.2.4)
10 jmc 1.4 # Also tested with MPI on acesgrid, using:
11     # module load open64 (Version 4.2.4)
12     # and with mpich1:
13     # module load mvapich
14     # or with mpich2:
15     # module load mvapich2
16     # or with openmpi: <== not yet tested
17     # module load openmpi
18 jmc 1.2
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 OMP_SLAVE_STACK_SIZE=400m
25     # - csh,tcsh:
26     # > setenv OMP_NUM_THREADS 2
27     # > setenv OMP_SLAVE_STACK_SIZE 400m
28     #-------
29 ce107 1.1
30 jmc 1.4 if test "x$MPI" = xtrue ; then
31     CC=mpicc
32     FC=mpif90
33 jahn 1.7 F90C=mpif90
34 jmc 1.4 LINK=mpif90
35     else
36     CC=opencc
37     FC=openf90
38 jahn 1.7 F90C=openf90
39 jmc 1.4 LINK=openf90
40     fi
41 jmc 1.2
42 ce107 1.1 DEFINES='-DWORDLENGTH=4'
43 jmc 1.2 EXTENDED_SRC_FLAG='-extend-source'
44 jahn 1.7 F90FIXEDFORMAT='-fixedform -x f95'
45 jmc 1.2 GET_FC_VERSION="--version"
46     OMPFLAG='-openmp'
47     #OMPFLAG='-openmp -OPT:early_mp=ON'
48    
49     NOOPTFLAGS='-O0 -g'
50 ce107 1.1 NOOPTFILES=''
51    
52 jmc 1.9 CFLAGS='-O0 -m64'
53     FFLAGS="$FFLAGS -m64 -convert big_endian"
54    
55     #- for big setups, compile & link with "-fPIC" or set memory-model to "medium":
56     #CFLAGS="$CFLAGS -fPIC"
57     #FFLAGS="$FFLAGS -fPIC"
58     #- with FC 19, need to use this without -fPIC (which cancels -mcmodel option):
59     CFLAGS="$CFLAGS -mcmodel=medium"
60     FFLAGS="$FFLAGS -mcmodel=medium"
61 jmc 1.2 #- might want to use '-r8' for fizhi pkg:
62     #FFLAGS="$FFLAGS -r8"
63 ce107 1.1
64 jmc 1.2 if test "x$IEEE" = x ; then #- with optimisation:
65 jmc 1.3 #- full optimisation
66     # ("-Ofast" eqv "-O3 -ipa -OPT:Ofast -fno-math-errno -ffast-math" and "-OPT:Ofast"
67     # eqv to "-OPT:roundoff=2 -OPT:Olimit=0 -OPT:div_split=ON -OPT:alias=typed")
68 jmc 1.5 #FOPTIM='-Ofast -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
69     FOPTIM='-O3 -OPT:Ofast:roundoff=1:IEEE_arithmetic=3 -ffast-math -LNO:fusion=2'
70 jmc 1.3 #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
71 jmc 1.5 #FOPTIM='-O3 -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
72 jmc 1.10 #- safer: switch to -O2 with IEEE_arithmetic=2 (to fix some restart Pb):
73     #FOPTIM='-O2 -OPT:roundoff=1:IEEE_arithmetic=2 -ffast-math -LNO:fusion=2'
74 ce107 1.1 else
75 jmc 1.2 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
76     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
77     else #- development/check options:
78     FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
79     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
80     fi
81 ce107 1.1 fi
82    
83     F90FLAGS=$FFLAGS
84     F90OPTIM=$FOPTIM
85     GSLLIB='-lgsl -lgslcblas'
86    
87 jmc 1.4 INCLUDEDIRS=''
88     INCLUDES=''
89     LIBS=''
90    
91 ce107 1.1 if [ "x$NETCDF_ROOT" != x ] ; then
92     INCLUDEDIR="${NETCDF_ROOT}/include"
93     INCLUDES="-I${NETCDF_ROOT}/include"
94     LIBDIR="${NETCDF_ROOT}/lib"
95     LIBS="-L${NETCDF_ROOT}/lib"
96     elif [ "x$NETCDF_HOME" != x ]; then
97     INCLUDEDIR="${NETCDF_HOME}/include"
98     INCLUDES="-I${NETCDF_HOME}/include"
99     LIBDIR="${NETCDF_HOME}/lib"
100     LIBS="-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     INCLUDEDIR="${NETCDF_INC}"
105     INCLUDES="-I${NETCDF_INC}"
106     LIBDIR="${NETCDF_LIB}"
107     LIBS="-L${NETCDF_LIB}"
108     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
109     INCLUDEDIR="${NETCDF_INCDIR}"
110     INCLUDES="-I${NETCDF_INCDIR}"
111     LIBDIR="${NETCDF_LIBDIR}"
112     LIBS="-L${NETCDF_LIBDIR}"
113     elif test -d /usr/include/netcdf-3 ; then
114     INCLUDES='-I/usr/include/netcdf-3'
115     LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77'
116     elif test -d /usr/include/netcdf ; then
117     INCLUDES='-I/usr/include/netcdf'
118     elif test -d /usr/local/netcdf ; then
119     INCLUDES='-I/usr/local/netcdf/include'
120     LIBS='-L/usr/local/netcdf/lib'
121     elif test -d /usr/local/include/netcdf.inc ; then
122     INCLUDES='-I/usr/local/include'
123     LIBS='-L/usr/local/lib64'
124     fi
125    
126 jmc 1.4 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
127     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
128     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
129 jmc 1.8 #- used for parallel (MPI) DIVA
130 jmc 1.4 MPIINCLUDEDIR="$MPI_INC_DIR"
131 jmc 1.8 #MPI_HEADER_FILES='mpif.h mpiof.h'
132 jmc 1.4 fi

  ViewVC Help
Powered by ViewVC 1.1.22