Warning, /tools/build_options/unsupported/linux_ia32_ifort10.1+mpi_generic 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
1335f9f461 Jean*0001 #!/bin/bash
0002 #
0003 #
0004 # Constantinos Evangelinos
0005 #
0006 # Build options for the intel 10.1 fortran compiler with a generic MPI
0007 #
0008 # DON'T FORGET to set environment variable MPI_INC_DIR to the include
0009 # directory of your MPI implementation
0010
0011 FC=${FC:=mpif77}
0012 F90C=${F90C:=mpif90}
0013 CC=${CC:=mpicc}
0014 LINK="$F90C -shared-intel -no-ipo"
0015
0016 DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4'
0017 CPP='cpp -traditional -P'
0018 F90FIXEDFORMAT='-fixed -Tf'
0019 EXTENDED_SRC_FLAG='-132'
0020
0021 NOOPTFLAGS='-O0 -g'
0022 NOOPTFILES=''
0023
0024 INCLUDEDIRS=''
0025 INCLUDES=''
0026 LIBS=''
0027
0028 if test "x$DEVEL" != x ; then
a2b7e9952a Jean*0029 FFLAGS="$FFLAGS -convert big_endian -assume byterecl -O0 -g -debug all -debug-parameters all -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model strict -warn all"
1335f9f461 Jean*0030 else
a2b7e9952a Jean*0031 FFLAGS="$FFLAGS -W0 -WB -convert big_endian -assume byterecl"
1335f9f461 Jean*0032 fi
a2b7e9952a Jean*0033 #- might want to use '-r8' for fizhi pkg:
0034 #FFLAGS="$FFLAGS -r8"
1335f9f461 Jean*0035
0036 if test "x$GENERIC" != x ; then
0037 PROCF=-axSOTPNWK
0038 else
0039 has_sse4a=f
0040 has_sse4=f
0041 has_ssse3=f
0042 has_sse3=f
0043 has_sse2=f
0044 has_sse=f
0045 is_opteron=f
0046 is_pentiumm=f
0047 grep flags /proc/cpuinfo | grep " sse4a " > /dev/null 2>&1 && has_sse4a=t
0048 grep flags /proc/cpuinfo | grep " sse4 " > /dev/null 2>&1 && has_sse4=t
0049 grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_ssse3=t
0050 grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_sse3=t
0051 grep flags /proc/cpuinfo | grep " sse2 " > /dev/null 2>&1 && has_sse2=t
0052 grep flags /proc/cpuinfo | grep " sse " > /dev/null 2>&1 && has_sse=t
0053 grep "model name" /proc/cpuinfo | grep " Opteron" > /dev/null 2>&1 && is_opteron=t
0054 grep "model name" /proc/cpuinfo | grep " Phenom" > /dev/null 2>&1 && is_opteron=t
0055 grep "model name" /proc/cpuinfo | grep " Athlon 64" > /dev/null 2>&1 && is_opteron=t
0056 grep "model name" /proc/cpuinfo | grep " Pentium(R) M" > /dev/null 2>&1 && is_pentiumm=t
0057 if test "x$has_sse4a" = xt ; then
0058 PROCF=-xO
0059 elif test "x$has_sse4" = xt ; then
0060 PROCF=-xS
0061 elif test "x$has_ssse3" = xt ; then
0062 PROCF=-xT
0063 elif test "x$has_sse3" = xt ; then
0064 if test "x$is_opteron" = xt ; then
0065 PROCF=-xO
0066 else
0067 PROCF=-xP
0068 fi
0069 elif test "x$has_sse2" = xt ; then
0070 if test "x$is_pentiumm" = xt ; then
0071 PROCF=-xB
0072 elif test "x$is_opteron" = xt ; then
0073 PROCF=-xW
0074 else
0075 PROCF=-xN
0076 fi
0077 elif test "x$has_sse" = xt ; then
0078 PROCF=-xK
0079 fi
0080 fi
0081 # Note that the -mp switch is for ieee "maintain precision" and is
0082 # roughly equivalent to -ieee
0083 if test "x$IEEE" = x ; then
0084 FOPTIM="-O3 -align -ip -opt-streaming-stores auto $PROCF"
0085 else
0086 if test "x$DEVEL" != x ; then
0087 FOPTIM="$PROCF"
0088 else
0089 FOPTIM="-O0 -mp -noalign $PROCF"
0090 fi
0091 fi
0092 F90FLAGS=$FFLAGS
0093 F90OPTIM=$FOPTIM
0094 CFLAGS="-O2 -ip $PROCF"
0095
0096 if [ "x$NETCDF_ROOT" != x ] ; then
0097 INCLUDEDIRS="${NETCDF_ROOT}/include"
0098 INCLUDES="-I${NETCDF_ROOT}/include"
0099 LIBS="-L${NETCDF_ROOT}/lib"
0100 elif [ "x$NETCDF_HOME" != x ]; then
0101 INCLUDEDIRS="${NETCDF_HOME}/include"
0102 INCLUDES="-I${NETCDF_HOME}/include"
0103 LIBS="-L${NETCDF_HOME}/lib"
0104 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0105 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0106 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0107 INCLUDEDIRS="${NETCDF_INC}"
0108 INCLUDES="-I${NETCDF_INC}"
0109 LIBS="-L${NETCDF_LIB}"
0110 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0111 INCLUDEDIRS="${NETCDF_INCDIR}"
0112 INCLUDES="-I${NETCDF_INCDIR}"
0113 LIBS="-L${NETCDF_LIBDIR}"
0114 elif test -d /usr/include/netcdf-3 ; then
0115 INCLUDEDIRS='/usr/include/netcdf-3'
0116 INCLUDES='-I/usr/include/netcdf-3'
0117 LIBS='-L/usr/lib/netcdf-3'
0118 elif test -d /usr/local/pkg/netcdf ; then
0119 INCLUDEDIRS='/usr/local/pkg/netcdf/include'
0120 INCLUDES='-I/usr/local/pkg/netcdf/include'
0121 LIBS='-L/usr/local/pkg/netcdf/lib'
0122 elif test -d /usr/include/netcdf ; then
0123 INCLUDEDIRS='/usr/include/netcdf'
0124 INCLUDES='-I/usr/include/netcdf'
0125 elif test -d /usr/local/netcdf ; then
0126 INCLUDEDIRS='/usr/include/netcdf/include'
0127 INCLUDES='-I/usr/local/netcdf/include'
0128 LIBS='-L/usr/local/netcdf/lib'
0129 elif test -f /usr/local/include/netcdf.inc ; then
0130 INCLUDEDIRS='/usr/local/include'
0131 INCLUDES='-I/usr/local/include'
0132 LIBS='-L/usr/local/lib'
0133 fi
0134
0135 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0136 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
0137 MPIINCLUDEDIR="$MPI_INC_DIR"
0138 MPI_HEADER_FILES='mpif.h mpiof.h'
0139 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'