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

Annotation of /MITgcm/tools/build_options/linux_amd64_pathf90

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


Revision 1.11 - (hide 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 jmc 1.5 #! /usr/bin/env bash
2 ce107 1.1 #
3 jmc 1.11 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pathf90,v 1.10 2013/07/22 18:40:45 jmc Exp $
4 ce107 1.1 # $Name: $
5     #
6 jmc 1.5 # Build options for PathScale (EKOPATH) Compiler on Linux x86-64
7     # first version tested on Fedore Core 3 x86-64 Opteron (Linux batsi)
8 jmc 1.6 # updated and tested on acesgrid (Fedora Core 15), using:
9     # module load ekopath (Version 4.0.10)
10 jmc 1.8 # 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 jmc 1.5 #-------
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 ce107 1.1
30 jmc 1.8 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 jmc 1.6
40 ce107 1.2 DEFINES='-DWORDLENGTH=4'
41 jmc 1.7 EXTENDED_SRC_FLAG='-extend-source'
42 jmc 1.8 GET_FC_VERSION="--version"
43 jmc 1.6 OMPFLAG='-openmp'
44 jmc 1.7 #OMPFLAG='-openmp -OPT:early_mp=ON'
45 jmc 1.6
46 jmc 1.5 NOOPTFLAGS='-O0 -g'
47 ce107 1.2 NOOPTFILES=''
48    
49 jmc 1.11 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 jmc 1.7 #- 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 jmc 1.9 #- 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 jmc 1.8 NOOPTFILES="$NOOPTFILES mon_set_iounit.F"
70 ce107 1.2 else
71 jmc 1.7 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 jmc 1.5 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
76 jmc 1.7 fi
77 ce107 1.1 fi
78 ce107 1.2
79     F90FLAGS=$FFLAGS
80     F90OPTIM=$FOPTIM
81 jmc 1.3 GSLLIB='-lgsl -lgslcblas'
82 ce107 1.2
83 jmc 1.8 INCLUDEDIRS=''
84     INCLUDES=''
85     LIBS=''
86    
87 ce107 1.2 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 jmc 1.8 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
123     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
124     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
125 jmc 1.10 #- used for parallel (MPI) DIVA
126 jmc 1.8 MPIINCLUDEDIR="$MPI_INC_DIR"
127 jmc 1.10 #MPI_HEADER_FILES='mpif.h mpiof.h'
128 jmc 1.8 fi

  ViewVC Help
Powered by ViewVC 1.1.22