/[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.11 - (show annotations) (download)
Mon Sep 23 23:36:27 2013 UTC (10 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64o
Changes since 1.10: +10 -4 lines
remove CPP setting (was identical to genmake2 default).

1 #! /usr/bin/env bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pathf90,v 1.10 2013/07/22 18:40:45 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 #- fully safe: switch to -O2 without (loop)fusion=2:
67 FOPTIM='-O3 -funsafe-math-optimizations'
68 #- multi-threaded: mon_set_iounit.F needs lower optimisation (lower than -02)
69 NOOPTFILES="$NOOPTFILES mon_set_iounit.F"
70 else
71 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
72 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
73 else #- development/check options:
74 FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
75 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
76 fi
77 fi
78
79 F90FLAGS=$FFLAGS
80 F90OPTIM=$FOPTIM
81 GSLLIB='-lgsl -lgslcblas'
82
83 INCLUDEDIRS=''
84 INCLUDES=''
85 LIBS=''
86
87 if [ "x$NETCDF_ROOT" != x ] ; then
88 INCLUDEDIR="${NETCDF_ROOT}/include"
89 INCLUDES="-I${NETCDF_ROOT}/include"
90 LIBDIR="${NETCDF_ROOT}/lib"
91 LIBS="-L${NETCDF_ROOT}/lib"
92 elif [ "x$NETCDF_HOME" != x ]; then
93 INCLUDEDIR="${NETCDF_HOME}/include"
94 INCLUDES="-I${NETCDF_HOME}/include"
95 LIBDIR="${NETCDF_HOME}/lib"
96 LIBS="-L${NETCDF_HOME}/lib"
97 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
98 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
99 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
100 INCLUDEDIR="${NETCDF_INC}"
101 INCLUDES="-I${NETCDF_INC}"
102 LIBDIR="${NETCDF_LIB}"
103 LIBS="-L${NETCDF_LIB}"
104 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
105 INCLUDEDIR="${NETCDF_INCDIR}"
106 INCLUDES="-I${NETCDF_INCDIR}"
107 LIBDIR="${NETCDF_LIBDIR}"
108 LIBS="-L${NETCDF_LIBDIR}"
109 elif test -d /usr/include/netcdf-3 ; then
110 INCLUDES='-I/usr/include/netcdf-3'
111 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
112 elif test -d /usr/include/netcdf ; then
113 INCLUDES='-I/usr/include/netcdf'
114 elif test -d /usr/local/netcdf ; then
115 INCLUDES='-I/usr/local/netcdf/include'
116 LIBS='-L/usr/local/netcdf/lib'
117 elif test -d /usr/local/include/netcdf.inc ; then
118 INCLUDES='-I/usr/local/include'
119 LIBS='-L/usr/local/lib64'
120 fi
121
122 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
123 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
124 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
125 #- used for parallel (MPI) DIVA
126 MPIINCLUDEDIR="$MPI_INC_DIR"
127 #MPI_HEADER_FILES='mpif.h mpiof.h'
128 fi

  ViewVC Help
Powered by ViewVC 1.1.22