-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile.example_linux
executable file
·593 lines (519 loc) · 14.8 KB
/
Makefile.example_linux
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
##########################################################################
# #
# WINNET Makefile example #
# #
# >>> : modify in places marked by '>>>' to fit your system / req's #
##########################################################################
#>>> Path to Intel MKL library
# If the compiler libraries were sourced before, the following
# line can be an arbitrary path.
MKL_DIR = /opt/intel/mkl
#>>> Machine architecture
ARCH = 64
# In the following you have to give a compiler
# A common problem is that anaconda is overwriting the
# link to the hdf5 compiler (for example h5fc). This you can figure
# out by typing "which h5fc" in the terminal. If the path leads to
# an anaconda folder, you can give a full path to the correct
# h5fc executable. You can see all known h5fc instances by typing
# "whereis h5fc" in the terminal.
# This will show all h5fc instances that are included in the PATH variable.
# You can take the correct one and fill the full path for "FC" in the lines
# below.
#>>> Compiler and linker: ifort, ifx, h5fc, h5pfc, or gfortran so far
FC = ifort
# FC = ifx
# FC = h5fc
# FC = h5pfc
# FC = gfortran
LD = $(FC)
FCCOM = $(notdir $(FC))
# Get the git Version
GIT_TAG:="$(shell git describe --abbrev=0 --tags --always)"
GIT_HASH:="$(shell git describe --abbrev=10 --always)"
# Check if the compiler is able to deal with hdf5 files
# So far h5fc and h5pfc are supported
ifneq ($(filter $(FCCOM),h5fc h5pfc),)
# Check underlying compiler as h5fc and h5pfc are just wrappers around
# gfortran or ifort
fccompiler:= $(shell $(FC) -show | awk {'print $1'})
fccompiler:= $(firstword $(fccompiler))
FCCOM = $(firstword $(notdir $(fccompiler)))
# Check if the underlying compiler is a wrapper again
# e.g., mpiifort. The following will give you the error status
# of the command (e.g., != 0 for ifort)
estatus:= $(shell $(fccompiler) -show > /dev/null 2>&1 ; echo $$?)
# Print the result
# $(info $$estatus is [${estatus}])
# Then do it again in case you got a wrapper
ifeq ($(estatus),0)
fccompiler:= $(shell $(fccompiler) -show | awk {'print $1'})
fccompiler:= $(firstword $(fccompiler))
FCCOM = $(firstword $(notdir $(fccompiler)))
endif
# Add the hdf5 use statement for the network
FFLAGS = -DUSE_HDF5
# Recognize that hdf5 was used
hdf5 = true
else
# Not able to use hdf5, dont add anything
FFLAGS =
# Recognize that hdf5 was not used
hdf5 = false
endif
# Check if it is an intel compiler, either ifort or ifx
ifeq ($(FCCOM),$(filter $(FCCOM),ifort ifx))
#>>> Compiler flags: paranoid warning system
# FFLAGS += -cpp -r8 -align -O0 -Warn all -fpe0 -check all -g -traceback -qopenmp -fp-stack-check -extend-source -heap-arrays -init=snan,arrays -DGHASH=$(GIT_HASH) -DGTAG=$(GIT_TAG)
#>>> .. vs more relaxed version
FFLAGS += -cpp -r8 -align -O3 -w -g -parallel -traceback -qopenmp -heap-arrays -DGHASH=$(GIT_HASH) -DGTAG=$(GIT_TAG)
# Mac OS X user should further add -fp-stack-check -Wl,-stack_size,0x40000000,-stack_addr,0xf0000000
# since the stack limit of mac can't be changed with ulimit -s unlimited. The above line will increase the stack limit to 1GB on Mac
else ifeq ($(FCCOM),gfortran)
#>>> Compiler flags: paranoid warning system
# FFLAGS += -cpp -fdefault-double-8 -fdefault-real-8 -O0 -ffixed-line-length-none -ffree-line-length-none -Wall -fbacktrace -fopenmp -g -fcheck=all
#>>> .. vs more relaxed version
FFLAGS += -cpp -fdefault-double-8 -fdefault-real-8 -O3 -fimplicit-none -ffixed-line-length-none -ffree-line-length-none -fbacktrace -fopenmp
else
$(error Unsupported compiler: $(FCCOM))
endif
LDFLAGS = $(FFLAGS)
#>>> Linker flags
# the right paths
WINNET = $(PWD)
BIN_PATH = $(WINNET)/bin
OBJ_PATH = $(WINNET)/obj
SOURCE_PATH = $(WINNET)/src
TOOL_PATH = $(WINNET)/src/external_tools
EOS_PATH = $(WINNET)/src/eostable_ls_timmes
NUTH_PATH = $(WINNET)/src/thermal_neutrinos
MKL_INC = $(MKL_DIR)/include
VPATH = .
VPATH += $(OBJ_PATH)
VPATH += $(SOURCE_PATH)
VPATH += $(EOS_PATH)
VPATH += $(TOOL_PATH)
VPATH += $(MKL_INC)
VPATH += $(NUTH_PATH)
ifeq ($(FCCOM),$(filter $(FCCOM),ifort ifx))
FFLAGS += -module $(OBJ_PATH)
else
FFLAGS += -J$(OBJ_PATH)
endif
FFLAGS += -I$(OBJ_PATH) -I$(MKL_INC)
ifeq ($(ARCH),32)
MKL_LIB = $(MKL_DIR)/lib/32
FPATH = -L$(MKL_LIB) -I$(MKL_INC)
#>>> MKL libraries to link agains; may differ in more recent versions
FLIBS = -lmkl_solver_sequential -lmkl_intel -lmkl_sequential \
-lmkl_core -lpthread
else
MKL_LIB = $(MKL_DIR)/lib/em64t
FPATH = -L$(MKL_LIB) -I$(MKL_INC)
#>>> Check that these are correct MKL libraries
FLIBS = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5
endif
# the main target
PROG = winnet
# the source and object files of the project
SRCS = error_msg_class.f90
SRCS += timestep_module.f90
SRCS += file_handling_class.f90
SRCS += parameter_class.f90
SRCS += global_class.f90
SRCS += format_class.f90
SRCS += alpha_decay_rate_module.f90
SRCS += gear_module.f90
SRCS += inter_module.f90
SRCS += fsolve.f90
SRCS += ls_timmes_eos_module.f
SRCS += timmes_eos_module.f
SRCS += thermal_neutrino_module.f90
SRCS += units_module.f
SRCS += benam_class.f90
SRCS += mergesort_module.f90
SRCS += reaclib_rate_module.f90
SRCS += flow_module.f90
SRCS += nuflux_class.f90
SRCS += detailed_balance.f90
SRCS += network_init_module.f90
SRCS += beta_decay_rate_module.f90
SRCS += nucstuff_class.f90
SRCS += tabulated_rate_module.f90
SRCS += fission_rate_module.f90
SRCS += hdf5_module.f90
SRCS += tw_rate_module.f90
SRCS += screening_module.f90
SRCS += chem_pot.f90
SRCS += effphase_class.f90
SRCS += expansion_module.f90
SRCS += analysis.f90
SRCS += nuclear_heating.f90
SRCS += quadpack_module.f90
SRCS += jacobian_class.f90
SRCS += pardiso_class.f90
SRCS += winnse_module.f90
SRCS += parser_module.f90
SRCS += single_zone_vars.f90
SRCS += readini.f90
SRCS += driver.f90
OBJS = error_msg_class.o
OBJS += timestep_module.o
OBJS += file_handling_class.o
OBJS += parameter_class.o
OBJS += global_class.o
OBJS += alpha_decay_rate_module.o
OBJS += format_class.o
OBJS += gear_module.o
OBJS += inter_module.o
OBJS += ls_timmes_eos_module.o
OBJS += timmes_eos_module.o
OBJS += thermal_neutrino_module.o
OBJS += units_module.o
OBJS += benam_class.o
OBJS += tabulated_rate_module.o
OBJS += detailed_balance.o
OBJS += tw_rate_module.o
OBJS += fission_rate_module.o
OBJS += reaclib_rate_module.o
OBJS += beta_decay_rate_module.o
OBJS += mergesort_module.o
OBJS += flow_module.o
OBJS += fsolve.o
OBJS += parser_module.o
OBJS += nuflux_class.o
OBJS += network_init_module.o
OBJS += hdf5_module.o
OBJS += nucstuff_class.o
OBJS += screening_module.o
OBJS += chem_pot.o
OBJS += effphase_class.o
OBJS += expansion_module.o
OBJS += analysis.o
OBJS += nuclear_heating.o
OBJS += quadpack_module.o
OBJS += pardiso_class.o
OBJS += jacobian_class.o
OBJS += winnse_module.o
OBJS += hydro_trajectory.o
OBJS += single_zone_vars.o
OBJS += readini.o
OBJS += driver.o
TESTS = neutron-decay
TESTS += neutron-decay-implicit-euler
TESTS += ni56-decay
TESTS += read_seeds
TESTS += read_trajectory
TESTS += gamma_eq
TESTS += detailed_balance
TESTS += beta_eq
TESTS += emission_eq
TESTS += absorption_eq
TESTS += alpha_network
TESTS += alpha_decay
TESTS += analytic_mode
TESTS += nse
TESTS += read_neutrino
TESTS += switch_evolution
TESTS += expand
TESTS += tabulated_rates
TESTS += tabulated_rates_custom_grid
TESTS += ulimit
TESTS += tw_rate
TESTS += screening
TESTS += beta_decay_format
TESTS += fissrate_bdel
TESTS += fissfrag_kodtak
TESTS += fissfrag_panov
TESTS += fissfrag_mumpower
TESTS += fissfrag_custom
TESTS += fissfrag_kodtak_n_emission
TESTS += fissfrag_panov_n_emission
TESTS += fissfrag_mumpower_n_emission
TESTS += neutral-current_reaction
TESTS += charged-current_reaction
TESTS += nc_cc_reaction
TESTS += prepared_network
# Physical reference cases
TESTS += bigbang
# Hdf5 test, only when hdf5 compiler was used
ifeq ($(hdf5),true)
TESTS += hdf5_format
endif
$(BIN_PATH)/$(PROG): $(OBJ_PATH) $(BIN_PATH) $(OBJS) $(SRCS)
cd $(OBJ_PATH) && \
$(LD) $(LDFLAGS) -o $(BIN_PATH)/$(PROG) $(OBJS) -I$(OBJ_PATH) $(FPATH) $(FLIBS)
$(OBJ_PATH):
mkdir -p $(OBJ_PATH)
$(BIN_PATH):
mkdir -p $(BIN_PATH)
# the targets
all: $(BIN_PATH)/$(PROG)
# UNIX one-liner to automatically list module dependencies:
# $ grep -i '^ *use' file_handling_class.f90 | sed 's/,//' | awk '{printf ("%s.o\n", $2) }'|sort|uniq
file_handling_class.o :\
error_msg_class.o
parameter_class.o :\
error_msg_class.o \
file_handling_class.o
chem_pot.o :\
parameter_class.o \
error_msg_class.o \
file_handling_class.o
parser_module.o :\
parameter_class.o
network_init_module.o :\
format_class.o \
analysis.o \
benam_class.o \
expansion_module.o \
file_handling_class.o \
beta_decay_rate_module.o \
thermal_neutrino_module.o \
alpha_decay_rate_module.o \
error_msg_class.o \
winnse_module.o \
flow_module.o \
detailed_balance.o \
format_class.o \
gear_module.o \
global_class.o \
hydro_trajectory.o \
ls_timmes_eos_module.o \
screening_module.o \
fission_rate_module.o \
mergesort_module.o \
inter_module.o \
tw_rate_module.o \
reaclib_rate_module.o \
tabulated_rate_module.o \
nuclear_heating.o \
nucstuff_class.o \
nuflux_class.o \
parameter_class.o \
pardiso_class.o \
readini.o \
parser_module.o \
single_zone_vars.o
alpha_decay_rate_module.o :\
parameter_class.o \
benam_class.o \
error_msg_class.o \
global_class.o
detailed_balance.o :\
global_class.o \
error_msg_class.o \
benam_class.o \
reaclib_rate_module.o
beta_decay_rate_module.o :\
global_class.o \
file_handling_class.o \
error_msg_class.o \
mergesort_module.o \
parameter_class.o \
benam_class.o
hdf5_module.o :\
global_class.o \
error_msg_class.o \
parameter_class.o
tw_rate_module.o :\
parameter_class.o \
benam_class.o \
mergesort_module.o \
effphase_class.o \
inter_module.o \
global_class.o \
error_msg_class.o
fission_rate_module.o :\
parameter_class.o \
file_handling_class.o \
nucstuff_class.o \
benam_class.o \
mergesort_module.o \
tabulated_rate_module.o \
format_class.o \
global_class.o \
error_msg_class.o
reaclib_rate_module.o :\
parameter_class.o \
global_class.o \
file_handling_class.o \
nucstuff_class.o \
error_msg_class.o \
mergesort_module.o \
format_class.o \
benam_class.o
tabulated_rate_module.o :\
parameter_class.o \
global_class.o \
file_handling_class.o \
reaclib_rate_module.o \
benam_class.o \
format_class.o \
error_msg_class.o \
mergesort_module.o
benam_class.o :\
file_handling_class.o \
error_msg_class.o \
nucstuff_class.o \
format_class.o \
global_class.o \
parameter_class.o
timmes_eos_module.o :\
const.dek \
eosfxt.f \
implno.dek \
vector_eos.dek
ls_timmes_eos_module.o :\
timmes_eos_module.o \
units_module.o
effphase_class.o :\
parameter_class.o \
file_handling_class.o \
global_class.o
expansion_module.o :\
parameter_class.o \
ls_timmes_eos_module.o \
hydro_trajectory.o \
file_handling_class.o
gear_module.o :\
error_msg_class.o \
parameter_class.o \
global_class.o
jacobian_class.o :\
parameter_class.o \
benam_class.o \
nucstuff_class.o \
nuclear_heating.o \
effphase_class.o \
error_msg_class.o \
nuflux_class.o \
screening_module.o \
reaclib_rate_module.o \
fission_rate_module.o \
tabulated_rate_module.o \
tw_rate_module.o \
gear_module.o \
global_class.o \
inter_module.o \
pardiso_class.o
nuclear_heating.o :\
parameter_class.o \
ls_timmes_eos_module.o \
nucstuff_class.o \
expansion_module.o \
thermal_neutrino_module.o \
file_handling_class.o \
single_zone_vars.o
thermal_neutrino_module.o :\
parameter_class.o
nucstuff_class.o :\
parameter_class.o \
error_msg_class.o \
global_class.o
nuflux_class.o :\
parameter_class.o \
hydro_trajectory.o \
mergesort_module.o \
file_handling_class.o \
benam_class.o \
inter_module.o \
parser_module.o \
global_class.o
pardiso_class.o :\
parameter_class.o \
reaclib_rate_module.o \
fission_rate_module.o \
global_class.o
screening_module.o :\
error_msg_class.o \
parameter_class.o \
global_class.o
timestep_module.o :\
parameter_class.o \
global_class.o \
hydro_trajectory.o \
error_msg_class.o \
gear_module.o \
inter_module.o \
expansion_module.o \
single_zone_vars.o \
nucstuff_class.o \
analysis.o \
winnse_module.o \
network_init_module.o \
parser_module.o \
nuclear_heating.o \
readini.o \
jacobian_class.o
analysis.o :\
parameter_class.o \
global_class.o \
fission_rate_module.o \
mergesort_module.o \
tw_rate_module.o \
file_handling_class.o \
ls_timmes_eos_module.o \
benam_class.o \
hdf5_module.o \
flow_module.o \
reaclib_rate_module.o \
nucstuff_class.o \
nuclear_heating.o
flow_module.o :\
global_class.o \
pardiso_class.o \
error_msg_class.o \
file_handling_class.o
readini.o :\
parameter_class.o \
global_class.o \
file_handling_class.o \
analysis.o \
benam_class.o \
nuflux_class.o \
hydro_trajectory.o \
error_msg_class.o
winnse_module.o :\
parameter_class.o \
global_class.o \
screening_module.o \
nucstuff_class.o
mergesort_module.o :\
parameter_class.o \
error_msg_class.o \
global_class.o \
file_handling_class.o
inter_module.o :\
parameter_class.o \
error_msg_class.o
driver.o :\
parameter_class.o \
global_class.o \
readini.o \
error_msg_class.o \
nucstuff_class.o \
network_init_module.o \
expansion_module.o \
mergesort_module.o \
hydro_trajectory.o \
winnse_module.o \
hdf5_module.o \
nuclear_heating.o \
single_zone_vars.o \
timestep_module.o
%.o: %.mod
doc:
doxygen doc/doxygen/config.dox
rm -f doc/documentation.html
ln -s html/index.html doc/documentation.html
tests:
@bin/run_tests.py $(TESTS) --keep
.SUFFIXES: .f90 .f .o
.f90.o:
$(FC) $(FFLAGS) -c $< -o $(OBJ_PATH)/$*.o
.f.o:
$(FC) $(FFLAGS) -c $< -o $(OBJ_PATH)/$*.o
clean:
rm -rf $(BIN_PATH)/$(PROG) $(OBJS) $(OBJ_PATH)/*
.PHONY: clean all doc tests