forked from SPECFEM/specfem2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.guess
198 lines (188 loc) · 7.74 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
#!/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
#
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-O3 -Onoaggress -Oipa0 -hfp2 -Ovector3 -Oscalar3 -Ocache2 -Ounroll2 -Ofusion2 -p ../../obj" # turn on optimization; -Oaggress -Oipa4 would make it even more aggressive
# -eC -eD -ec -en -eI -ea -g -G0 -M 1193 -M 1438 -p ../../obj # turn on full debugging and range checking
fi
;;
pgf95|*/pgf95|pgf90|*/pgf90|pgfortran|*/pgfortran)
#
# Portland PGI
#
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-Mdclchk -Minform=warn -mcmodel=medium -Mnobounds -fast -mcmodel=medium"
# -Mbounds
fi
;;
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
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-O3 -check nobounds -xHost -fpe0 -ftz -assume buffered_io -assume byterecl -align sequence -vec-report0 -std03 -implicitnone -gen-interfaces -warn all"
fi
# useful for debugging...
# for debugging: change -O3 -check nobounds to -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
#
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-std=f2003 -fimplicit-none -frange-check -O2 -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow -ffpe-trap=invalid,zero,overflow "
fi
# useful for debugging: add -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)
#
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-O"
fi
;;
f90|*/f90)
case $UNAME_MS in
i*86:Linux | x86_64:Linux)
#
# AbSoft
#
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-W132 -s -O3 -cpu:p7 -v -YDEALLOC=ALL"
fi
;;
*:IRIX*)
################ SGI Irix #################
if test x"$MPIFC" = x; then
MPIFC=$FC
if test x"$MPILIBS" = x; then
MPILIBS="-lmpi -lfastm -lfpe"
fi
fi
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-ansi -u -64 -O3 -OPT:Olimit=0 -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -r10000 -mips4"
# -check_bounds
fi
;;
SX-*:SUPER-UX | ES:ESOS)
################## NEC SX ##################
if test x"$MPIFC" = x; then
MPIFC=$FC
fi
if test x"$DEF_FFLAGS" = x; then
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"
fi
;;
esac
;;
lf95|*/lf95)
#
# Lahey f90
#
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="--warn --wo --tpp --f95 --dal -O"
# --chk
fi
;;
######## IBM ######
mpxlf*|*/mpxlf*)
if test x"$MPIFC" = x; then
MPIFC=$FC
fi
;;
*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
#
if test x"$DEF_FFLAGS" = x; then
# deleted -qxflag=dvz because it requires handler function __xl_dzx and thus linking will fail
DEF_FFLAGS="-O4 -qnostrict -qsimd=auto -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 -Q -Q+rank,swap_all -Wl,-relax"
# Options -qreport -qsource -qlist create a *.lst file containing detailed information about vectorization.
# On IBM BlueGene at IDRIS (France) use:
# -qtune=auto -qarch=450d -qsave instead of -qtune=auto -qarch=auto
#
# to debug with IBM xlf, one can add this: -g -O0 -C -qddim -qfullpath -qflttrap=overflow:zerodivide:invalid:enable -qfloat=nans -qinitauto=7FBFFFFF
#
fi
;;
pathf90|*/pathf90)
#
# pathscale
#
# one should also set
# CC = pathcc
# CFLAGS = -O2
#
if test x"$DEF_FFLAGS" = x; then
DEF_FFLAGS="-O3 -OPT:Ofast -fno-math-errno -ffast-math -LNO:fusion=2 -LNO:simd=2 -LNO:simd_verbose=ON -msse3 -march=auto -fno-second-underscore -align64"
fi
;;
esac
case $UNAME_MS in
*:IRIX*)
################ SGI Irix #################
##
## CAUTION: always define setenv TRAP_FPE OFF on SGI before compiling
##
FCENV="TRAP_FPE=OFF"
;;
esac
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