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

Contents of /MITgcm/tools/build_options/linux_amd64_open64

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


Revision 1.7 - (show annotations) (download)
Sat Mar 30 19:10:55 2013 UTC (11 years, 1 month ago) by jahn
Branch: MAIN
CVS Tags: checkpoint64i, checkpoint64h, checkpoint64j, checkpoint64g, checkpoint64f
Changes since 1.6: +4 -1 lines
add f90 compiler

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_open64,v 1.6 2012/04/13 14:57:33 jmc Exp $
4 # $Name: $
5 #
6 # 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 # 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
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
30 if test "x$MPI" = xtrue ; then
31 CC=mpicc
32 FC=mpif90
33 F90C=mpif90
34 LINK=mpif90
35 else
36 CC=opencc
37 FC=openf90
38 F90C=openf90
39 LINK=openf90
40 fi
41
42 DEFINES='-DWORDLENGTH=4'
43 CPP='cpp -traditional -P'
44 EXTENDED_SRC_FLAG='-extend-source'
45 F90FIXEDFORMAT='-fixedform -x f95'
46 GET_FC_VERSION="--version"
47 OMPFLAG='-openmp'
48 #OMPFLAG='-openmp -OPT:early_mp=ON'
49
50 NOOPTFLAGS='-O0 -g'
51 NOOPTFILES=''
52
53 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian"
54 #- might want to use '-r8' for fizhi pkg:
55 #FFLAGS="$FFLAGS -r8"
56
57 if test "x$IEEE" = x ; then #- with optimisation:
58 #- full optimisation
59 # ("-Ofast" eqv "-O3 -ipa -OPT:Ofast -fno-math-errno -ffast-math" and "-OPT:Ofast"
60 # eqv to "-OPT:roundoff=2 -OPT:Olimit=0 -OPT:div_split=ON -OPT:alias=typed")
61 #FOPTIM='-Ofast -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
62 FOPTIM='-O3 -OPT:Ofast:roundoff=1:IEEE_arithmetic=3 -ffast-math -LNO:fusion=2'
63 #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
64 #FOPTIM='-O3 -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
65 NOOPTFLAGS='-O3 -OPT:roundoff=1:IEEE_arithmetic=2 -LNO:fusion=2'
66 NOOPTFILES='seaice_evp.F'
67 else
68 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
69 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
70 else #- development/check options:
71 FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
72 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
73 fi
74 fi
75
76 F90FLAGS=$FFLAGS
77 F90OPTIM=$FOPTIM
78 CFLAGS='-O0 -m64 -fPIC'
79 GSLLIB='-lgsl -lgslcblas'
80
81 INCLUDEDIRS=''
82 INCLUDES=''
83 LIBS=''
84
85 if [ "x$NETCDF_ROOT" != x ] ; then
86 INCLUDEDIR="${NETCDF_ROOT}/include"
87 INCLUDES="-I${NETCDF_ROOT}/include"
88 LIBDIR="${NETCDF_ROOT}/lib"
89 LIBS="-L${NETCDF_ROOT}/lib"
90 elif [ "x$NETCDF_HOME" != x ]; then
91 INCLUDEDIR="${NETCDF_HOME}/include"
92 INCLUDES="-I${NETCDF_HOME}/include"
93 LIBDIR="${NETCDF_HOME}/lib"
94 LIBS="-L${NETCDF_HOME}/lib"
95 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
96 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
97 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
98 INCLUDEDIR="${NETCDF_INC}"
99 INCLUDES="-I${NETCDF_INC}"
100 LIBDIR="${NETCDF_LIB}"
101 LIBS="-L${NETCDF_LIB}"
102 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
103 INCLUDEDIR="${NETCDF_INCDIR}"
104 INCLUDES="-I${NETCDF_INCDIR}"
105 LIBDIR="${NETCDF_LIBDIR}"
106 LIBS="-L${NETCDF_LIBDIR}"
107 elif test -d /usr/include/netcdf-3 ; then
108 INCLUDES='-I/usr/include/netcdf-3'
109 LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77'
110 elif test -d /usr/include/netcdf ; then
111 INCLUDES='-I/usr/include/netcdf'
112 elif test -d /usr/local/netcdf ; then
113 INCLUDES='-I/usr/local/netcdf/include'
114 LIBS='-L/usr/local/netcdf/lib'
115 elif test -d /usr/local/include/netcdf.inc ; then
116 INCLUDES='-I/usr/local/include'
117 LIBS='-L/usr/local/lib64'
118 fi
119
120 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
121 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
122 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
123 MPIINCLUDEDIR="$MPI_INC_DIR"
124 MPI_HEADER_FILES='mpif.h mpiof.h'
125 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
126 fi

  ViewVC Help
Powered by ViewVC 1.1.22