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

Contents of /MITgcm/tools/build_options/linux_ia32_open64

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


Revision 1.5 - (show annotations) (download)
Wed Sep 7 20:05:57 2011 UTC (12 years, 8 months ago) by jmc
Branch: MAIN
Changes since 1.4: +65 -25 lines
merge linux_ia32_open64+mth and linux_ia32_open64.trapuv into standard optfile

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_open64,v 1.4 2009/08/14 20:28:19 jmc Exp $
4 # $Name: $
5 #
6 # Build options for Open64 compiler on Linux IA32 platform
7 # tested on lagoon (FC 4),
8 #
9 # and on aces cluster (FC 2), version 4.2.1, using:
10 # module add open64
11 # export NETCDF_ROOT='/usr/local/pkg/netcdf/netcdf-3.5.1/g77'
12 # and set environment variable 'GSL_IEEE_MODE' if using "-gsl" option:
13 # - sh,bash:
14 # export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized
15 # - csh,tcsh:
16 # setenv GSL_IEEE_MODE double-precision,mask-underflow,mask-denormalized
17
18 # MPI : not yet tested
19
20 if test "x$MPI" = xtrue ; then
21 CC=mpicc
22 FC=mpif90
23 F90C=mpif90
24 LINK=$FC
25 else
26 CC=opencc
27 FC=openf90
28 F90C=openf90
29 LINK=$FC
30 fi
31
32 # Pb with "-byteswapio"/"-convert big_endian" option in version 4.0 => use -D_BYTESWAPIO
33 DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4'
34 CPP='cpp -traditional -P'
35 EXTENDED_SRC_FLAG='-extend-source'
36 F90FIXEDFORMAT='-fixedform -x f95'
37 GET_FC_VERSION="--version"
38 OMPFLAG='-openmp'
39 #OMPFLAG="$OMPFLAG -OPT:early_mp=ON"
40
41 NOOPTFLAGS='-O0 -g'
42 NOOPTFILES='ini_vertical_grid.F'
43
44 FFLAGS="$FFLAGS -m32 -fPIC"
45 #- might want to use '-r8' for fizhi pkg:
46 #FFLAGS="$FFLAGS -r8"
47
48 if test "x$IEEE" = x ; then #- with optimisation:
49 # Note: use just -O2 optimisation to avoid some wierd problems with -O3
50 # on aces (open64/4.1 & 4.2) (ideal_2D_ocean)
51 FOPTIM='-O2 -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3' # -funsafe-math-optimizations'
52 NOOPTFILES="$NOOPTFILES mon_set_iounit.F mon_init.F"
53 else
54 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
55 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
56 else #- development/check options:
57 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
58 # full checking options:
59 FOPTIM="$FOPTIM -g -ffortran-bounds-check -trapuv"
60 NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F'
61 fi
62 fi
63
64 F90FLAGS=$FFLAGS
65 F90OPTIM=$FOPTIM
66 CFLAGS='-O0 -m32 -fPIC'
67 GSLLIB='-lgsl -lgslcblas'
68
69 if [ "x$NETCDF_ROOT" != x ] ; then
70 INCLUDEDIR="${NETCDF_ROOT}/include"
71 INCLUDES="-I${NETCDF_ROOT}/include"
72 LIBDIR="${NETCDF_ROOT}/lib"
73 LIBS="-L${NETCDF_ROOT}/lib"
74 elif [ "x$NETCDF_HOME" != x ]; then
75 INCLUDEDIR="${NETCDF_HOME}/include"
76 INCLUDES="-I${NETCDF_HOME}/include"
77 LIBDIR="${NETCDF_HOME}/lib"
78 LIBS="-L${NETCDF_HOME}/lib"
79 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
80 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
81 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
82 INCLUDEDIR="${NETCDF_INC}"
83 INCLUDES="-I${NETCDF_INC}"
84 LIBDIR="${NETCDF_LIB}"
85 LIBS="-L${NETCDF_LIB}"
86 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
87 INCLUDEDIR="${NETCDF_INCDIR}"
88 INCLUDES="-I${NETCDF_INCDIR}"
89 LIBDIR="${NETCDF_LIBDIR}"
90 LIBS="-L${NETCDF_LIBDIR}"
91 elif test -d /usr/include/netcdf-3 ; then
92 INCLUDES='-I/usr/include/netcdf-3'
93 LIBS='-L/usr/lib/netcdf-3 -lnetcdf_g77'
94 elif test -d /usr/include/netcdf ; then
95 INCLUDES='-I/usr/include/netcdf'
96 elif test -d /usr/local/netcdf ; then
97 INCLUDES='-I/usr/local/netcdf/include'
98 LIBS='-L/usr/local/netcdf/lib'
99 elif test -d /usr/local/include/netcdf.inc ; then
100 INCLUDES='-I/usr/local/include'
101 LIBS='-L/usr/local/lib'
102 fi
103
104 #if [ "x$LIBS" != x ] ; then
105 # LIBS="$LIBS -lstdc++"
106 #else
107 # LIBS="-lstdc++"
108 #fi
109
110 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
111 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
112 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
113 MPIINCLUDEDIR="$MPI_INC_DIR"
114 MPI_HEADER_FILES='mpif.h mpiof.h'
115 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
116 fi

  ViewVC Help
Powered by ViewVC 1.1.22