Changeset 7432


Ignore:
Timestamp:
05/24/18 18:22:45 (4 weeks ago)
Author:
baker
Message:

add support for Intel Fortran (ifort), merge Linux and Mac setup scripts where possible

Location:
trunk/environment
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/environment/ew_linux.bash

    r7427 r7432  
    1 # Create an Earthworm environment on Linux! 
     1# Create an Earthworm environment on Linux 
    22# This file should be sourced by a bourne shell wanting  
    33# to run or build an EARTHWORM system under Linux. 
    44 
    5 # for running EW on a linux box if any ports are used, make sure that your 
     5# For running EW on Linux, if any ports are used, make sure that your 
    66# selected ports for wave_serverV or exports are below the range specified 
    77# by your kernel for dynamic port allocation  
     
    1212# Use value from elsewhere IF defined (eg from .bashrc) 
    1313# otherwise use the value after the :- 
    14 export EW_HOME="${EW_INSTALL_HOME:-/opt/earthworm}" 
    15 export EW_VERSION="${EW_INSTALL_VERSION:-earthworm_7.10}" 
     14export EW_HOME="${EW_INSTALL_HOME:-/Users/baker/Desktop/Software/Earthworm}" 
     15export EW_VERSION="${EW_INSTALL_VERSION:-earthworm-7.10-7423}" 
    1616# Or set your own values directly and for certain 
    1717#export EW_HOME=/opt/earthworm 
     
    2121#EW_RUN_DIR=$EW_HOME/run_working 
    2222 
    23 # this next env var is required if you run statmgr: 
     23# This next env var is required if you run statmgr: 
    2424export SYS_NAME=`hostname` 
    2525 
    26 # Set environment variables used by earthworm modules at run-time 
     26# Set environment variables used by Earthworm modules at run-time 
    2727# Path names must end with the slash "/" 
    2828export EW_INSTALLATION="${EW_INSTALL_INSTALLATION:-INST_UNKNOWN}" 
     
    3131export EW_DATA_DIR="${EW_RUN_DIR}/data/" 
    3232 
    33  
    34 #set path=( ${EW_HOME}/${EW_VERSION}/bin $path ) 
     33# Tack the Earthworm bin directory in front of the current path 
    3534export PATH="$EW_HOME/$EW_VERSION/bin:$PATH" 
    3635 
     36# Set environment variables for compiling Earthworm modules 
    3737 
    38 # Set environment variables for compiling earthworm modules 
    39  
    40 # set EWBITS=64 to build for 64-bit target (note that with EWBITS=64 
     38# Set EWBITS=64 to build for 64-bit target (note that with EWBITS=64 
    4139#  size of 'long' type changes from 4 bytes to 8 bytes) 
    4240export EWBITS="${EW_INSTALL_BITS:-32}" 
    4341 
    44 # warning flags for compiler: 
     42# Warning flags for compiler: 
    4543export WARNFLAGS="-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-pragmas -Wformat" 
    46 #  extra flags for enabling more warnings during code development: 
     44# Extra flags for enabling more warnings during code development: 
    4745#export WARNFLAGS="-Wall -Wextra -Wcast-align -Wpointer-arith -Wbad-function-cast -Winline -Wundef -Wnested-externs -Wshadow -Wfloat-equal -Wno-unused-parameter -Wformat" 
    4846 
    4947# -D_FILE_OFFSET_BITS=64 is for Large Filesystem Support (64-bit offsets) on a 32-bit compile (gcc only); it is benign on a 64-bit compile 
    5048 
    51 export GLOBALFLAGS="-m${EWBITS} -g -Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_USE_TERMIOS -D_FILE_OFFSET_BITS=64 -I${EW_HOME}/${EW_VERSION}/include ${WARNFLAGS}" 
     49export GLOBALFLAGS="-m${EWBITS} -g -D_LINUX -Dlinux -D__i386 -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_USE_TERMIOS -D_FILE_OFFSET_BITS=64 -I${EW_HOME}/${EW_VERSION}/include ${WARNFLAGS}" 
    5250export PLATFORM="LINUX" 
    5351 
     
    5553export KEEP_STATE="" 
    5654 
     55# Be explicit about which compilers to use 
     56export CC=gcc 
     57export CXX=g++ 
     58 
    5759# Set initial defaults 
    5860export CFLAGS=${GLOBALFLAGS} 
    59 export CPPFLAGS=${GLOBALFLAGS} 
    60 # be explicit about which compilers to use 
    61 export CC=`which gcc` 
    62 export CXX=`which g++` 
     61export CXXFLAGS=${GLOBALFLAGS} 
    6362 
    64 # Auto-detect fortran compiler and flags 
    65 # We simply use whichever we find first in: gfortran, g77, f77 
    66 FFLAGS="-m${EWBITS} -O -g" 
    67 if which gfortran 1> /dev/null 2>&1 
    68 then 
    69     export FC=`which gfortran` 
    70     FFLAGS="${FFLAGS} -Wuninitialized -Werror=line-truncation -fcheck=all,no-array-temps -fbacktrace" 
    71 elif which g77 1> /dev/null 2>&1 
    72 then 
    73     export FC=`which g77` 
    74 elif which f77 1> /dev/null 2>&1 
    75 then 
    76     export FC=`which f77` 
     63# Pick a Fortran compiler 
     64# gfortran (freeware, part of GNU GCC) 
     65FC=gfortran 
     66# Intel Fortran (requires a paid license) 
     67#FC=ifort 
     68 
     69if [[ "${FC}" = "gfortran" ]] ; then 
     70 
     71   export FC 
     72   # Extra run-time checks: -fcheck=all 
     73   #export FFLAGS="-m${EWBITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fcheck=all,no-array-temps -fbacktrace" 
     74   export FFLAGS="-m${EWBITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fbacktrace" 
     75 
     76   # The hyp2000 FLFLAGS is not needed with gfortran 
     77   #export FLFLAGS=-lSystemStubs 
     78 
     79   # FC_MAIN_IS_C is not needed with gfortran 
     80   #export FC_MAIN_IS_C=-nofor-main 
     81 
     82elif [[ "${FC}" = "ifort" ]] ; then 
     83 
     84   export FC 
     85   # Extra run-time checks: -check bounds,uninit 
     86   # ifort complains about comments past column 72; -warn truncated_source is pretty useless 
     87   #export FFLAGS="-m${EWBITS} -O3 -g -init=snan -init=arrays -extend-source -warn truncated_source -fpe-all=0 -check bounds,uninit -traceback" 
     88   export FFLAGS="-m${EWBITS} -O3 -g -init=snan -init=arrays -extend-source -warn truncated_source -fpe-all=0 -traceback" 
     89 
     90   # The hyp2000 FLFLAGS is not needed with Intel Fortran 
     91   #export FLFLAGS=-lSystemStubs 
     92 
     93   # Intel Fortran supplies main() unless told not to 
     94   export FC_MAIN_IS_C=-nofor-main 
     95 
     96else 
     97 
     98   echo "FC must be either gfortran or ifort" 
     99 
    77100fi 
    78 export FFLAGS 
    79101 
    80102# Alternatively, you can hard-code values here: 
  • trunk/environment/ew_macosx_intel.sh

    r7427 r7432  
    1 # Create an Earthworm environment on MacOSX 
     1# Create an Earthworm environment on Mac OS X 
    22# This file should be sourced by a bourne shell wanting  
    3 # to run or build an EARTHWORM system under MacOSX. 
     3# to run or build an EARTHWORM system under Mac OS X. 
     4 
     5# For running EW on a Mac, if any ports are used, make sure that your 
     6# selected ports for wave_serverV or exports are below the range specified 
     7# by your kernel for dynamic port allocation  
     8# (see sysctl net.inet.ip.portrange.{first,last}) 
    49 
    510# Set environment variables describing your Earthworm directory/version 
    611 
    7 # Use value from elsewhere if defined (eg from .bashrc) 
     12# Use value from elsewhere IF defined (eg from .bashrc) 
     13# otherwise use the value after the :- 
    814export EW_HOME="${EW_INSTALL_HOME:-/opt/earthworm}" 
    915export EW_VERSION="${EW_INSTALL_VERSION:-earthworm_7.10}" 
    10 # Or set your own value directly 
     16# Or set your own values directly 
    1117#export EW_HOME=/Users/earthworm 
    1218#export EW_VERSION=earthworm_7.10 
     19EW_RUN_DIR="${EW_RUN_DIR:-$EW_HOME/run_working}" 
     20# Or set your own value directly 
     21#EW_RUN_DIR=$EW_HOME/run_working 
    1322 
    14 # this next env var is required if you run statmgr: 
     23# This next env var is required if you run statmgr: 
    1524export SYS_NAME=`hostname` 
    1625 
    17 # Set environment variables used by earthworm modules at run-time 
     26# Set environment variables used by Earthworm modules at run-time 
    1827# Path names must end with the slash "/" 
    1928export EW_INSTALLATION="${EW_INSTALL_INSTALLATION:-INST_UNKNOWN}" 
    20 export EW_PARAMS=${EW_HOME}/run/params/ 
    21 export EW_LOG=${EW_HOME}/run/logs/ 
    22 export EW_DATA_DIR=${EW_HOME}/run/data/ 
     29export EW_PARAMS="${EW_RUN_DIR}/params/" 
     30export EW_LOG="${EW_RUN_DIR}/log/" 
     31export EW_DATA_DIR="${EW_RUN_DIR}/data/" 
    2332 
    24 # Tack the earthworm bin directory in front of the current path 
    25 export PATH=${EW_HOME}/$EW_VERSION/bin:${PATH} 
     33# Tack the Earthworm bin directory in front of the current path 
     34export PATH="$EW_HOME/$EW_VERSION/bin:$PATH" 
    2635 
    27 # set EWBITS=64 to build for 64-bit target (note that with EWBITS=64 
     36# Set environment variables for compiling Earthworm modules 
     37 
     38# Set EWBITS=64 to build for 64-bit target (note that with EWBITS=64 
    2839#  size of 'long' type changes from 4 bytes to 8 bytes) 
    2940export EWBITS="${EW_INSTALL_BITS:-32}" 
    3041 
    31 # warning flags for compiler: 
     42# Warning flags for compiler: 
    3243export WARNFLAGS="-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-pragmas -Wformat" 
    33 #  extra flags for enabling more warnings during code development: 
     44# Extra flags for enabling more warnings during code development: 
    3445#export WARNFLAGS="-Wall -Wextra -Wcast-align -Wpointer-arith -Wbad-function-cast -Winline -Wundef -Wnested-externs -Wshadow -Wfloat-equal -Wno-unused-parameter -Wformat" 
    3546 
    3647# -D_DARWIN_USE_64_BIT_INODE (OSX 10.5 and later) is for 64-bit inode numbers (see man 2 stat) 
    3748 
    38 # Set environment variables for compiling earthworm modules 
    39 export GLOBALFLAGS="-m${EWBITS} -g -D_DARWIN_USE_64_BIT_INODE -D_DARWIN_C_SOURCE -D_MACOSX -D_INTEL -D_USE_PTHREADS -D_USE_SCHED -I${EW_HOME}/${EW_VERSION}/include -D_GFORTRAN ${WARNFLAGS}" 
    40 export PLATFORM="LINUX" #Uses the same make options as Linux, so used here 
     49export GLOBALFLAGS="-m${EWBITS} -g -D_MACOSX -D_DARWIN_C_SOURCE -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_DARWIN_USE_64_BIT_INODE -I${EW_HOME}/${EW_VERSION}/include -D_GFORTRAN ${WARNFLAGS}" 
     50export PLATFORM="LINUX" # Uses the same make options as Linux, so used here 
    4151 
    42 # this is needed to get the mac linker to work with some modules. 
     52# This is needed to get the Mac linker to work with some modules 
    4353export LDFLAGS=-Wl,-search_paths_first 
     54export KEEP_STATE="" 
    4455 
    45 # for intel Mac OS X I only found gfortran to work on 10.4.X with the hyp2000 modules, get it from http://hpc.sourceforge.net 
    46 export FC=gfortran 
    47 export FFLAGS="-m${EWBITS} -O -g -Wuninitialized -Werror=line-truncation -fcheck=all,no-array-temps -fbacktrace" 
     56# Be explicit about which compilers to use 
    4857export CC=gcc 
    4958export CXX=g++ 
    50 # the flag below is not needed with gfortran 
    51 #export FLFLAGS=-lSystemStubs 
    52 # 
    53 # Note I (Paul Friberg) got this hyp2000 and hyp2000_mgr to work using this version  
    54 # $ gfortran -v 
    55 #Using built-in specs. 
    56 #Target: i386-apple-darwin8.10.1 
    57 #Configured with: /tmp/gfortran-20071231/ibin/../gcc/configure --prefix=/usr/local/gfortran --enable-languages=c,fortran --with-gmp=/tmp/gfortran-20071231/gfortran_libs --enable-bootstrap 
    58 #Thread model: posix 
    59 #gcc version 4.3.0 20071231 (experimental) [trunk revision 131236] (GCC)  
    6059 
    61 export CFLAGS=$GLOBALFLAGS 
    62 export KEEP_STATE="" 
     60# Set initial defaults 
     61export CFLAGS=${GLOBALFLAGS} 
     62export CXXFLAGS=${GLOBALFLAGS} 
     63 
     64# Pick a Fortran compiler 
     65# gfortran (freeware, available from http://hpc.sourceforge.net) 
     66FC=gfortran 
     67# Intel Fortran (requires a paid license) 
     68#FC=ifort 
     69 
     70if [[ "${FC}" = "gfortran" ]] ; then 
     71 
     72   export FC 
     73   # Extra run-time checks: -fcheck=all 
     74   #export FFLAGS="-m${EWBITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fcheck=all,no-array-temps -fbacktrace" 
     75   export FFLAGS="-m${EWBITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fbacktrace" 
     76 
     77   # The hyp2000 FLFLAGS is not needed with gfortran 
     78   #export FLFLAGS=-lSystemStubs 
     79 
     80   # FC_MAIN_IS_C is not needed with gfortran 
     81   #export FC_MAIN_IS_C=-nofor-main 
     82 
     83elif [[ "${FC}" = "ifort" ]] ; then 
     84 
     85   export FC 
     86   # Extra run-time checks: -check bounds,uninit 
     87   # ifort complains about comments past column 72; -warn truncated_source is pretty useless 
     88   #export FFLAGS="-m${EWBITS} -O3 -g -init=snan -init=arrays -extend-source -warn truncated_source -fpe-all=0 -check bounds,uninit -traceback" 
     89   export FFLAGS="-m${EWBITS} -O3 -g -init=snan -init=arrays -extend-source -warn truncated_source -fpe-all=0 -traceback" 
     90 
     91   # The hyp2000 FLFLAGS is not needed with Intel Fortran 
     92   #export FLFLAGS=-lSystemStubs 
     93 
     94   # Intel Fortran supplies main() unless told not to 
     95   export FC_MAIN_IS_C=-nofor-main 
     96 
     97else 
     98 
     99   echo "FC must be either gfortran or ifort" 
     100 
     101fi 
     102 
     103# Alternatively, you can hard-code values here: 
     104#export FC='...' 
     105#export FFLAGS='...' 
Note: See TracChangeset for help on using the changeset viewer.