-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile_gmsh
166 lines (131 loc) · 3.82 KB
/
makefile_gmsh
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
HOST = osx-gcc
#HOST = linux-gcc
#HOST = linux-gcc-openmp
HOST = osx-gcc-openmp
#HOST = osx-intel
#HOST = osx-intel-openmp
#HOST = linux-gfortran
#HOST = linux-gfortran-openmp
#HOST = amd-gfortran
#HOST = amd-gfortran-openmp
#HOST = linux-intel
#HOST = linux-intel-openmp
PROJECT = int2
GFORT = gfortran
ifeq ($(HOST),osx-gcc)
FC = $(GFORT)
FFLAGS = -O2 -g -w -fdefault-integer-8 -finteger-4-integer-8 \
-fdefault-double-8 -fdefault-real-8 -freal-4-real-8 -std=legacy
FLINK = $(GFORT) -w -fdefault-integer-8 -finteger-4-integer-8 \
-fdefault-double-8 -fdefault-real-8 -freal-4-real-8 -std=legacy \
-o $(PROJECT) -framework accelerate
endif
ifeq ($(HOST),osx-gcc-openmp)
FC = $(GFORT)
FFLAGS = -O2 -fopenmp -w -std=legacy -finteger-4-integer-8 -fdefault-integer-8 -ffpe-trap=invalid
FLINK = $(GFORT) -fopenmp -w -finteger-4-integer-8 -fdefault-integer-8 \
-Wl,-stack_size,0x80000000 -std=legacy -o $(PROJECT) -framework accelerate
endif
ifeq ($(HOST),osx-intel-openmp)
FC = ifort
FFLAGS = -i8 -r8 -O2 -w -qopenmp
FLINK = ifort -i8 -r8 -w -mkl=parallel -qopenmp \
-Wl,-stack_size,0x40000000 -o $(PROJECT)
export OMP_STACKSIZE=2048M
endif
ifeq ($(HOST),osx-intel)
FC = ifort
FFLAGS = -i8 -r8 -O2 -w
FLINK = ifort -i8 -r8 -w -mkl -o $(PROJECT)
endif
ifeq ($(HOST),linux-intel-openmp)
FC = ifort
FFLAGS = -i8 -r8 -O2 -w -qopenmp -xHost
FLINK = ifort -i8 -r8 -w -mkl=parallel -qopenmp -o $(PROJECT)
endif
ifeq ($(HOST),linux-gcc)
FC = gfortran
FFLAGS = -O2 -g -w -fdefault-integer-8 -finteger-4-integer-8
FLINK = gfortran -g -w -fdefault-integer-8 -finteger-4-integer-8 \
-o $(PROJECT) -llapack -lblas
endif
ifeq ($(HOST),linux-gcc-openmp)
FC = gfortran
FFLAGS = -O2 -std=legacy -w --openmp -fdefault-integer-8 -finteger-4-integer-8
FLINK = gfortran --openmp -fdefault-integer-8 -finteger-4-integer-8 \
-w -o $(PROJECT) -llapack -lblas
endif
.PHONY: all clean list
TFMM3D = lib/tfmm3dlr
SRC = src
EXM = examples
MOD_SOURCES = $(SRC)/Mod_TreeLRD.f90 \
$(SRC)/ModType_Smooth_Surface.f90 \
$(SRC)/Mod_Fast_Sigma.f90 \
$(SRC)/chebtarggridrouts.f90 \
$(SRC)/Mod_Plot_Tools_sigma.f90 \
$(SRC)/Mod_Feval.f90 \
$(SRC)/Mod_Smooth_Surface.f90
SOURCES = $(EXM)/test_surfsmooth_gmsh.f90 \
$(SRC)/koornexps.f90 \
$(SRC)/ortho2eva.f \
$(SRC)/ortho2eva_new.f90 \
$(SRC)/ortho2exps.f \
$(SRC)/orthom.f \
$(SRC)/cisurf_loadmsh.f90 \
$(SRC)/cisurf_skeleton.f90 \
$(SRC)/cisurf_plottools.f90 \
$(SRC)/cisurf_tritools.f90 \
$(SRC)/lapack_wrap.f90 \
$(SRC)/pplot2.f \
$(TFMM3D)/tfmm3dlr_expout.f \
$(TFMM3D)/tfmm3dlrwrap_expout.f \
$(TFMM3D)/l3dzero.f \
$(TFMM3D)/treeplot.f \
$(TFMM3D)/prini.f \
$(TFMM3D)/l3dterms.f \
$(TFMM3D)/laprouts3d.f \
$(TFMM3D)/nearfield.f90 \
$(TFMM3D)/l3dmpmpfinal4.f \
$(TFMM3D)/l3dloclocfinal4.f \
$(TFMM3D)/l3dmplocfinal4.f \
$(TFMM3D)/prinm.f \
$(TFMM3D)/yrecursion.f \
$(TFMM3D)/ftophys.f \
$(TFMM3D)/phystof2.f \
$(TFMM3D)/legeexps.f \
$(TFMM3D)/tree_lr_3d.f \
$(TFMM3D)/rotgen.f \
$(TFMM3D)/numthetafour.f \
$(TFMM3D)/numthetahalf2.f \
$(TFMM3D)/lapweights.f \
$(TFMM3D)/pwrouts2.f \
$(TFMM3D)/hkrand.f \
$(TFMM3D)/dlaran.f \
$(TFMM3D)/rotviarecur3.f \
$(TFMM3D)/rotgen2.f \
$(TFMM3D)/l3dgqbxauxrouts2.f \
$(TFMM3D)/lwtsexp_sep2.f \
$(TFMM3D)/chebexps.f
MOD_OBJECTS = $(patsubst %.f,%.o,$(patsubst %.f90,%.o,$(MOD_SOURCES)))
OBJECTS = $(patsubst %.f,%.o,$(patsubst %.f90,%.o,$(SOURCES)))
#
# use only the file part of the filename, then manually specify
# the build location
#
%.o : %.f
$(FC) $(FFLAGS) -c $< -o $@
%.o : %.f90
$(FC) $(FFLAGS) -c $< -o $@
all: mods objects
$(FLINK) $(OBJECTS) $(MOD_OBJECTS)
./$(PROJECT)
mods: $(MOD_OBJECTS)
objects: $(OBJECTS)
clean:
rm -f $(MOD_OBJECTS)
rm -f *.mod
rm -f $(OBJECTS)
rm -f $(PROJECT)
list: $(SOURCES) $(MOD_SOURCES)
$(warning Requires: $^)