Warning, /tools/build_options/unsupported/linux_amd64_ifort+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 # Composed and tested by ce107 on ross/weddell (Opteron system)
0005 # Should work fine on EM64T and other AMD64 compatible Intel systems
0006 # a) Processor specific flags:
0007 # 1) for more speed on Core2 processors replace -xW with -xT
0008 # 2) for more speed on Pentium4 based EM64T processors replaces -xW with -xP
0009 # b) For more speed, provided your data size doesn't exceed 2GB you can
0010 # remove -fPIC which carries a performance penalty of 2-6%.
0011 # c) Provided that the libraries you link to are compiled with -fPIC this
0012 # optfile should work.
0013 # d) You can replace -fPIC with -mcmodel=medium which may perform faster
bbc46cc2fb Jean*0014 # than -fPIC and still support data sizes over 2GB per process but all
0015 # the libraries you link to must be compiled with -fPIC or -mcmodel=medium
1335f9f461 Jean*0016 # e) Changed from -O3 to -O2 to avoid buggy Intel v.10 compilers. Speed
0017 # impact appears to be minimal.
0018 #
0019 # DON'T FORGET to set environment variable MPI_INC_DIR to the include
0020 # directory of your MPI implementation
0021
bbc46cc2fb Jean*0022 #-------
0023 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
0024 # and generally, needs to increase the stack-size:
0025 # - sh,bash:
0026 # > export OMP_NUM_THREADS=2
0027 # > export KMP_STACKSIZE=400m
0028 # - csh,tcsh:
0029 # > setenv OMP_NUM_THREADS 2
0030 # > setenv KMP_STACKSIZE 400m
0031 # NOTE: need to set KMP_STACKSIZE in ~/.tcshrc (but curiously, works
0032 # without OMP_NUM_THREADS in ~/.tcshrc).
0033 #-------
0034
1335f9f461 Jean*0035 FC=mpif77
0036 F90C=mpif90
0037 CC=mpicc
0038 LINK='mpif90 -i-dynamic -no-ipo'
0039
0040 DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4'
0041 CPP='cpp -traditional -P'
0042 F90FIXEDFORMAT='-fixed -Tf'
bbc46cc2fb Jean*0043 EXTENDED_SRC_FLAG='-132'
0044 OMPFLAG='-openmp'
1335f9f461 Jean*0045
1150884866 Jean*0046 NOOPTFLAGS='-O0 -g'
1335f9f461 Jean*0047 NOOPTFILES=''
0048
0049 INCLUDEDIRS=''
0050 INCLUDES=''
0051 LIBS=''
0052
0053 if test "x$DEVEL" != x ; then
bbc46cc2fb Jean*0054 FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC -O0 -g -noalign -fpstkchk -check all -fpe0 -traceback -ftrapuv -fpmodel except -warn all"
1335f9f461 Jean*0055 else
bbc46cc2fb Jean*0056 FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC"
1335f9f461 Jean*0057 fi
bbc46cc2fb Jean*0058 #- might want to use '-r8' for fizhi pkg:
0059 #FFLAGS="$FFLAGS -r8"
1335f9f461 Jean*0060
0061 # Note that the -mp switch is for ieee "maintain precision" and is
0062 # roughly equivalent to -ieee
0063 if test "x$IEEE" = x ; then
0064 # No need for IEEE-754
0065 FOPTIM='-O2 -align -xW -ip'
0066 else
0067 # Try to follow IEEE-754
0068 FOPTIM='-O2 -align -xW -ip -mp'
0069 fi
0070 F90FLAGS=$FFLAGS
0071 F90OPTIM=$FOPTIM
0072 CFLAGS='-O2 -ip -fPIC'
0073
0074 if [ "x$NETCDF_ROOT" != x ] ; then
0075 INCLUDEDIRS="${NETCDF_ROOT}/include"
0076 INCLUDES="-I${NETCDF_ROOT}/include"
0077 LIBS="-L${NETCDF_ROOT}/lib"
0078 elif [ "x$NETCDF_HOME" != x ]; then
0079 INCLUDEDIRS="${NETCDF_HOME}/include"
0080 INCLUDES="-I${NETCDF_HOME}/include"
0081 LIBS="-L${NETCDF_HOME}/lib"
0082 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0083 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0084 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0085 INCLUDEDIRS="${NETCDF_INC}"
0086 INCLUDES="-I${NETCDF_INC}"
0087 LIBS="-L${NETCDF_LIB}"
0088 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0089 INCLUDEDIRS="${NETCDF_INCDIR}"
0090 INCLUDES="-I${NETCDF_INCDIR}"
0091 LIBS="-L${NETCDF_LIBDIR}"
0092 elif test -d /usr/include/netcdf-3 ; then
0093 INCLUDEDIRS='/usr/include/netcdf-3'
0094 INCLUDES='-I/usr/include/netcdf-3'
0095 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
0096 elif test -d /usr/include/netcdf ; then
0097 INCLUDEDIRS='/usr/include/netcdf'
0098 INCLUDES='-I/usr/include/netcdf'
0099 elif test -d /usr/local/netcdf ; then
0100 INCLUDEDIRS='/usr/include/netcdf/include'
0101 INCLUDES='-I/usr/local/netcdf/include'
0102 LIBS='-L/usr/local/netcdf/lib'
0103 elif test -d /usr/local/include/netcdf.inc ; then
0104 INCLUDEDIRS='/usr/local/include'
0105 INCLUDES='-I/usr/local/include'
0106 LIBS='-L/usr/local/lib64'
0107 fi
0108
0109
0110 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0111 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
0112 MPIINCLUDEDIR="$MPI_INC_DIR"
0113 MPI_HEADER_FILES='mpif.h mpiof.h'
0114 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'