-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
353 lines (333 loc) · 9.71 KB
/
Copy pathMakefile
File metadata and controls
353 lines (333 loc) · 9.71 KB
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
#-----------------------------------------------------------------------
# Copyright 2011-2016 Lasse Lambrecht (Ruhr-Universität Bochum, GER)
# Copyright 2014-2020 Marc S. Boxberg (RWTH Aachen University, GER)
#
# This file is part of NEXD 2D.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NEXD 2D. If not, see <http://www.gnu.org/licenses/>.
#-----------------------------------------------------------------------
# General definitions
#
# Paths
#
bindir = ./bin
obsdir = ./obj
moduledir = ./mod
srcdir = ./src
AR = ar
# Choose your compiler:
F95 = mpif90
#F95 = mpiifort
ifeq ($(notdir $(F95)),g95)
FFLAGS = -O3 -Wunused -fmod=$(moduledir)
else ifeq ($(F95),mpif90)
# ==================================================================
# GFORTRAN COMPILER
# ==================================================================
# Choose a suitable set of compiler flags for gfortran. The default
# flags are explained in the following...
# required:
# -J$(moduledir)
# -fimplicit-none
# -ffixed-line-length-none
# -ffree-line-length-none
# optional:
# -O3 : The compiler tries to optimize the code to
# make it faster. Level 3 is the most
# optimization available.
# -Og : Enables optimizations that do not interfere
# with debugging. It should be the
# optimization level of choice for the
# standard edit-compile-debug cycle.
# -funroll-all-loops : This might increase the speed of the code
# as well.
# -fbounds-check : Add a check that the array index is within
# the bounds of the array every time an array
# element is accessed.
# This substantially slows down a program
# using it, but is a very useful way to find
# bugs related to arrays.
# -fbacktrace : If the program crashes, a backtrace will be
# produced if possible.
# -Wall : gfortran will generate warnings about many
# common sources of bugs.
# -Wpedantic : Generate warnings about language features
# that are supported by gfortran but are not
# part of the official Fortran 95 standard.
# -Wextra : This enables some extra warning flags that
# are not enabled by -Wall. Note,
# -Wunused-parameter (part of -Wextra) has a
# problem to correctly work with constants.h.
# recommended flags for developers:
# FFLAGS = -Og -J$(moduledir) -fimplicit-none -ffixed-line-length-none -ffree-line-length-none -fbounds-check -fbacktrace -Wall -Wpedantic -Wextra
# recommended flags for profiling (CP CP):
# FFLAGS = -O3 -J$(moduledir) -fimplicit-none -ffixed-line-length-none -ffree-line-length-none -funroll-all-loops -pg -g -no-pie
# recommended flags for users:
FFLAGS = -O3 -J$(moduledir) -fimplicit-none -ffixed-line-length-none -ffree-line-length-none -funroll-all-loops
else ifeq ($(F95),mpiifort)
# ==================================================================
# INTEL COMPILER (ifort)
# ==================================================================
# Choose a suitable set of compiler flags for ifort. The default
# flags are explained in the following...
# required:
# -module $(moduledir)
# -implicitnone
# -132
# optional:
# -O3 : The compiler tries to optimize the code to
# make it faster. Level 3 is the most
# optimization available. Level 0 (-O0) is
# recommended for developers.
# -funroll-loops : This might increase the speed of the code
# as well.
# -nowarn : Suppresses all warnings.
# developers:
# FFLAGS = -O0 -module $(moduledir) -implicitnone -132
# users:
FFLAGS = -O3 -module $(moduledir) -implicitnone -132 -funroll-loops -nowarn
endif
obj_prog = program_dg2d.o \
constantsMod.o \
parameterMod.o \
gllMod.o \
warpfactorMod.o \
nodesMod.o \
triTrafoMod.o \
jacobiMod.o \
simplexMod.o \
vandermondeMod.o \
dmatricesMod.o \
geometricFactorsMod.o \
rosettaGammaMod.o \
meshMod.o \
plotMod.o \
liftMod.o \
derMod.o \
normalsMod.o \
timeloopMod.o \
matrixMod.o \
waveMod.o \
dtMod.o \
stfMod.o \
sourceReceiverMod.o \
triangleNeighborMod.o \
externalModelMod.o \
mpiMod.o\
fileunitMod.o\
fileParameterMod.o\
logoMod.o\
pmlMod.o \
errorMessage.o \
realloc.o \
materialsMod.o
obj_mesher = program_mesher.o \
constantsMod.o \
parameterMod.o \
gllMod.o \
warpfactorMod.o \
nodesMod.o \
triTrafoMod.o \
vtkMod.o \
jacobiMod.o \
simplexMod.o \
vandermondeMod.o \
dmatricesMod.o \
geometricFactorsMod.o \
rosettaGammaMod.o \
meshMod.o \
plotMod.o \
liftMod.o \
derMod.o \
normalsMod.o \
matrixMod.o \
dtMod.o \
stfMod.o \
sourceReceiverMod.o \
triangleNeighborMod.o\
externalModelMod.o \
linearSystemMod.o \
fileunitMod.o \
logoMod.o\
fileParameterMod.o \
errorMessage.o \
realloc.o \
materialsMod.o \
progressbarMod.o \
slipInterfaceMod.o \
rhsSlipInterface.o \
mpiMod.o \
waveMod.o
obj_solver = program_solver.o \
mpiincludeMod.o \
constantsMod.o \
parameterMod.o \
gllMod.o \
warpfactorMod.o \
nodesMod.o \
triTrafoMod.o \
vtkMod.o \
jacobiMod.o \
simplexMod.o \
vandermondeMod.o \
dmatricesMod.o \
geometricFactorsMod.o \
rosettaGammaMod.o \
meshMod.o \
plotMod.o \
liftMod.o \
derMod.o \
normalsMod.o \
timeloopMod.o \
matrixMod.o \
waveMod.o \
dtMod.o \
stfMod.o \
sourceReceiverMod.o \
triangleNeighborMod.o \
externalModelMod.o \
mpiMod.o \
linearSystemMod.o \
fileunitMod.o \
fileParameterMod.o\
logoMod.o\
pmlMod.o \
errorMessage.o \
realloc.o \
materialsMod.o \
progressbarMod.o \
slipInterfaceMod.o \
rhsSlipInterface.o \
rhsElasticMod.o \
riemannFluxLsiMod.o \
timestampMod.o \
calendar.o \
convert_time.o \
adjointMod.o \
timeSeries.o\
dateTime.o\
recursiveFilterCoefficients.o\
fourierTransform.o\
realloc.o\
filterCoefficientsDecimate.o\
timeUtils.o\
collectMovieMod.o \
mathConstants.o
obj_movie = program_movie.o \
constantsMod.o \
parameterMod.o \
collectMovieMod.o \
vtkMod.o \
gllMod.o \
warpfactorMod.o \
nodesMod.o \
triTrafoMod.o \
jacobiMod.o \
simplexMod.o \
vandermondeMod.o \
dmatricesMod.o \
geometricFactorsMod.o \
rosettaGammaMod.o \
meshMod.o \
plotMod.o \
normalsMod.o \
matrixMod.o \
dtMod.o \
liftMod.o \
sourceReceiverMod.o \
triangleNeighborMod.o \
externalModelMod.o \
linearSystemMod.o \
fileunitMod.o \
logoMod.o\
fileParameterMod.o \
errorMessage.o \
realloc.o \
materialsMod.o \
progressbarMod.o \
slipInterfaceMod.o \
rhsSlipInterface.o \
waveMod.o
#-------------------------------------------------------
# Direcory search
#
vpath %.o $(obsdir)
vpath %.f90 $(srcdir) $(srcdir)/include
vpath %.f $(srcdir) $(srcdir)/include
vpath %.c $(srcdir) $(srcdir)/include
#--------------------------------------------------------
# additional directories to be searched for module or include dependencies
# default is search in ./ only
#
DEPDIRS = $(srcdir) $(srcdir)/include
#-------------------------------------------------------
# Implicit rule to compile .o files from .f90 files.
# Because of vpath, targets and dependencies need not be
# in the current directory.
#
%.o: %.f90
$(F95) -c $(FFLAGS) $< -o $(obsdir)/$@
%.o: %.f
$(F95) -c $(FFLAGS) -fimplicit-none -ffixed-line-length-132 $< -o $(obsdir)/$@
%.o: %.c
gcc -c $(CFLAGS) $< -o $(obsdir)/$@
#--------------------------------------------------------------
# Object string for linking:
# Adds object dir as prefix and removes directory part
# of $^ (all dependencies)
#
obstring = $(addprefix $(obsdir)/,$(notdir $^))
obstringtest = $(addprefix $(obsdir)/,$(notdir $^))
#
# End of generic part of Makefile
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# Library paths
# (specify the path to your METIS library here!)
#
la = -llapack -lblas
lib = metis-4.0.3/libmetis.a
#---------------------------------------------------------
.PHONY: all
#
# create dependencies on modules
# make.incdep is a Makefile because it is included. Such files are first updated
# before anything else and make starts from anew including all updated makefiles
#
make.incdep:
./tools/scripts/makeDepFromUseInclude.py $(DEPDIRS) > $@
-include make.incdep
#
# Targets
#
all: required mesher solver movie
allclean :
rm -f $(bindir)/mesher $(bindir)/movie $(moduledir)/*.mod $(obsdir)/*.o out/* make.incdep
clean :
rm -f $(bindir)/solver $(bindir)/mesher $(bindir)/movie $(moduledir)/*.mod $(obsdir)/*.o make.incdep
dg2d: $(obj_prog)
$(F95) $(FFLAGS) -o $(bindir)/$@ $(obstring) $(pgplot) $(la) $(lib)
mesher: $(obj_mesher)
$(F95) $(FFLAGS) -o $(bindir)/$@ $(obstring) $(pgplot) $(la) $(lib)
solver: $(obj_solver)
$(F95) $(FFLAGS) -o $(bindir)/$@ $(obstring) $(pgplot) $(la) $(lib)
movie: $(obj_movie)
$(F95) $(FFLAGS) -o $(bindir)/$@ $(obstring) $(pgplot) $(la) $(lib)
bin:
mkdir -p $(bindir)
mod:
mkdir -p $(moduledir)
obj:
mkdir -p $(obsdir)
required: mod obj bin