-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile_include.gfortran
41 lines (31 loc) · 1.18 KB
/
Makefile_include.gfortran
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
# Fortran compiler executable
FC = gfortran
# Tell the compiler to accept C-preprocessor directives
CPPFLAGS = -cpp
# Basic flags such as where to write module files, and an instruction
# to read Fortran unformatted data files as big endian
BASICFLAGS = -J../mod -fconvert=big-endian
# OpenMP flag
OMPFLAG = -fopenmp
ifndef DEBUG
# --NORMAL CONFIGURATION--
# Optimization flags: note that experience with gfortran is that the
# code is faster with -O2 than with -O3. The "-march=native" optimizes
# for the architecture on which the compilation takes place, but this
# means the code might not run on older CPUs.
OPTFLAGS = -O2 -march=native
# Warning flags: all except those that warn about unused stuff
WARNFLAGS = -Wall -Wno-unused-label -Wno-unused-dummy-argument -Wno-unused-variable -Wimplicit-interface
# Debugging flags, such as "-g" to store debugging symbols, and
# instructions to abort if certain floating-point exceptions occur
DEBUGFLAGS = -g -ffpe-trap=invalid,zero,overflow
else
# --DEBUGGING CONFIGURATION--
OPTFLAGS = -O0
WARNFLAGS = -Wall
DEBUGFLAGS = -g -ffpe-trap=invalid,zero,overflow -fcheck=bounds -finit-real=snan
endif
ifdef GPROF
# Add gprof output
DEBUGFLAGS += -pg
endif