Warning, /tools/build_options/linux_amd64_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 #
8ca91312d8 Jean*0004 # Build options for Open64 Compiler on Linux x86-64
0005 # first version tested on Fedore Core 4 x86-64 Opteron (Linux batsi)
0006 # updated and tested on acesgrid (Fedora Core 15), using:
0007 # module load open64 (Version 4.2.4)
664263f724 Jean*0008 # Also tested with MPI on acesgrid, using:
0009 # module load open64 (Version 4.2.4)
0010 # and with mpich1:
0011 # module load mvapich
0012 # or with mpich2:
0013 # module load mvapich2
0014 # or with openmpi: <== not yet tested
0015 # module load openmpi
8ca91312d8 Jean*0016
0017 #-------
0018 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
0019 # and generally, needs to increase the thread stack-size:
0020 # - sh,bash:
0021 # > export OMP_NUM_THREADS=2
0022 # > export OMP_SLAVE_STACK_SIZE=400m
0023 # - csh,tcsh:
0024 # > setenv OMP_NUM_THREADS 2
0025 # > setenv OMP_SLAVE_STACK_SIZE 400m
0026 #-------
d2c76e8719 Cons*0027
664263f724 Jean*0028 if test "x$MPI" = xtrue ; then
0029 CC=mpicc
0030 FC=mpif90
e5db3da141 Oliv*0031 F90C=mpif90
664263f724 Jean*0032 LINK=mpif90
0033 else
0034 CC=opencc
0035 FC=openf90
e5db3da141 Oliv*0036 F90C=openf90
664263f724 Jean*0037 LINK=openf90
0038 fi
8ca91312d8 Jean*0039
d2c76e8719 Cons*0040 DEFINES='-DWORDLENGTH=4'
8ca91312d8 Jean*0041 EXTENDED_SRC_FLAG='-extend-source'
e5db3da141 Oliv*0042 F90FIXEDFORMAT='-fixedform -x f95'
8ca91312d8 Jean*0043 GET_FC_VERSION="--version"
0044 OMPFLAG='-openmp'
0045 #OMPFLAG='-openmp -OPT:early_mp=ON'
0046
0047 NOOPTFLAGS='-O0 -g'
d2c76e8719 Cons*0048 NOOPTFILES=''
0049
7084a0a1f1 Jean*0050 CFLAGS='-O0 -m64'
0051 FFLAGS="$FFLAGS -m64 -convert big_endian"
0052
0053 #- for big setups, compile & link with "-fPIC" or set memory-model to "medium":
0054 #CFLAGS="$CFLAGS -fPIC"
0055 #FFLAGS="$FFLAGS -fPIC"
0056 #- with FC 19, need to use this without -fPIC (which cancels -mcmodel option):
0057 CFLAGS="$CFLAGS -mcmodel=medium"
0058 FFLAGS="$FFLAGS -mcmodel=medium"
8ca91312d8 Jean*0059 #- might want to use '-r8' for fizhi pkg:
0060 #FFLAGS="$FFLAGS -r8"
d2c76e8719 Cons*0061
8ca91312d8 Jean*0062 if test "x$IEEE" = x ; then #- with optimisation:
3bf3eecc6b Jean*0063 #- full optimisation
0064 # ("-Ofast" eqv "-O3 -ipa -OPT:Ofast -fno-math-errno -ffast-math" and "-OPT:Ofast"
0065 # eqv to "-OPT:roundoff=2 -OPT:Olimit=0 -OPT:div_split=ON -OPT:alias=typed")
aab64b67a5 Jean*0066 #FOPTIM='-Ofast -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
0067 FOPTIM='-O3 -OPT:Ofast:roundoff=1:IEEE_arithmetic=3 -ffast-math -LNO:fusion=2'
3bf3eecc6b Jean*0068 #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
aab64b67a5 Jean*0069 #FOPTIM='-O3 -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
0328497096 Jean*0070 #- safer: switch to -O2 with IEEE_arithmetic=2 (to fix some restart Pb):
0071 #FOPTIM='-O2 -OPT:roundoff=1:IEEE_arithmetic=2 -ffast-math -LNO:fusion=2'
d2c76e8719 Cons*0072 else
8ca91312d8 Jean*0073 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
0074 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
0075 else #- development/check options:
0076 FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
0077 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
0078 fi
d2c76e8719 Cons*0079 fi
0080
0081 F90FLAGS=$FFLAGS
0082 F90OPTIM=$FOPTIM
0083 GSLLIB='-lgsl -lgslcblas'
0084
664263f724 Jean*0085 INCLUDEDIRS=''
0086 INCLUDES=''
0087 LIBS=''
0088
d2c76e8719 Cons*0089 if [ "x$NETCDF_ROOT" != x ] ; then
0090 INCLUDEDIR="${NETCDF_ROOT}/include"
0091 INCLUDES="-I${NETCDF_ROOT}/include"
0092 LIBDIR="${NETCDF_ROOT}/lib"
0093 LIBS="-L${NETCDF_ROOT}/lib"
0094 elif [ "x$NETCDF_HOME" != x ]; then
0095 INCLUDEDIR="${NETCDF_HOME}/include"
0096 INCLUDES="-I${NETCDF_HOME}/include"
0097 LIBDIR="${NETCDF_HOME}/lib"
0098 LIBS="-L${NETCDF_HOME}/lib"
0099 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0100 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0101 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0102 INCLUDEDIR="${NETCDF_INC}"
0103 INCLUDES="-I${NETCDF_INC}"
0104 LIBDIR="${NETCDF_LIB}"
0105 LIBS="-L${NETCDF_LIB}"
0106 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0107 INCLUDEDIR="${NETCDF_INCDIR}"
0108 INCLUDES="-I${NETCDF_INCDIR}"
0109 LIBDIR="${NETCDF_LIBDIR}"
0110 LIBS="-L${NETCDF_LIBDIR}"
0111 elif test -d /usr/include/netcdf-3 ; then
0112 INCLUDES='-I/usr/include/netcdf-3'
0113 LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77'
0114 elif test -d /usr/include/netcdf ; then
0115 INCLUDES='-I/usr/include/netcdf'
0116 elif test -d /usr/local/netcdf ; then
0117 INCLUDES='-I/usr/local/netcdf/include'
0118 LIBS='-L/usr/local/netcdf/lib'
0119 elif test -d /usr/local/include/netcdf.inc ; then
0120 INCLUDES='-I/usr/local/include'
0121 LIBS='-L/usr/local/lib64'
0122 fi
0123
664263f724 Jean*0124 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
0125 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0126 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0127 #- used for parallel (MPI) DIVA
664263f724 Jean*0128 MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0129 #MPI_HEADER_FILES='mpif.h mpiof.h'
664263f724 Jean*0130 fi