-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
192 lines (115 loc) · 4.96 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
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
################################################################################
#
# Makefile to compile and link C programs with MPI subroutines. Version valid
# for Linux machines with GNU make.
#
# "make" compiles and links the specified main programs and modules, using the
# specified libraries (if any), and produces the executables.
#
# "make clean" removes all files generated by "make".
#
# Dependencies on included files are automatically taken care of.
#
################################################################################
all: rmxeq mkdep mkxeq
.PHONY: all
# main programs and modules to be compiled
MAIN = eva_primme
ARCHIVE = archive iodat marchive sarchive
BLOCK = block blk_grid map_u2blk map_sw2blk map_s2blk
DFL = dfl_geometry dfl_modes dfl_sap_gcr dfl_subspace ltl_gcr
DFT = dft4d dft_com dft_shuf dft_wspace fft small_dft
DIRAC = Dw_dble Dw Dw_bnd
FLAGS = flags action_parms dfl_parms dft4d_parms dft_parms force_parms \
hmc_parms lat_parms mdint_parms parms rat_parms rw_parms sap_parms \
smd_parms solver_parms wflow_parms
FORCES = force0 force1 force2 force3 force4 force5 \
frcfcts genfrc tmcg tmcgm xtensor
LATTICE = bcnds blk_geometry ftidx geogen geometry uidx
LINALG = cmatrix cmatrix_dble liealg salg salg_dble valg valg_dble
LINSOLV = cgne fgcr fgcr4vd gcr4v mscg
LITTLE = Aw Aw_blk Aw_com1 Aw_com2 Aw_dble Aw_gen Aw_hop Aw_ops ltl_modes
MDFLDS = mdflds fcom
MSFCTS = farchive fiodat fldops latavg pt2pt
RANDOM = ranlux ranlux_common ranlxs ranlxd gauss
RATFCTS = elliptic zolotarev ratfcts
SAP = blk_solv sap_com sap_gcr sap
SFLDS = scom sdcom sflds Pbnd Pbnd_dble unorm
SU3FCTS = chexp su3prod su3ren cm3x3 random_su3
SW_TERM = pauli pauli_dble swalg swexp swflds sw_term
TCHARGE = ftcom ftensor tcharge ym_action
UFLDS = bstap plaq_sum udcom uflds uinit
UPDATE = chrono counters mdsteps mdint msize hmc rwtm rwtmeo rwrat \
sanity smd update wsize
UTILS = array endian error futils mutils qsum utils wspace
VFLDS = vflds vinit vcom vdcom
WFLOW = wflow
MODULES = $(ARCHIVE) $(BLOCK) $(DFL) $(DFT) $(DIRAC) $(FLAGS) $(FORCES) \
$(LATTICE) $(LINALG) $(LINSOLV) $(LITTLE) $(MDFLDS) $(MSFCTS) \
$(RANDOM) $(RATFCTS) $(SAP) $(SFLDS) $(SU3FCTS) $(SW_TERM) \
$(TCHARGE) $(UFLDS) $(UPDATE) $(UTILS) $(VFLDS) $(WFLOW)
# Logging option (-mpilog or -mpitrace or -mpianim)
LOGOPTION =
# -----------------------------------
# openQCD, PETSc, SLEPc distribution
# -----------------------------------
mainDIR = .
openQCD = $(mainDIR)/../openQCD-2.4.2
# search path for modules
MDIR = ${openQCD}/modules
VPATH = .:$(MDIR)/archive:$(MDIR)/block:$(MDIR)/dirac:$(MDIR)/dfl:\
$(MDIR)/dft:$(MDIR)/flags:$(MDIR)/forces:$(MDIR)/lattice:\
$(MDIR)/linalg:$(MDIR)/linsolv:$(MDIR)/little:$(MDIR)/mdflds:\
$(MDIR)/msfcts:$(MDIR)/random:$(MDIR)/ratfcts:$(MDIR)/sap:\
$(MDIR)/sflds:$(MDIR)/su3fcts:$(MDIR)/sw_term:$(MDIR)/tcharge:\
$(MDIR)/uflds:$(MDIR)/update:$(MDIR)/utils:$(MDIR)/vflds:\
$(MDIR)/wflow
# additional include directories
INCPATH = $(MPI_INCLUDE) ${openQCD}/include ${PRIMME_DIR}/include
# additional libraries
LIBS = m primme lapack blas
LIBPATH = $(MPI_LIB) $(PRIMME_DIR)/lib
# scheduling and optimization options
CFLAGS = -std=c99 -pedantic -fstrict-aliasing -fopenmp -Wall \
-Wno-long-long -Wno-format-overflow -Wstrict-prototypes -Werror \
-O -mfpmath=sse -mno-avx -DAVX -DFMA3 -DPM -Wno-maybe-uninitialized
LFLAGS = -fopenmp
# These CFLAGS options are recommended if the gcc compiler is used on a
# x86-64 machine supporting AVX and FMA3 instructions. See the README in
# the top directory for alternative choices of the optimization options.
#
# The available debugging flags are
#
# -DCGNE_DBG -DFGCR_DBG -DFGCR4VD_DBG -DGCR4V -DFORCE_DBG -DMSCG_DBG
# -DDFL_MODES_DBG -DMDINT_DBG -DRWRAT_DBG -DIGNORE_ERRORS
#
# Add these (or some of these) to CFLAGS if debugging output is desired.
############################## do not change ###################################
SHELL=/bin/bash
CLINKER=$(CC)
PGMS= $(MAIN) $(MODULES)
-include $(addsuffix .d,$(PGMS))
# rule to make dependencies
$(addsuffix .d,$(PGMS)): %.d: %.c Makefile
@ $(GCC) -ansi $< -MM $(addprefix -I,$(INCPATH)) -o $@
# rule to compile source programs
$(addsuffix .o,$(PGMS)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))
# rule to link object files
$(MAIN): %: %.o $(addsuffix .o,$(MODULES)) Makefile
$(CLINKER) $< $(addsuffix .o,$(MODULES)) $(LFLAGS) $(LOGOPTION) \
$(addprefix -L,$(LIBPATH)) $(addprefix -l,$(LIBS)) -o $@
# produce executables
mkxeq: $(MAIN)
# remove old executables
rmxeq:
@ -rm -f $(MAIN); \
echo "delete old executables"
# make dependencies
mkdep: $(addsuffix .d,$(PGMS))
@ echo "generate tables of dependencies"
# clean directory
clean:
@ -rm -rf *.d *.o *.alog *.clog *.slog $(MAIN)
.PHONY: clean
################################################################################