/[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.8 - (hide annotations) (download)
Fri Aug 19 22:54:04 2011 UTC (12 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63b, checkpoint63c, checkpoint64
Changes since 1.7: +32 -6 lines
merge linux_amd64_pathf90+mpi into linux_amd64_pathf90
 (allows an MPI built using "genmake2 -mpi")

1 jmc 1.5 #! /usr/bin/env bash
2 ce107 1.1 #
3 jmc 1.8 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pathf90,v 1.7 2011/08/18 22:04:49 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 ce107 1.1 CPP='cpp -traditional -P'
42 jmc 1.7 EXTENDED_SRC_FLAG='-extend-source'
43 jmc 1.8 GET_FC_VERSION="--version"
44 jmc 1.6 OMPFLAG='-openmp'
45 jmc 1.7 #OMPFLAG='-openmp -OPT:early_mp=ON'
46 jmc 1.6
47 jmc 1.5 NOOPTFLAGS='-O0 -g'
48 ce107 1.2 NOOPTFILES=''
49    
50 jmc 1.7 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian"
51     #- might want to use '-r8' for fizhi pkg:
52     #FFLAGS="$FFLAGS -r8"
53    
54     if test "x$IEEE" = x ; then #- with optimisation:
55     #- full optimisation, trips over MITgcm code because of compiler problems:
56     #FOPTIM='-Ofast -LNO:fusion=2 -funsafe-math-optimizations'
57     #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
58     FOPTIM='-O3 -LNO:fusion=2 -funsafe-math-optimizations'
59 jmc 1.8 NOOPTFILES="$NOOPTFILES mon_set_iounit.F"
60 ce107 1.2 else
61 jmc 1.7 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
62     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
63     else #- development/check options:
64     FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
65 jmc 1.5 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
66 jmc 1.7 fi
67 ce107 1.1 fi
68 ce107 1.2
69     F90FLAGS=$FFLAGS
70     F90OPTIM=$FOPTIM
71 jmc 1.5 CFLAGS='-O0 -m64 -fPIC'
72 jmc 1.3 GSLLIB='-lgsl -lgslcblas'
73 ce107 1.2
74 jmc 1.8 INCLUDEDIRS=''
75     INCLUDES=''
76     LIBS=''
77    
78 ce107 1.2 if [ "x$NETCDF_ROOT" != x ] ; then
79     INCLUDEDIR="${NETCDF_ROOT}/include"
80     INCLUDES="-I${NETCDF_ROOT}/include"
81     LIBDIR="${NETCDF_ROOT}/lib"
82     LIBS="-L${NETCDF_ROOT}/lib"
83     elif [ "x$NETCDF_HOME" != x ]; then
84     INCLUDEDIR="${NETCDF_HOME}/include"
85     INCLUDES="-I${NETCDF_HOME}/include"
86     LIBDIR="${NETCDF_HOME}/lib"
87     LIBS="-L${NETCDF_HOME}/lib"
88     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
89     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
90     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
91     INCLUDEDIR="${NETCDF_INC}"
92     INCLUDES="-I${NETCDF_INC}"
93     LIBDIR="${NETCDF_LIB}"
94     LIBS="-L${NETCDF_LIB}"
95     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
96     INCLUDEDIR="${NETCDF_INCDIR}"
97     INCLUDES="-I${NETCDF_INCDIR}"
98     LIBDIR="${NETCDF_LIBDIR}"
99     LIBS="-L${NETCDF_LIBDIR}"
100     elif test -d /usr/include/netcdf-3 ; then
101     INCLUDES='-I/usr/include/netcdf-3'
102     LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
103     elif test -d /usr/include/netcdf ; then
104     INCLUDES='-I/usr/include/netcdf'
105     elif test -d /usr/local/netcdf ; then
106     INCLUDES='-I/usr/local/netcdf/include'
107     LIBS='-L/usr/local/netcdf/lib'
108     elif test -d /usr/local/include/netcdf.inc ; then
109     INCLUDES='-I/usr/local/include'
110     LIBS='-L/usr/local/lib64'
111     fi
112    
113 jmc 1.8 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
114     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
115     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
116     MPIINCLUDEDIR="$MPI_INC_DIR"
117     MPI_HEADER_FILES='mpif.h mpiof.h'
118     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
119     fi

  ViewVC Help
Powered by ViewVC 1.1.22