-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
136 lines (116 loc) · 5.26 KB
/
Makefile
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
#### IFORT ####
ifc=ifort
iflags=-fast -O3 -implicitnone -r8 -qopenmp -parallel -heap-arrays 200 -ansi-alias -qopt-jump-tables='large' -xcore-avx2
#iflags=-fast -O3 -implicitnone -r8 -heap-arrays 200 -ansi-alias -qopt-jump-tables='large' -xcore-avx2
iflagsdbg=-traceback -init=snan,arrays -O0 -warn all -implicitnone -r8 -check bounds -g -fpe0 #-pg
iflagsprof=-traceback -O3 -implicitnone -r8 -g -debug inline-debug-info -parallel-source-info=2 -qopenmp -xcore-avx2 #-pg
#### GFORTRAN ####
gfc=gfortran-7
gflags=-O2 -ffree-form -fimplicit-none -fopenmp #-fmax-stack-var-size=4096
gflagsdbg=-fbacktrace -O0 -ffree-form -Wall -Wextra -Wimplicit-interface -Wunused-parameter -Wline-truncation -Wcharacter-truncation -Wsurprising -Waliasing -fimplicit-none -fcheck=all -g -ffpe-trap=invalid,zero
objpath=./obj
resultspath=./Results
all:
make run
init:
mkdir -p Results
mkdir -p obj
lib:
reset
@$(ifc) $(iflags) -c mymathlib.f90 -module $(objpath) -o $(objpath)/mymathlib.o
@$(ifc) $(iflags) -c vf_classdef.f90 -module $(objpath) -o $(objpath)/vf_classdef.o
@$(ifc) $(iflags) -c vr_classdef.f90 -module $(objpath) -o $(objpath)/vr_classdef.o
@$(ifc) $(iflags) -c wingpanel_classdef.f90 -module $(objpath) -o $(objpath)/wingpanel_classdef.o
@$(ifc) $(iflags) -c wakepanel_classdef.f90 -module $(objpath) -o $(objpath)/wakepanel_classdef.o
@$(ifc) $(iflags) -c library.f90 -module $(objpath) -o $(objpath)/library.o
@$(ifc) $(iflags) -c postproc.f90 -module $(objpath) -o $(objpath)/postproc.o
lib_dbg:
reset
@$(ifc) $(iflagsdbg) -c mymathlib.f90 -module $(objpath) -o $(objpath)/mymathlib.o
@$(ifc) $(iflagsdbg) -c vf_classdef.f90 -module $(objpath) -o $(objpath)/vf_classdef.o
@$(ifc) $(iflagsdbg) -c vr_classdef.f90 -module $(objpath) -o $(objpath)/vr_classdef.o
@$(ifc) $(iflagsdbg) -c wingpanel_classdef.f90 -module $(objpath) -o $(objpath)/wingpanel_classdef.o
@$(ifc) $(iflagsdbg) -c wakepanel_classdef.f90 -module $(objpath) -o $(objpath)/wakepanel_classdef.o
@$(ifc) $(iflagsdbg) -c library.f90 -module $(objpath) -o $(objpath)/library.o
@$(ifc) $(iflagsdbg) -c postproc.f90 -module $(objpath) -o $(objpath)/postproc.o
lib_prof:
reset
@$(ifc) $(iflagsprof) -c mymathlib.f90 -module $(objpath) -o $(objpath)/mymathlib.o
@$(ifc) $(iflagsprof) -c vf_classdef.f90 -module $(objpath) -o $(objpath)/vf_classdef.o
@$(ifc) $(iflagsprof) -c vr_classdef.f90 -module $(objpath) -o $(objpath)/vr_classdef.o
@$(ifc) $(iflagsprof) -c wingpanel_classdef.f90 -module $(objpath) -o $(objpath)/wingpanel_classdef.o
@$(ifc) $(iflagsprof) -c wakepanel_classdef.f90 -module $(objpath) -o $(objpath)/wakepanel_classdef.o
@$(ifc) $(iflagsprof) -c library.f90 -module $(objpath) -o $(objpath)/library.o
@$(ifc) $(iflagsprof) -c postproc.f90 -module $(objpath) -o $(objpath)/postproc.o
run:
reset
make fileclean
make init
make lib
@$(ifc) -I$(objpath) $(iflags) main.f90 $(objpath)/*.o -o main.out
@time -f " run time: %e" ./main.out
run_dbg:
reset
make fileclean
make init
make lib_dbg
@$(ifc) -I$(objpath) $(iflagsdbg) main.f90 $(objpath)/*.o -o main.out
@time -f " run time: %e" ./main.out
run_prof:
reset
make fileclean
make init
make lib_prof
@$(ifc) -I$(objpath) $(iflagsprof) main.f90 $(objpath)/*.o -o main.out
trial:
reset
make lib
$(ifc) -I$(objpath) $(iflags) trial.f90 $(objpath)/*.o -o trial.out
@./trial.out
# Gfortran part
glib_dbg:
reset
@$(gfc) $(gflagsdbg) -c mymathlib.f90 -J$(objpath) -o $(objpath)/mymathlib.o
@$(gfc) $(gflagsdbg) -c vf_classdef.f90 -J$(objpath) -o $(objpath)/vf_classdef.o
@$(gfc) $(gflagsdbg) -c vr_classdef.f90 -J$(objpath) -o $(objpath)/vr_classdef.o
@$(gfc) $(gflagsdbg) -c wingpanel_classdef.f90 -J$(objpath) -o $(objpath)/wingpanel_classdef.o
@$(gfc) $(gflagsdbg) -c wakepanel_classdef.f90 -J$(objpath) -o $(objpath)/wakepanel_classdef.o
@$(gfc) $(gflagsdbg) -c library.f90 -J$(objpath) -o $(objpath)/library.o
@$(gfc) $(gflagsdbg) -c postproc.f90 -J$(objpath) -o $(objpath)/postproc.o
glib:
reset
@$(gfc) $(gflags) -c mymathlib.f90 -J$(objpath) -o $(objpath)/mymathlib.o
@$(gfc) $(gflags) -c vf_classdef.f90 -J$(objpath) -o $(objpath)/vf_classdef.o
@$(gfc) $(gflags) -c vr_classdef.f90 -J$(objpath) -o $(objpath)/vr_classdef.o
@$(gfc) $(gflags) -c wingpanel_classdef.f90 -J$(objpath) -o $(objpath)/wingpanel_classdef.o
@$(gfc) $(gflags) -c wakepanel_classdef.f90 -J$(objpath) -o $(objpath)/wakepanel_classdef.o
@$(gfc) $(gflags) -c library.f90 -J$(objpath) -o $(objpath)/library.o
@$(gfc) $(gflags) -c postproc.f90 -J$(objpath) -o $(objpath)/postproc.o
grun:
reset
make fileclean
make init
make glib
@$(gfc) -I$(objpath) $(gflags) main.f90 $(objpath)/*.o -o main.out
@time -f " Run time: %E" ./main.out
#./main.out
grun_dbg:
reset
make fileclean
make init
make glib_dbg
@$(gfc) -I$(objpath) $(gflagsdbg) main.f90 $(objpath)/*.o -o main.out
@time -f " Run time: %E" ./main.out
#./main.out
gtrial:
reset
make init
make glib
$(gfc) -I$(objpath) $(gflags) trial.f90 $(objpath)/*.o -o trial.out
@./trial.out
clean:
-rm $(objpath)/*.o $(objpath)/*.mod *.out
-rm visitlog.py
fileclean:
-rm $(resultspath)/*.tec
-rm $(resultspath)/*.curve