Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/linux_amd64_ifort+impi_engaging 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
66fe84e647 Oliv*0001 #!/bin/bash
                0002 #
                0003 #  Build options for ifort with impi on Linux AMD64 platform
                0004 #
                0005 #  Tested on engaging1 (Centos 7) with ifort 2018-01 and impi 2018-01.
dc280143ed Oliv*0006 #  Executable will run on Sandybridge, Haswell, Broadwell, Skylake and above.
66fe84e647 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"
c26ad343d2 Jean*0026 OMPFLAG='-qopenmp'
66fe84e647 Oliv*0027 
                0028 NOOPTFLAGS='-O0 -g'
                0029 NOOPTFILES=''
                0030 
dc280143ed Oliv*0031 if test "x$GENERIC" != x ; then
                0032     # Combined executable with separate code paths for Sandybridge and
                0033     # Haswell/Broadwell/Skylake processors.  Will take longer to compile.
                0034     # We avoid AVX512 as it leads to inconsistencies with other
                0035     # instruction sets, even with -fp-model consistent.
                0036     # If only targeting Haswell and higher, better use -xCORE-AVX2 below.
                0037     # To select this option, set the GENERIC environment veriable when
                0038     # running genmake2, e.g.,
                0039     #   export GENERIC=yes
                0040     #   genmake2 ...
                0041     PROCF=-axAVX,CORE-AVX2
                0042 else
                0043     # This will run on Sandybridge or higher
                0044     PROCF=-xAVX
                0045     # This will run on Haswell or higher
                0046     #PROCF=-xCORE-AVX2
                0047     # This will run on Skylake or higher, but may give different results
                0048     #PROCF=-xCORE-AVX512
                0049 fi
66fe84e647 Oliv*0050 
                0051 CFLAGS="-O0 -ip -m64 $PROCF"
                0052 FFLAGS="$FFLAGS -m64 -convert big_endian -assume byterecl"
                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"
                0059 #- might want to use '-r8' for fizhi pkg:
                0060 #FFLAGS="$FFLAGS -r8"
                0061 
                0062 if test "x$IEEE" = x ; then     #- with optimisation:
dc280143ed Oliv*0063     FOPTIM="-O3 -align -ip -fp-model consistent $PROCF"
66fe84e647 Oliv*0064 else
                0065   if test "x$DEVEL" = x ; then  #- no optimisation + IEEE :
dc280143ed Oliv*0066     FOPTIM="-O0 -fp-model consistent -noalign $PROCF"
66fe84e647 Oliv*0067   else                          #- development/check options:
                0068    #FFLAGS="$FFLAGS -debug all -debug-parameters all -fp-model strict"
                0069     FOPTIM="-O0 -noalign -g -traceback $PROCF"
                0070     NOOPTFLAGS=$FOPTIM
dba3d5ad42 Jean*0071     NOOPTFILES='adread_adwrite.F'
66fe84e647 Oliv*0072     FOPTIM="$FOPTIM -warn all -warn nounused"
                0073     FOPTIM="$FOPTIM -fpe0 -ftz -fp-stack-check -check all -ftrapuv"
                0074   fi
                0075 fi
                0076 
                0077 F90FLAGS=$FFLAGS
                0078 F90OPTIM=$FOPTIM
                0079 
                0080 INCLUDEDIRS=''
                0081 INCLUDES=''
                0082 LIBS=''
                0083 
                0084 if [ "x$NETCDF_ROOT" != x ] ; then
                0085     INCLUDEDIRS="${NETCDF_ROOT}/include"
                0086     INCLUDES="-I${NETCDF_ROOT}/include"
                0087     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_ROOT}/lib"
                0088 elif [ "x$NETCDF_HOME" != x ]; then
                0089     INCLUDEDIRS="${NETCDF_HOME}/include"
                0090     INCLUDES="-I${NETCDF_HOME}/include"
                0091     LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_HOME}/lib"
                0092 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
                0093     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
                0094     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
                0095     INCLUDEDIRS="${NETCDF_INC}"
                0096     INCLUDES="-I${NETCDF_INC}"
                0097     LIBS="-L${NETCDF_LIB}"
                0098 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
                0099     INCLUDEDIRS="${NETCDF_INCDIR}"
                0100     INCLUDES="-I${NETCDF_INCDIR}"
                0101     LIBS="-L${NETCDF_LIBDIR}"
                0102 elif test -d /usr/include/netcdf-3 ; then
                0103     INCLUDEDIRS='/usr/include/netcdf-3'
                0104     INCLUDES='-I/usr/include/netcdf-3'
                0105     LIBS='-L/usr/lib64/netcdf-3 -L/usr/lib/netcdf-3'
                0106 elif test -d /usr/local/pkg/netcdf ; then
                0107     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
                0108     INCLUDES='-I/usr/local/pkg/netcdf/include'
                0109     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'
                0110 elif test -d /usr/include/netcdf ; then
                0111     INCLUDEDIRS='/usr/include/netcdf'
                0112     INCLUDES='-I/usr/include/netcdf'
                0113 elif test -d /usr/local/netcdf ; then
                0114     INCLUDEDIRS='/usr/include/netcdf/include'
                0115     INCLUDES='-I/usr/local/netcdf/include'
                0116     LIBS='-L/usr/local/netcdf/lib64 -L/usr/local/netcdf/lib'
                0117 elif test -f /usr/local/include/netcdf.inc ; then
                0118     INCLUDEDIRS='/usr/local/include'
                0119     INCLUDES='-I/usr/local/include'
                0120     LIBS='-L/usr/local/lib64 -L/usr/local/lib'
                0121 fi
                0122 
                0123 if [ -n "$I_MPI_ROOT" -a -z "$MPI_INC_DIR" ]; then
                0124     MPI_INC_DIR="$I_MPI_ROOT/intel64/include"
                0125 fi
                0126 
                0127 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
                0128     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
                0129     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
                0130     #- used for parallel (MPI) DIVA
                0131     MPIINCLUDEDIR="$MPI_INC_DIR"
                0132    #MPI_HEADER_FILES='mpif.h mpiof.h'
                0133 fi
                0134 
                0135 if [ -n "$SPICELIBS" ]; then
                0136     LIBS="$LIBS $SPICELIBS"
                0137 fi