forked from milc-qcd/milc_qcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMake_template
269 lines (217 loc) · 6.23 KB
/
Make_template
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
# Kogut-Susskind fermions with improved actions
# MIMD version 7
#
# Generic make-include file for rg_shamir
#
# This template file defines rules and macros common to all architectures
# It is intended to be an include file for other Makefiles.
# Don't use it by itself!
#
MYINCLUDEDIR = .
INCLUDEDIR = ../include
#Where the complex and su3 libraries are
LIBDIR = ../libraries
GLOBAL_HEADERS = ${INCLUDEDIR} ../libraries/include
INLINE_HEADERS = \
../sse/include/ \
../sse2/include/ \
../libraries/include/
MY_HEADERS = \
lattice.h \
lattice_qdp.h \
params.h \
defines.h \
RG_Shamir_includes.h \
RG_include.h
HEADERS = ${GLOBAL_HEADERS} ${MY_HEADERS} ${INLINE_HEADERS} ${SCIDAC_HEADERS}
MY_OBJECTS= \
control.o \
gauge_info.o \
setup.o \
RG_subsets.o \
RG_operations.o \
RG_print.o \
smearing.o \
project_smear.o \
RG_fields.o \
RG_transf.o \
RG_path.o \
RG_check.o \
RG_smear.o \
RG_gauge.o \
RG_block.o \
plaquette_qdp.o \
RG_trace_new.o \
RG_bulk.o \
RG_check_order.o
G_OBJECTS0 = \
ape_smear.o \
check_unitarity.o \
d_plaq4.o \
gaugefix2.o \
gauge_stuff.o \
io_detect.o \
io_helpers.o \
io_lat4.o \
io_lat_utils.o \
make_lattice.o \
nersc_cksum.o \
path_product.o \
ranmom.o \
ranstuff.o \
remap_stdio_from_args.o \
reunitarize2.o \
rand_gauge.o \
project_su3_hit.o
ifeq ($(strip ${QCDOC}),true)
G_OBJECTS1 = ${G_OBJECTS0} ploop2.o
else
G_OBJECTS1 = ${G_OBJECTS0} ploop3.o
endif
ifeq ($(strip ${HAVEQIO}),true)
G_OBJECTS = ${G_OBJECTS1} io_scidac.o io_scidac_types.o
else
G_OBJECTS = ${G_OBJECTS1}
endif
G_KS_OBJECTS = \
f_meas.o \
grsource_imp.o \
mat_invert.o \
fermion_links_fn.o \
quark_stuff.o \
rephase.o
# Objects depending on architecture and software package
# Layout
ifeq ($(strip ${QCDOC}),true)
LAYOUT = layout_qcdoc.o # Required
else
ifeq ($(strip ${HAVEQDP}),true)
LAYOUT = layout_qdp.o # Required
else
LAYOUT = layout_hyper_prime.o # Choices possible here
endif
endif
# Selection of a non-QDP FN Dslash
# Choices are dslash_fn.o dslash_fn2.o dslash_fn_dblstore.o
DSLASH_FN = dslash_fn2.o
# Selection of the conjugate gradient algorithm
ifeq ($(strip ${HAVEQOP}),true)
# Interface to access QOP
CONGRAD_FN = d_congrad5_fn_qop.o \
d_congrad5_fn_qop_D.o d_congrad5_fn_qop_F.o d_congrad_opt.o
CONGRAD_FN += ${ASQINVERTQOP}
else
ifeq ($(strip ${HAVEQDP}),true)
CONGRAD_FN = d_congrad5_fn_qdp.o \
d_congrad5_fn_qdp_D.o d_congrad5_fn_qdp_F.o d_congrad_opt.o
else
# Choose a non_QDP FN conjugate gradient algorithm (d_congrad5_fn.o
# or d_congrad5_fn_fewsums.o)
CONGRAD_FN = d_congrad5_fn.o d_congrad_opt.o
endif
endif
ifeq ($(strip ${QCDOC}),true)
QCDOC_OBJECTS = qcdoc_alloc.o
endif
ifeq ($(strip ${HAVEQDP}),true)
QDP_OBJECTS = map_milc_to_qdp.o
INV_FN_OBJECTS = d_congrad5_fn_qdp_D.o d_congrad5_fn_qdp_F.o \
${DSLASH_FN} dslash_fn_qdp_D.o dslash_fn_qdp_F.o
MULTI_INV_FN = ks_multicg_offset_qdp_D.o ks_multicg_offset_qdp_F.o
# Choose (fermion_force_asqtad_qdp.o )
ASQFORCE = fermion_force_asqtad_qdp.o
else
INV_FN_OBJECTS = ${CONGRAD_FN} ${DSLASH_FN}
MULTI_INV_FN = ks_multicg.o
# Choose (fermion_force_asqtad.o fermion_force_asqtad2.o )
ASQFORCE = fermion_force_asqtad2.o
endif
INV_EO_OBJECTS = d_congrad5_eo.o dslash_eo.o
MULTI_INV_EO = ks_multicg.o
ADD_OBJECTS = ${MACHINE_DEP_IO} ${COMMPKG} ${QCDOC_OBJECTS} ${QDP_OBJECTS} \
${SCIDAC_OBJECTS}
OBJECTS = ${MY_OBJECTS} ${G_OBJECTS} ${G_KS_OBJECTS} ${LAYOUT} \
${ADD_OBJECTS} ${EXTRA_OBJECTS}
#Libraries for complex numbers and su3 functions
P = $(strip ${PRECISION})
QCDLIB = ${LIBDIR}/su3.${P}.a ${LIBDIR}/complex.${P}.a
LIBRARIES = ${QCDLIB} ${SCIDAC_LIBRARIES} ${QUDA_LIBRARIES}
# Default rule for C compilation
.c.o: ; ${CC} -c ${CFLAGS} $*.c
# To force a full remake when changing targets
LASTMAKE = .lastmake.${MAKEFILE}.${P}.${MYTARGET}
${LASTMAKE}:
-/bin/rm -f .lastmake.*
/bin/rm -f .lastmake.* quark_action.h gauge_action.h
${MAKE} -f ${MAKEFILE} clean
touch ${LASTMAKE}
ALL_MAKES = \
Make_template \
${MAKEFILE} \
../Make_template_scidac \
../generic/Make_template \
../generic_ks/Make_template
# To force a remake when changing any make file, header, or target
${OBJECTS} : ${HEADERS} ${LASTMAKE} ${ALL_MAKES}
fermion_links_fn.o: quark_action.h
gauge_stuff.o: gauge_action.h
gauge_info.o: quark_action.h
quark_stuff.o: quark_action.h
# Directories where we store the improved action headers
QUARKIMP = ../generic_ks/imp_actions
GAUGEIMP = ../generic/imp_actions
quark_action.h: ${QUARKIMP}/${QUARK}
/bin/cp ${QUARKIMP}/${QUARK} quark_action.h
gauge_action.h: ${GAUGEIMP}/${GAUGE}
/bin/cp ${GAUGEIMP}/${GAUGE} gauge_action.h
########################################################
# Optional DEFINES for timing:
# -DCGTIME for cg timing and iterations
# -DGFTIME for gauge force timing
# -DFFTIME for fermion force timing
# -DLLTIME for long link timing
# Optional DEFINES for pbp estimates
# -DNPBP_REPS Number of repeated evaluations of stochastic
# psi-bar-psi
# Optional DEFINES for quark number susceptibility
# -DCHEM_POT
ifeq ($(strip ${QCDOC}),true)
DQCDOC = -DQCDOC
endif
ifeq ($(strip ${HAVEQIO}),true)
DHAVE_QIO = -DHAVE_QIO
endif
ifeq ($(strip ${HAVEQDP}),true)
DHAVE_QDP = -DHAVE_QDP
endif
DARCH = ${DQCDOC} ${DHAVE_QIO} ${DHAVE_QDP}
##### Targets:
# ("FN" = "fat+Naik")
# -DCGTIME -DFFTIME -DGFTIME -DLLTIME" \
RG_Shamir_nrg2::
${MAKE} -f ${MAKEFILE} target "MYTARGET= $@" \
"DEFINES= -DFN ${DARCH}" \
"GAUGE = symanzik_1loop_action.h" \
"QUARK = asqtad_action.h" \
"EXTRA_OBJECTS= ${INV_FN_OBJECTS} ${ASQFORCE} "
RG_Shamir_nrg2_notrans::
${MAKE} -f ${MAKEFILE} target "MYTARGET= $@" \
"DEFINES= -DFN ${DARCH} -DNOTRANS" \
"GAUGE = symanzik_1loop_action.h" \
"QUARK = asqtad_action.h" \
"EXTRA_OBJECTS= ${INV_FN_OBJECTS} ${ASQFORCE} "
clean:
-/bin/rm -f *.o
# Rules for generic routines
include ../generic/Make_template
# Rules for generic_ks routines
include ../generic_ks/Make_template
libmake:
@echo Building libraries with ${MAKELIBRARIES}
cd ${LIBDIR} ;\
${MAKE} -f ${MAKELIBRARIES} "APP_CC=${CC}" "PRECISION=${PRECISION}" all
localmake: ${OBJECTS} ${LIBRARIES}
${LD} ${LDFLAGS} -o ${MYTARGET} \
${OBJECTS} ${QCDLIB} ${ILIB} -lm
touch localmake
target: libmake localmake