1 |
jmc |
1.5 |
#! /usr/bin/env bash |
2 |
ce107 |
1.1 |
# |
3 |
jmc |
1.6 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pathf90,v 1.5 2011/08/10 00:35:36 jmc Exp $ |
4 |
ce107 |
1.1 |
# $Name: $ |
5 |
|
|
# |
6 |
jmc |
1.5 |
# Build options for PathScale (EKOPATH) Compiler on Linux x86-64 |
7 |
|
|
# first version tested on Fedore Core 3 x86-64 Opteron (Linux batsi) |
8 |
jmc |
1.6 |
# updated and tested on acesgrid (Fedora Core 15), using: |
9 |
|
|
# module load ekopath (Version 4.0.10) |
10 |
ce107 |
1.1 |
# |
11 |
jmc |
1.5 |
#------- |
12 |
|
|
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
13 |
|
|
# and generally, needs to increase the thread stack-size: |
14 |
|
|
# - sh,bash: |
15 |
|
|
# > export OMP_NUM_THREADS=2 |
16 |
|
|
# > export PSC_OMP_STACK_SIZE=400m |
17 |
|
|
# - csh,tcsh: |
18 |
|
|
# > setenv OMP_NUM_THREADS 2 |
19 |
|
|
# > setenv PSC_OMP_STACK_SIZE 400m |
20 |
|
|
#------- |
21 |
ce107 |
1.1 |
|
22 |
|
|
CC=pathcc |
23 |
|
|
FC=pathf90 |
24 |
jmc |
1.6 |
LINK=pathf90 |
25 |
|
|
|
26 |
ce107 |
1.2 |
DEFINES='-DWORDLENGTH=4' |
27 |
ce107 |
1.1 |
CPP='cpp -traditional -P' |
28 |
jmc |
1.6 |
GET_FC_VERSION="-v" |
29 |
|
|
OMPFLAG='-openmp' |
30 |
|
|
|
31 |
jmc |
1.5 |
NOOPTFLAGS='-O0 -g' |
32 |
ce107 |
1.2 |
NOOPTFILES='' |
33 |
|
|
|
34 |
|
|
if test "x$DEVEL" != x ; then |
35 |
|
|
FFLAGS='-m64 -convert big_endian -fPIC -ffortran-bounds-check -trapuv -g' |
36 |
|
|
else |
37 |
|
|
FFLAGS='-m64 -convert big_endian -fPIC' |
38 |
|
|
fi |
39 |
|
|
|
40 |
ce107 |
1.1 |
if test "x$IEEE" = x ; then |
41 |
|
|
# No need for IEEE-754 |
42 |
ce107 |
1.4 |
FOPTIM='-Ofast -LNO:fusion=2 -funsafe-math-optimizations' |
43 |
ce107 |
1.1 |
else |
44 |
|
|
# Try to follow IEEE-754 |
45 |
jmc |
1.5 |
FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math' |
46 |
ce107 |
1.1 |
fi |
47 |
ce107 |
1.2 |
|
48 |
|
|
F90FLAGS=$FFLAGS |
49 |
|
|
F90OPTIM=$FOPTIM |
50 |
jmc |
1.5 |
CFLAGS='-O0 -m64 -fPIC' |
51 |
jmc |
1.3 |
GSLLIB='-lgsl -lgslcblas' |
52 |
ce107 |
1.2 |
|
53 |
|
|
if [ "x$NETCDF_ROOT" != x ] ; then |
54 |
|
|
INCLUDEDIR="${NETCDF_ROOT}/include" |
55 |
|
|
INCLUDES="-I${NETCDF_ROOT}/include" |
56 |
|
|
LIBDIR="${NETCDF_ROOT}/lib" |
57 |
|
|
LIBS="-L${NETCDF_ROOT}/lib" |
58 |
|
|
elif [ "x$NETCDF_HOME" != x ]; then |
59 |
|
|
INCLUDEDIR="${NETCDF_HOME}/include" |
60 |
|
|
INCLUDES="-I${NETCDF_HOME}/include" |
61 |
|
|
LIBDIR="${NETCDF_HOME}/lib" |
62 |
|
|
LIBS="-L${NETCDF_HOME}/lib" |
63 |
|
|
elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then |
64 |
|
|
NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'` |
65 |
|
|
NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'` |
66 |
|
|
INCLUDEDIR="${NETCDF_INC}" |
67 |
|
|
INCLUDES="-I${NETCDF_INC}" |
68 |
|
|
LIBDIR="${NETCDF_LIB}" |
69 |
|
|
LIBS="-L${NETCDF_LIB}" |
70 |
|
|
elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then |
71 |
|
|
INCLUDEDIR="${NETCDF_INCDIR}" |
72 |
|
|
INCLUDES="-I${NETCDF_INCDIR}" |
73 |
|
|
LIBDIR="${NETCDF_LIBDIR}" |
74 |
|
|
LIBS="-L${NETCDF_LIBDIR}" |
75 |
|
|
elif test -d /usr/include/netcdf-3 ; then |
76 |
|
|
INCLUDES='-I/usr/include/netcdf-3' |
77 |
|
|
LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3' |
78 |
|
|
elif test -d /usr/include/netcdf ; then |
79 |
|
|
INCLUDES='-I/usr/include/netcdf' |
80 |
|
|
elif test -d /usr/local/netcdf ; then |
81 |
|
|
INCLUDES='-I/usr/local/netcdf/include' |
82 |
|
|
LIBS='-L/usr/local/netcdf/lib' |
83 |
|
|
elif test -d /usr/local/include/netcdf.inc ; then |
84 |
|
|
INCLUDES='-I/usr/local/include' |
85 |
|
|
LIBS='-L/usr/local/lib64' |
86 |
|
|
fi |
87 |
|
|
|