Warning, /tools/build_options/linux_ia32_open64 is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d2c76e8719 Cons*0001 #!/bin/bash
0002 #
0003 #
b42854f326 Jean*0004 # Build options for Open64 compiler on Linux IA32 platform
0005 # tested on lagoon (FC 4),
d2c76e8719 Cons*0006 #
b42854f326 Jean*0007 # and on aces cluster (FC 2), version 4.2.1, using:
0008 # module add open64
0009 # export NETCDF_ROOT='/usr/local/pkg/netcdf/netcdf-3.5.1/g77'
0010 # and set environment variable 'GSL_IEEE_MODE' if using "-gsl" option:
0011 # - sh,bash:
0012 # export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized
0013 # - csh,tcsh:
0014 # setenv GSL_IEEE_MODE double-precision,mask-underflow,mask-denormalized
d2c76e8719 Cons*0015
ae09d2a5f6 Jean*0016 # Multithreaded tests require
0017 # export OMP_SLAVE_STACK_SIZE=400m
0018 # export OMP_NUM_THREADS=2
0019
b42854f326 Jean*0020 # MPI : not yet tested
d2c76e8719 Cons*0021
b42854f326 Jean*0022 if test "x$MPI" = xtrue ; then
0023 CC=mpicc
0024 FC=mpif90
0025 F90C=mpif90
0026 LINK=$FC
d2c76e8719 Cons*0027 else
b42854f326 Jean*0028 CC=opencc
0029 FC=openf90
0030 F90C=openf90
0031 LINK=$FC
d2c76e8719 Cons*0032 fi
0033
b42854f326 Jean*0034 # Pb with "-byteswapio"/"-convert big_endian" option in version 4.0 => use -D_BYTESWAPIO
0035 DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4'
0036 CPP='cpp -traditional -P'
0037 EXTENDED_SRC_FLAG='-extend-source'
0038 F90FIXEDFORMAT='-fixedform -x f95'
0039 GET_FC_VERSION="--version"
0040 OMPFLAG='-openmp'
0041 #OMPFLAG="$OMPFLAG -OPT:early_mp=ON"
0042
0043 NOOPTFLAGS='-O0 -g'
0044 NOOPTFILES='ini_vertical_grid.F'
0045
0046 FFLAGS="$FFLAGS -m32 -fPIC"
0047 #- might want to use '-r8' for fizhi pkg:
0048 #FFLAGS="$FFLAGS -r8"
0049
0050 if test "x$IEEE" = x ; then #- with optimisation:
0051 # Note: use just -O2 optimisation to avoid some wierd problems with -O3
0052 # on aces (open64/4.1 & 4.2) (ideal_2D_ocean)
f3aba5400c Jean*0053 FOPTIM='-O2 -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3' # -funsafe-math-optimizations'
b42854f326 Jean*0054 NOOPTFILES="$NOOPTFILES mon_set_iounit.F mon_init.F"
d2c76e8719 Cons*0055 else
b42854f326 Jean*0056 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
0057 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
0058 else #- development/check options:
0059 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
0060 # full checking options:
0061 FOPTIM="$FOPTIM -g -ffortran-bounds-check -trapuv"
0062 NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F'
0063 fi
d2c76e8719 Cons*0064 fi
0065
0066 F90FLAGS=$FFLAGS
0067 F90OPTIM=$FOPTIM
b42854f326 Jean*0068 CFLAGS='-O0 -m32 -fPIC'
d2c76e8719 Cons*0069 GSLLIB='-lgsl -lgslcblas'
0070
0071 if [ "x$NETCDF_ROOT" != x ] ; then
0072 INCLUDEDIR="${NETCDF_ROOT}/include"
0073 INCLUDES="-I${NETCDF_ROOT}/include"
0074 LIBDIR="${NETCDF_ROOT}/lib"
0075 LIBS="-L${NETCDF_ROOT}/lib"
0076 elif [ "x$NETCDF_HOME" != x ]; then
0077 INCLUDEDIR="${NETCDF_HOME}/include"
0078 INCLUDES="-I${NETCDF_HOME}/include"
0079 LIBDIR="${NETCDF_HOME}/lib"
0080 LIBS="-L${NETCDF_HOME}/lib"
0081 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0082 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0083 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0084 INCLUDEDIR="${NETCDF_INC}"
0085 INCLUDES="-I${NETCDF_INC}"
0086 LIBDIR="${NETCDF_LIB}"
0087 LIBS="-L${NETCDF_LIB}"
0088 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0089 INCLUDEDIR="${NETCDF_INCDIR}"
0090 INCLUDES="-I${NETCDF_INCDIR}"
0091 LIBDIR="${NETCDF_LIBDIR}"
0092 LIBS="-L${NETCDF_LIBDIR}"
0093 elif test -d /usr/include/netcdf-3 ; then
0094 INCLUDES='-I/usr/include/netcdf-3'
0095 LIBS='-L/usr/lib/netcdf-3 -lnetcdf_g77'
0096 elif test -d /usr/include/netcdf ; then
0097 INCLUDES='-I/usr/include/netcdf'
0098 elif test -d /usr/local/netcdf ; then
0099 INCLUDES='-I/usr/local/netcdf/include'
0100 LIBS='-L/usr/local/netcdf/lib'
0101 elif test -d /usr/local/include/netcdf.inc ; then
0102 INCLUDES='-I/usr/local/include'
0103 LIBS='-L/usr/local/lib'
0104 fi
0105
b42854f326 Jean*0106 #if [ "x$LIBS" != x ] ; then
0107 # LIBS="$LIBS -lstdc++"
0108 #else
0109 # LIBS="-lstdc++"
0110 #fi
0111
0112 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
0113 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0114 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0115 #- used for parallel (MPI) DIVA
b42854f326 Jean*0116 MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0117 #MPI_HEADER_FILES='mpif.h mpiof.h'
b42854f326 Jean*0118 fi