forked from SPECFEM/specfem2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.guess
200 lines (189 loc) · 7.89 KB
/
flags.guess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#!/bin/sh
# Attempt to guess suitable flags for the Fortran compiler.
# can add -DUSE_SERIAL_CASCADE_FOR_IOs to the compiler options to make the mesher output mesh data
# to the disk for one MPI slice after the other, and to make the solver do the same thing when reading the files back from disk.
# Use AC_CANONICAL_BUILD (and package config.guess, etc.) in the future?
if test x"$UNAME_MS" = x; then
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_MS="${UNAME_MACHINE}:${UNAME_SYSTEM}"
fi
case $FC in
ftn|*/ftn|crayftn|*/crayftn)
#
# Cray Fortran
#
DEF_FFLAGS="-M 1193 -M 1438"
OPT_FFLAGS="-O3 -Onoaggress -Oipa0 -hfp2 -Ovector3 -Oscalar3 -Ocache2 -Ounroll2 -Ofusion2"
# -Oaggress -Oipa4 would make it even more aggressive
DEBUG_FFLAGS="-eC -eD -ec -en -eI -ea -g -G0"
#
;;
pgf95|*/pgf95|pgf90|*/pgf90|pgfortran|*/pgfortran)
#
# Portland PGI
#
DEF_FFLAGS="-Mdclchk -Minform=warn -mcmodel=medium"
OPT_FFLAGS="-Mnobounds -fast"
DEBUG_FFLAGS="-Mbounds"
;;
ifort|*/ifort)
#
# Intel ifort Fortran90 for Linux
# check: http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/fortran/lin/compiler_f/index.htm
#
# option "-assume buffered_io" is important especially on
# parallel file systems like SFS 3.2 / Lustre 1.8. If omitted
# I/O throughput lingers at 2.5 MB/s, with it it can increase to ~44 MB/s
# However it does not make much of a difference on NFS mounted volumes or with SFS 3.1.1 / Lustre 1.6.7.1
DEF_FFLAGS="-xHost -fpe0 -ftz -assume buffered_io -assume byterecl -align sequence -vec-report0 -std03 -diag-disable 6477 -implicitnone -gen-interfaces -warn all" # -mcmodel=medium -shared-intel
OPT_FFLAGS="-O3 -check nobounds"
DEBUG_FFLAGS="-check all -debug -g -O0 -fp-stack-check -traceback -ftrapuv"
## DK DK
## DK DK another flag that can be useful: USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
## DK DK
;;
gfortran|*/gfortran|f95|*/f95)
#
# GNU gfortran
#
DEF_FFLAGS="-std=f2003 -fimplicit-none -frange-check -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow -ffpe-trap=invalid,zero,overflow -Wunused -Werror" # -mcmodel=medium
OPT_FFLAGS="-O3"
DEBUG_FFLAGS="-g -O0 -ggdb -fbacktrace -fbounds-check"
# useful to track loss of accuracy because of automatic double to single precision conversion: -Wconversion (this may generate many warnings...)
;;
g95|*/g95)
#
# g95 (free f95 compiler from http://www.g95.org)
#
DEF_FFLAGS="-fimplicit-none"
OPT_FFLAGS="-O"
DEBUG_FFLAGS="-g -O0 -fbounds-check -ftrace"
;;
f90|*/f90)
case $host_os in
Linux)
#
# AbSoft
#
case $host_cpu in
i*86 | x86_64)
DEF_FFLAGS="-W132 -s -cpu:p7 -v -YDEALLOC=ALL"
OPT_FFLAGS="-O3"
DEBUG_FFLAGS=""
;;
esac
;;
irix)
################ SGI Irix #################
DEF_MPIFC=$FC
DEF_MPILIBS="-lmpi -lfastm -lfpe"
DEF_FFLAGS="-ansi -u -64 -OPT:Olimit=0 -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -r10000 -mips4"
OPT_FFLAGS="-O3"
DEBUG_FFLAGS="-check_bounds"
;;
superux*)
################## NEC SX ##################
DEF_MPIFC=$FC
DEF_FFLAGS="-C hopt -R2 -Wf\" -L nostdout noinclist mrgmsg noeject -msg b -pvctl loopcnt=14000000 expand=10 fullmsg vecthreshold=20 -s\" -pi auto line=100 exp=swap_all,rank"
OPT_FFLAGS=""
DEBUG_FFLAGS=""
;;
esac
;;
lf95|*/lf95)
#
# Lahey f90
#
DEF_FFLAGS="--warn --wo --tpp --f95 --dal"
OPT_FFLAGS="-O"
DEBUG_FFLAGS="--chk"
;;
######## IBM ######
mpxlf*|*/mpxlf*)
DEF_MPIFC=$FC
;;
*xlf*|*/*xlf*)
#
# on some (but not all) IBM machines one might need to add -qsave otherwise the IBM compiler allocates the
# arrays in the stack and the code crashes if the stack size is too
# small (which is sometimes the case, but less often these days on large machines)
#
# you will probably need to add " module load bgq-xl " or similar to your .bash_profile to load the compilers
#
# It could also help to put this in your .bash_profile: export XLFRTEOPTS=aggressive_array_io=yes:buffering=enable
#
# on IBM with xlf one should also set
#
# CC = xlc_r
# CFLAGS = -O3 -q64
#
# or
#
# CC = gcc
# CFLAGS = -O3 -m64
#
# for the C compiler when using -q64 for the Fortran compiler
#
# on IBM xlf90 compiler:
# when encountering errors: ...relocation truncated to fit: R_PPC_LOCAL24PC...
# one should also use additional flags:
# CFLAGS = -Wl,-relax
# Note that the above message would only occur on a linux machine not on AIX.
# "relax" is not an option for the AIX linker and is interpreted in ways that will
# in binaries that are not executable.
#
# deleted -qxflag=dvz because it requires handler function __xl_dzx and thus linking will fail.
#
# The -qstrict option prevents some minor differences of results between xlf and
# other compilers. There is a small decrease in performance, but generally
# it is small or negligible compared to other issues like slow I/O.
DEF_FFLAGS="-qassert=contig -qhot -q64 -qtune=auto -qarch=auto -qcache=auto -qfree=f90 -qsuffix=f=f90 -qhalt=w -qlanglvl=2003std -g -qsuppress=1518-234 -qsuppress=1518-317 -qsuppress=1518-318 -qsuppress=1500-036"
OPT_FFLAGS="-O4 -qstrict"
# Options -qreport -qsource -qlist create a *.lst file containing detailed information about vectorization.
DEBUG_FFLAGS="-g -O0 -C -qddim -qfullpath -qflttrap=overflow:zerodivide:invalid:enable -qfloat=nans -qinitauto=7FBFFFFF"
#
# On IBM BlueGene at IDRIS (France) use:
# -qtune=auto -qarch=450d -qsave instead of -qtune=auto -qarch=auto
#
;;
pathf90|*/pathf90)
#
# pathscale
#
# one should also set
# CC = pathcc
# CFLAGS = -O2
#
DEF_FFLAGS="-fno-math-errno -ffast-math -msse3 -march=auto -fno-second-underscore -align64"
OPT_FFLAGS="-O3 -OPT:Ofast -LNO:fusion=2 -LNO:simd=2 -LNO:simd_verbose=ON"
DEBUG_FFLAGS="-g2"
;;
esac
case $UNAME_MS in
*:IRIX*)
################ SGI Irix #################
##
## CAUTION: always define setenv TRAP_FPE OFF on SGI before compiling
##
FCENV="TRAP_FPE=OFF"
;;
esac
if test "x$COND_DEBUG_TRUE" = "x"; then
DEF_FFLAGS="$DEF_FFLAGS $DEBUG_FFLAGS"
else
DEF_FFLAGS="$DEF_FFLAGS $OPT_FFLAGS"
fi
echo MPIFC=\"$MPIFC\" | sed 's/\$/\\\$/g'
echo MPILIBS=\"$MPILIBS\" | sed 's/\$/\\\$/g'
echo DEF_FFLAGS=\"$DEF_FFLAGS\" | sed 's/\$/\\\$/g'
echo FCENV=\"$FCENV\" | sed 's/\$/\\\$/g'
# Added by IDRIS: set to default values if not passed as arguments
if [ "X${AR}" == "X" ]; then AR="ar"; fi
if [ "X${RANLIB}" == "X" ]; then RANLIB="ranlib"; fi
if [ "X${ARFLAGS}" == "X" ]; then ARFLAGS="cru"; fi
# Added by IDRIS to crosscompile on BlueGene/P
echo AR=\"$AR\" | sed 's/\$/\\\$/g'
echo ARFLAGS=\"$ARFLAGS\" | sed 's/\$/\\\$/g'
echo RANLIB=\"$RANLIB\" | sed 's/\$/\\\$/g'
# end of file