Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/linux_amd64_ifort+impi is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit c26ad343 on 2023-02-14 14:29:40 UTC
3b7737261c Oliv*0001 #!/bin/bash
                0002 #
                0003 #  Build options for ifort with impi on Linux AMD64 platform
                0004 #
c26ad343d2 Jean*0005 #  Tested on engaging (Centos 6, Centos 7), with or without OpenMP,
                0006 #                     with ifort 14.0.2 (20140120) and impi 4.1.3.048
3b7737261c Oliv*0007 #
                0008 #-------
                0009 
                0010 if test "x$MPI" = xtrue ; then
                0011   CC=${MPICC:=mpiicc}
                0012   FC=${MPIFC:=mpiifort}
                0013   F90C=${MPIF90C:=mpiifort}
                0014   LINK="$F90C -shared-intel -no-ipo"
                0015 else
                0016   CC=icc
                0017   FC=ifort
                0018   F90C=ifort
                0019   LINK="$F90C -shared-intel"
                0020 fi
                0021 
                0022 DEFINES='-DWORDLENGTH=4'
                0023 F90FIXEDFORMAT='-fixed -Tf'
                0024 EXTENDED_SRC_FLAG='-132'
                0025 GET_FC_VERSION="--version"
                0026 OMPFLAG='-openmp'
                0027 
                0028 NOOPTFLAGS='-O0 -g'
                0029 NOOPTFILES=''
                0030 
c26ad343d2 Jean*0031 #- for setting specific options, check compiler version:
                0032 fcVers=`$FC $GET_FC_VERSION | head -n 1 | awk '{print $NF}'`
                0033 if ! [[ $fcVers =~ ^[0-9]+$ ]] ; then
                0034   echo "    un-recognized Compiler-release '$fcVers' ; ignored (-> set to 0)" ; fcVers=0 ;
                0035 else echo "    get Compiler-release: '$fcVers'" ; fi
                0036 if [ $fcVers -ge 20160301 ] ; then
                0037     OMPFLAG='-qopenmp'
                0038 fi
                0039 
3b7737261c Oliv*0040 if test "x$GENERIC" != x ; then
                0041     PROCF=-axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2
                0042 else
                0043     PROCF=-xHost
                0044 fi
                0045 
                0046 CFLAGS="-O0 -ip -m64 $PROCF"
                0047 FFLAGS="$FFLAGS -m64 -convert big_endian -assume byterecl"
                0048 #- for big setups, compile & link with "-fPIC" or set memory-model to "medium":
                0049 #CFLAGS="$CFLAGS -fPIC"
                0050 #FFLAGS="$FFLAGS -fPIC"
                0051 #-  with FC 19, need to use this without -fPIC (which cancels -mcmodel option):
                0052  CFLAGS="$CFLAGS -mcmodel=medium"
                0053  FFLAGS="$FFLAGS -mcmodel=medium"
                0054 #- might want to use '-r8' for fizhi pkg:
                0055 #FFLAGS="$FFLAGS -r8"
                0056 
                0057 if test "x$IEEE" = x ; then     #- with optimisation:
                0058     FOPTIM="-O2 -align -ip -fp-model source $PROCF"
                0059 else
                0060   if test "x$DEVEL" = x ; then  #- no optimisation + IEEE :
                0061     FOPTIM="-O0 -fp-model source -noalign $PROCF"
                0062   else                          #- development/check options:
                0063    #FFLAGS="$FFLAGS -debug all -debug-parameters all -fp-model strict"
                0064     FOPTIM="-O0 -noalign -g -traceback $PROCF"
                0065     NOOPTFLAGS=$FOPTIM
dba3d5ad42 Jean*0066     NOOPTFILES='adread_adwrite.F'
3b7737261c Oliv*0067     FOPTIM="$FOPTIM -warn all -warn nounused"
                0068     FOPTIM="$FOPTIM -fpe0 -ftz -fp-stack-check -check all -ftrapuv"
                0069   fi
                0070 fi
                0071 
                0072 F90FLAGS=$FFLAGS
                0073 F90OPTIM=$FOPTIM
                0074 
                0075 INCLUDEDIRS=''
                0076 INCLUDES=''
                0077 LIBS=''
                0078 
                0079 if [ "x$NETCDF_ROOT" != x ] ; then
                0080     INCLUDEDIRS="${NETCDF_ROOT}/include"
                0081     INCLUDES="-I${NETCDF_ROOT}/include"
                0082     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_ROOT}/lib"
                0083 elif [ "x$NETCDF_HOME" != x ]; then
                0084     INCLUDEDIRS="${NETCDF_HOME}/include"
                0085     INCLUDES="-I${NETCDF_HOME}/include"
                0086     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_HOME}/lib"
                0087 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
                0088     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
                0089     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
                0090     INCLUDEDIRS="${NETCDF_INC}"
                0091     INCLUDES="-I${NETCDF_INC}"
                0092     LIBS="-L${NETCDF_LIB}"
                0093 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
                0094     INCLUDEDIRS="${NETCDF_INCDIR}"
                0095     INCLUDES="-I${NETCDF_INCDIR}"
                0096     LIBS="-L${NETCDF_LIBDIR}"
                0097 elif test -d /usr/include/netcdf-3 ; then
                0098     INCLUDEDIRS='/usr/include/netcdf-3'
                0099     INCLUDES='-I/usr/include/netcdf-3'
                0100     LIBS='-L/usr/lib64/netcdf-3 -L/usr/lib/netcdf-3'
                0101 elif test -d /usr/local/pkg/netcdf ; then
                0102     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
                0103     INCLUDES='-I/usr/local/pkg/netcdf/include'
                0104     LIBS='-L/usr/local/pkg-x86_64/netcdf/lib64 -L/usr/local/pkg-x86_64/netcdf/lib -L/usr/local/pkg/netcdf/lib64 -L/usr/local/pkg/netcdf/lib'
                0105 elif test -d /usr/include/netcdf ; then
                0106     INCLUDEDIRS='/usr/include/netcdf'
                0107     INCLUDES='-I/usr/include/netcdf'
                0108 elif test -d /usr/local/netcdf ; then
                0109     INCLUDEDIRS='/usr/include/netcdf/include'
                0110     INCLUDES='-I/usr/local/netcdf/include'
                0111     LIBS='-L/usr/local/netcdf/lib64 -L/usr/local/netcdf/lib'
                0112 elif test -f /usr/local/include/netcdf.inc ; then
                0113     INCLUDEDIRS='/usr/local/include'
                0114     INCLUDES='-I/usr/local/include'
                0115     LIBS='-L/usr/local/lib64 -L/usr/local/lib'
                0116 fi
                0117 
c16e8a5c0e Oliv*0118 if [ -n "$I_MPI_ROOT" -a -z "$MPI_INC_DIR" ]; then
                0119     MPI_INC_DIR="$I_MPI_ROOT/intel64/include"
                0120 fi
                0121 
3b7737261c Oliv*0122 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
                0123     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
                0124     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
                0125     #- used for parallel (MPI) DIVA
                0126     MPIINCLUDEDIR="$MPI_INC_DIR"
                0127    #MPI_HEADER_FILES='mpif.h mpiof.h'
                0128 fi