source: trunk/environment/ew_macosx_intel.sh @ 7479

Revision 7479, 4.0 KB checked in by baker, 5 months ago (diff)

change environment variable EWBITS to EW_BITS

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# Create an Earthworm environment on Mac OS X
2# This file should be sourced by a Bourne shell wanting
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})
9
10# Set environment variables describing your Earthworm directory/version
11
12# Use value from elsewhere IF defined (eg from .bashrc)
13# otherwise use the value after the :-
14export EW_HOME="${EW_INSTALL_HOME:-/opt/earthworm}"
15export EW_VERSION="${EW_INSTALL_VERSION:-earthworm_7.10}"
16# Or set your own values directly
17#export EW_HOME=/Users/earthworm
18#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
22
23# This next env var is required if you run statmgr:
24export SYS_NAME=`hostname`
25
26# Set environment variables used by Earthworm modules at run-time
27# Path names must end with the slash "/"
28export EW_INSTALLATION="${EW_INSTALL_INSTALLATION:-INST_UNKNOWN}"
29export EW_PARAMS="${EW_RUN_DIR}/params/"
30export EW_LOG="${EW_RUN_DIR}/log/"
31export EW_DATA_DIR="${EW_RUN_DIR}/data/"
32
33# Tack the Earthworm bin directory in front of the current path
34export PATH="$EW_HOME/$EW_VERSION/bin:$PATH"
35
36# Set environment variables for compiling Earthworm modules
37
38# Set EW_BITS=64 to build for 64-bit target (note that with EW_BITS=64
39#  size of 'long' type changes from 4 bytes to 8 bytes)
40export EW_BITS="${EW_INSTALL_BITS:-32}"
41
42# Warning flags for compiler:
43export WARNFLAGS="-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-pragmas -Wformat -Wdeclaration-after-statement"
44# Extra flags for enabling more warnings during code development:
45#export WARNFLAGS="-Wall -Wextra -Wcast-align -Wpointer-arith -Wbad-function-cast -Winline -Wundef -Wnested-externs -Wshadow -Wfloat-equal -Wno-unused-parameter -Wformat -Wdeclaration-after-statement"
46
47# -D_DARWIN_USE_64_BIT_INODE (OSX 10.5 and later) is for 64-bit inode numbers (see man 2 stat)
48
49export GLOBALFLAGS="-m${EW_BITS} -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 ${WARNFLAGS}"
50export PLATFORM="LINUX" # Uses the same make options as Linux, so used here
51
52# This is needed to get the Mac linker to work with some modules
53export LDFLAGS=-Wl,-search_paths_first
54
55# Be explicit about which compilers to use
56export CC=gcc
57export CXX=g++
58
59# Set initial defaults
60export CFLAGS=${GLOBALFLAGS}
61export CXXFLAGS=${GLOBALFLAGS}
62
63# Pick a Fortran compiler
64# gfortran (freeware, available from http://hpc.sourceforge.net)
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${EW_BITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fcheck=all,no-array-temps -fbacktrace"
74   export FFLAGS="-m${EW_BITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fbacktrace"
75
76   # FC_MAIN_IS_C is not needed with gfortran
77   #export FC_MAIN_IS_C=-nofor-main
78
79elif [[ "${FC}" = "ifort" ]] ; then
80
81   export FC
82   # Extra run-time checks: -check bounds,uninit
83   # ifort version 15 introduced the -init option; older compilers complain, but ignore it
84   # ifort complains about comments past column 72; -warn truncated_source is pretty useless
85   #export FFLAGS="-m${EW_BITS} -O3 -g -init=snan -init=arrays -extend-source -warn truncated_source -fpe-all=0 -check bounds,uninit -diag-disable 8290 -traceback"
86   export FFLAGS="-m${EW_BITS} -O3 -g -init=snan -init=arrays -extend-source -warn truncated_source -fpe-all=0 -diag-disable 8290 -traceback"
87
88   # Intel Fortran supplies main() unless told not to
89   export FC_MAIN_IS_C=-nofor-main
90
91else
92
93   echo "FC must be either gfortran or ifort"
94
95fi
96
97# Alternatively, you can hard-code values here:
98#export FC='...'
99#export FFLAGS='...'
Note: See TracBrowser for help on using the repository browser.