Warning, /tools/build_options/linux_ia32_ifort 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
28e250ad4e Chri*0001 #!/bin/bash
595c96e5c2 Jean*0002
0003 # Build options for the intel fortran compiler - version 9.0 (and earlier) -
0004 # on Linux IA32 platform
0005
0006 # tested on faulks (FC.6), with OpenMP, using:
0007 # (sh, bash): source /usr/local/pkg/intel/intel_fc_90/bin/ifortvars.sh
0008 # (csh,tcsh): source /usr/local/pkg/intel/intel_fc_90/bin/ifortvars.csh
0009 # [was also tested on hugo (FC.4, FC.9), eddy (FC.5)]
0010 # and on aces-grid cluster, with OpenMP, using:
0011 # module add ifc/9.0.021 icc/9.0.021 intel/9.0
0012 # module add netcdf/3.6.1/icc
0013
0014 # MPI : Tested on aces-grid cluster, using:
0015 # a) default intel (v8.1) and default mpich/intel:
0016 # module add mpich/intel
0017 # module add netcdf/3.6.1/icc
0018 # e.g.(sh,bash):
0019 # export MPI_INC_DIR='/usr/local/pkg/mpich/mpich-intel/include'
0020 # (and run using: mpirun -machinefile my_list_of_nodes)
28e250ad4e Chri*0021 #
595c96e5c2 Jean*0022 # b) intel v9.0 and mpich2-intel (+ OpenMPI or not) using, in this order:
0023 # module add ifc/9.0.021 icc/9.0.021 intel/9.0
0024 # module add mpich2/1.0.3/intel
0025 # module add netcdf/3.6.1/icc
0026 # module add mpiexec (<-- to run with mpiexec)
0027 # e.g.(sh,bash):
0028 # export MPI_INC_DIR='/usr/local/pkg/mpich2/mpich2-1.0.3/intel/include'
0029 # (and run using mpiexec)
28e250ad4e Chri*0030
595c96e5c2 Jean*0031 # OpenMP : not working well with version earlier than v.9
0032 #-------
0033 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
0034 # and generally, needs to increase the stack-size:
0035 # - sh,bash:
0036 # > export OMP_NUM_THREADS=2
0037 # > export KMP_STACKSIZE=400m
0038 # - csh,tcsh:
0039 # > setenv OMP_NUM_THREADS 2
0040 # > setenv KMP_STACKSIZE 400m
0041 #-------
0042
0043 if test "x$MPI" = xtrue ; then
0044 CC='mpicc'
0045 FC='mpif77'
0046 F90C=$FC
0047 #F90C='mpif90'
0048 LINK=$FC
0049 else
0050 CC='icc'
0051 FC='ifort'
0052 F90C=$FC
0053 LINK="$FC -i-static"
0054 fi
bbc46cc2fb Jean*0055
0056 DEFINES='-DWORDLENGTH=4'
f8aa876f2e Ed H*0057 CPP='cpp -traditional -P'
bbc46cc2fb Jean*0058 F90FIXEDFORMAT='-fixed -Tf'
0059 EXTENDED_SRC_FLAG='-132'
595c96e5c2 Jean*0060 GET_FC_VERSION="--version"
0061 OMPFLAG='-openmp'
bbc46cc2fb Jean*0062
595c96e5c2 Jean*0063 NOOPTFLAGS='-O0'
0064 NOOPTFILES=''
28e250ad4e Chri*0065
595c96e5c2 Jean*0066 FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl"
0067 #- might want to use '-r8' for fizhi pkg:
0068 #FFLAGS="$FFLAGS -r8"
0069
0070 if test "x$IEEE" = x ; then #- with optimisation:
0de9ace361 Patr*0071 F90OPTIM='-O3'
595c96e5c2 Jean*0072 FOPTIM='-O3 -align'
f8aa876f2e Ed H*0073 #P3 FOPTIM=$FOPTIM' -tpp6 -xWKM'
0074 #P4 FOPTIM=$FOPTIM' -tpp7 -xWKM'
28e250ad4e Chri*0075 else
595c96e5c2 Jean*0076 F90OPTIM='-O0'
0077 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
0078 # "-mp" is for ieee "maintain precision"
12e0b05979 Jean*0079 FOPTIM='-O0 -noalign'
595c96e5c2 Jean*0080 #FFLAGS="$FFLAGS -mp"
0081 else #- development/check options:
0082 #FOPTIM='-O0 -noalign -CB -CU -CV'
0083 FOPTIM='-O0 -noalign -check all'
0084 FFLAGS="$FFLAGS -xN -pc64"
0085 NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F'
0086 NOOPTFILES=$NOOPTFILES' mitcplr_char2real.F mitcplr_real2char.F'
0087 NOOPTFILES=$NOOPTFILES' mitcplr_char2int.F mitcplr_int2char.F mds_byteswap.F'
0088 fi
28e250ad4e Chri*0089 fi
0090
bbc46cc2fb Jean*0091 F90FLAGS=$FFLAGS
595c96e5c2 Jean*0092 #F90OPTIM=$FOPTIM
28e250ad4e Chri*0093
595c96e5c2 Jean*0094 INCLUDEDIRS=''
0095 INCLUDES=''
0096 LIBS=''
0097
0098 if [ "x$NETCDF_ROOT" != x ] ; then
0099 INCLUDEDIR="${NETCDF_ROOT}/include"
0100 INCLUDES="-I${NETCDF_ROOT}/include"
0101 LIBDIR="${NETCDF_ROOT}/lib"
0102 LIBS="-L${NETCDF_ROOT}/lib"
0103 elif [ "x$NETCDF_HOME" != x ]; then
0104 INCLUDEDIR="${NETCDF_HOME}/include"
0105 INCLUDES="-I${NETCDF_HOME}/include"
0106 LIBDIR="${NETCDF_HOME}/lib"
0107 LIBS="-L${NETCDF_HOME}/lib"
0108 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0109 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0110 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0111 INCLUDEDIR="${NETCDF_INC}"
0112 INCLUDES="-I${NETCDF_INC}"
0113 LIBDIR="${NETCDF_LIB}"
0114 LIBS="-L${NETCDF_LIB}"
0115 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0116 INCLUDEDIR="${NETCDF_INCDIR}"
0117 INCLUDES="-I${NETCDF_INCDIR}"
0118 LIBDIR="${NETCDF_LIBDIR}"
0119 LIBS="-L${NETCDF_LIBDIR}"
0120 elif test -d /usr/include/netcdf-3 ; then
0121 INCLUDES='-I/usr/include/netcdf-3'
0122 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
0123 elif test -d /usr/include/netcdf ; then
0124 INCLUDES='-I/usr/include/netcdf'
0125 elif test -d /usr/local/netcdf ; then
0126 INCLUDES='-I/usr/local/netcdf/include'
0127 LIBS='-L/usr/local/netcdf/lib'
0128 elif test -d /usr/local/include/netcdf.inc ; then
0129 INCLUDES='-I/usr/local/include'
0130 LIBS='-L/usr/local/lib64'
0131 fi
0132
0133 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
0134 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0135 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0136 #- used for parallel (MPI) DIVA
0137 MPIINCLUDEDIR="$MPI_INC_DIR"
0138 #MPI_HEADER_FILES='mpif.h mpiof.h'
595c96e5c2 Jean*0139 fi