#!/bin/bash # # $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/build_options/linux_amd64_open64,v 1.3 2011/08/18 22:04:49 jmc Exp $ # $Name: $ # # Build options for Open64 Compiler on Linux x86-64 # first version tested on Fedore Core 4 x86-64 Opteron (Linux batsi) # updated and tested on acesgrid (Fedora Core 15), using: # module load open64 (Version 4.2.4) #------- # run with OpenMP: needs to set environment var. OMP_NUM_THREADS # and generally, needs to increase the thread stack-size: # - sh,bash: # > export OMP_NUM_THREADS=2 # > export OMP_SLAVE_STACK_SIZE=400m # - csh,tcsh: # > setenv OMP_NUM_THREADS 2 # > setenv OMP_SLAVE_STACK_SIZE 400m #------- CC=opencc FC=openf90 LINK=openf90 DEFINES='-DWORDLENGTH=4' CPP='cpp -traditional -P' EXTENDED_SRC_FLAG='-extend-source' GET_FC_VERSION="--version" OMPFLAG='-openmp' #OMPFLAG='-openmp -OPT:early_mp=ON' NOOPTFLAGS='-O0 -g' NOOPTFILES='' FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian" #- might want to use '-r8' for fizhi pkg: #FFLAGS="$FFLAGS -r8" if test "x$IEEE" = x ; then #- with optimisation: #- full optimisation # ("-Ofast" eqv "-O3 -ipa -OPT:Ofast -fno-math-errno -ffast-math" and "-OPT:Ofast" # eqv to "-OPT:roundoff=2 -OPT:Olimit=0 -OPT:div_split=ON -OPT:alias=typed") FOPTIM='-Ofast -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3' #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2: #FOPTIM='-O3 -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3' else if test "x$DEVEL" = x ; then #- no optimisation + IEEE : FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math' else #- development/check options: FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g" FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math' fi fi F90FLAGS=$FFLAGS F90OPTIM=$FOPTIM CFLAGS='-O0 -m64 -fPIC' GSLLIB='-lgsl -lgslcblas' if [ "x$NETCDF_ROOT" != x ] ; then INCLUDEDIR="${NETCDF_ROOT}/include" INCLUDES="-I${NETCDF_ROOT}/include" LIBDIR="${NETCDF_ROOT}/lib" LIBS="-L${NETCDF_ROOT}/lib" elif [ "x$NETCDF_HOME" != x ]; then INCLUDEDIR="${NETCDF_HOME}/include" INCLUDES="-I${NETCDF_HOME}/include" LIBDIR="${NETCDF_HOME}/lib" LIBS="-L${NETCDF_HOME}/lib" elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'` NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'` INCLUDEDIR="${NETCDF_INC}" INCLUDES="-I${NETCDF_INC}" LIBDIR="${NETCDF_LIB}" LIBS="-L${NETCDF_LIB}" elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then INCLUDEDIR="${NETCDF_INCDIR}" INCLUDES="-I${NETCDF_INCDIR}" LIBDIR="${NETCDF_LIBDIR}" LIBS="-L${NETCDF_LIBDIR}" elif test -d /usr/include/netcdf-3 ; then INCLUDES='-I/usr/include/netcdf-3' LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77' elif test -d /usr/include/netcdf ; then INCLUDES='-I/usr/include/netcdf' elif test -d /usr/local/netcdf ; then INCLUDES='-I/usr/local/netcdf/include' LIBS='-L/usr/local/netcdf/lib' elif test -d /usr/local/include/netcdf.inc ; then INCLUDES='-I/usr/local/include' LIBS='-L/usr/local/lib64' fi