/[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.7 - (hide annotations) (download)
Thu Aug 18 22:04:49 2011 UTC (12 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.6: +17 -11 lines
update the default option flags (without -ieee); tested on new acesgrid cluster

1 jmc 1.5 #! /usr/bin/env bash
2 ce107 1.1 #
3 jmc 1.7 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pathf90,v 1.6 2011/08/10 23:27:21 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 ce107 1.1 #
11 jmc 1.5 #-------
12     # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
13     # and generally, needs to increase the thread stack-size:
14     # - sh,bash:
15     # > export OMP_NUM_THREADS=2
16     # > export PSC_OMP_STACK_SIZE=400m
17     # - csh,tcsh:
18     # > setenv OMP_NUM_THREADS 2
19     # > setenv PSC_OMP_STACK_SIZE 400m
20     #-------
21 ce107 1.1
22     CC=pathcc
23     FC=pathf90
24 jmc 1.6 LINK=pathf90
25    
26 ce107 1.2 DEFINES='-DWORDLENGTH=4'
27 ce107 1.1 CPP='cpp -traditional -P'
28 jmc 1.7 EXTENDED_SRC_FLAG='-extend-source'
29 jmc 1.6 GET_FC_VERSION="-v"
30     OMPFLAG='-openmp'
31 jmc 1.7 #OMPFLAG='-openmp -OPT:early_mp=ON'
32 jmc 1.6
33 jmc 1.5 NOOPTFLAGS='-O0 -g'
34 ce107 1.2 NOOPTFILES=''
35    
36 jmc 1.7 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian"
37     #- might want to use '-r8' for fizhi pkg:
38     #FFLAGS="$FFLAGS -r8"
39    
40     if test "x$IEEE" = x ; then #- with optimisation:
41     #- full optimisation, trips over MITgcm code because of compiler problems:
42     #FOPTIM='-Ofast -LNO:fusion=2 -funsafe-math-optimizations'
43     #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
44     FOPTIM='-O3 -LNO:fusion=2 -funsafe-math-optimizations'
45 ce107 1.2 else
46 jmc 1.7 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
47     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
48     else #- development/check options:
49     FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
50 jmc 1.5 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
51 jmc 1.7 fi
52 ce107 1.1 fi
53 ce107 1.2
54     F90FLAGS=$FFLAGS
55     F90OPTIM=$FOPTIM
56 jmc 1.5 CFLAGS='-O0 -m64 -fPIC'
57 jmc 1.3 GSLLIB='-lgsl -lgslcblas'
58 ce107 1.2
59     if [ "x$NETCDF_ROOT" != x ] ; then
60     INCLUDEDIR="${NETCDF_ROOT}/include"
61     INCLUDES="-I${NETCDF_ROOT}/include"
62     LIBDIR="${NETCDF_ROOT}/lib"
63     LIBS="-L${NETCDF_ROOT}/lib"
64     elif [ "x$NETCDF_HOME" != x ]; then
65     INCLUDEDIR="${NETCDF_HOME}/include"
66     INCLUDES="-I${NETCDF_HOME}/include"
67     LIBDIR="${NETCDF_HOME}/lib"
68     LIBS="-L${NETCDF_HOME}/lib"
69     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
70     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
71     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
72     INCLUDEDIR="${NETCDF_INC}"
73     INCLUDES="-I${NETCDF_INC}"
74     LIBDIR="${NETCDF_LIB}"
75     LIBS="-L${NETCDF_LIB}"
76     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
77     INCLUDEDIR="${NETCDF_INCDIR}"
78     INCLUDES="-I${NETCDF_INCDIR}"
79     LIBDIR="${NETCDF_LIBDIR}"
80     LIBS="-L${NETCDF_LIBDIR}"
81     elif test -d /usr/include/netcdf-3 ; then
82     INCLUDES='-I/usr/include/netcdf-3'
83     LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
84     elif test -d /usr/include/netcdf ; then
85     INCLUDES='-I/usr/include/netcdf'
86     elif test -d /usr/local/netcdf ; then
87     INCLUDES='-I/usr/local/netcdf/include'
88     LIBS='-L/usr/local/netcdf/lib'
89     elif test -d /usr/local/include/netcdf.inc ; then
90     INCLUDES='-I/usr/local/include'
91     LIBS='-L/usr/local/lib64'
92     fi
93    

  ViewVC Help
Powered by ViewVC 1.1.22