source: trunk/environment/ew_linux.bash @ 7547

Revision 7547, 3.9 KB checked in by baker, 3 months ago (diff)
compile SrDatByteDemux?() only #if defined(_M_IX86)
defined(i386)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# Create an Earthworm environment on Linux
2# This file should be sourced by a Bourne shell wanting
3# to run or build an EARTHWORM system under Linux.
4
5# For running EW on Linux, 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.ipv4.ip_local_port_range)
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_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
48
49export GLOBALFLAGS="-m${EW_BITS} -g -D_LINUX -Dlinux -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_USE_TERMIOS -D_FILE_OFFSET_BITS=64 -I${EW_HOME}/${EW_VERSION}/include ${WARNFLAGS}"
50export PLATFORM="LINUX"
51
52export LINK_LIBS="-lm -lpthread"
53
54# Be explicit about which compilers to use
55export CC=gcc
56export CXX=g++
57
58# Set initial defaults
59export CFLAGS=${GLOBALFLAGS}
60export CXXFLAGS=${GLOBALFLAGS}
61
62# Pick a Fortran compiler
63# gfortran (freeware, part of GNU GCC)
64FC=gfortran
65# Intel Fortran (requires a paid license)
66#FC=ifort
67
68if [[ "${FC}" = "gfortran" ]] ; then
69
70   export FC
71   # Extra run-time checks: -fcheck=all
72   #export FFLAGS="-m${EW_BITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fcheck=all,no-array-temps -fbacktrace"
73   export FFLAGS="-m${EW_BITS} -O -g -Wuninitialized -Werror=line-truncation -ffpe-trap=invalid,zero,overflow -fbacktrace"
74
75   # FC_MAIN_IS_C is not needed with gfortran
76   #export FC_MAIN_IS_C=-nofor-main
77
78elif [[ "${FC}" = "ifort" ]] ; then
79
80   export FC
81   # Extra run-time checks: -check bounds,uninit
82   # ifort version 15 introduced the -init option; older compilers complain, but ignore it
83   # ifort complains about comments past column 72; -warn truncated_source is pretty useless
84   #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"
85   export FFLAGS="-m${EW_BITS} -O3 -g -init=snan -init=arrays -extend-source -warn truncated_source -fpe-all=0 -diag-disable 8290 -traceback"
86
87   # Intel Fortran supplies main() unless told not to
88   export FC_MAIN_IS_C=-nofor-main
89
90else
91
92   echo "FC must be either gfortran or ifort"
93
94fi
95
96# Alternatively, you can hard-code values here:
97#export FC='...'
98#export FFLAGS='...'
Note: See TracBrowser for help on using the repository browser.