forked from milc-qcd/milc_qcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMake_template
170 lines (133 loc) · 4.37 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
# Kogut-Susskind fermion eigenvalue/eigenvector computation
# with improved actions
# MIMD version 7
#
# Generic make-include file for ks_eigen codes
# 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!
#
# su3_eigen_asqtad -- eigenvalues for asqtad improved fermions
# su3_eigen_hisq -- eigenvalues for hisq improved fermions
# su3_eigen_p4fat3 -- eigenvalues for p4fat3 improved fermions
#
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 \
params.h \
defines.h \
ks_eig_includes.h \
quark_action.h
HEADERS = ${GLOBAL_HEADERS} ${MY_HEADERS} ${INLINE_HEADERS} \
${QUDA_HEADERS} ${QPHIX_HEADERS} ${GRID_HEADERS} ${SCIDAC_HEADERS}
# All required object files
# Basic set from current directory
MY_OBJECTS = \
control.o \
gauge_info.o \
setup.o
G_U1_OBJECTS = \
io_u1lat.o \
u1link.o \
u1plaq.o
# Selection of layout
LAYOUT = layout_hyper_prime.o # Choices possible here
ADD_OBJECTS = ${MACHINE_DEP_IO} ${COMMPKG} spin_taste_ops.o shift_field.o gammas.o
OBJECTS = \
${MY_OBJECTS} \
${FFT_OBJECTS} \
${GAUGE_OBJECTS} \
${LAYOUT} \
${STANDARD_OBJECTS} \
${EIGEN_OBJECTS} \
${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} $<
.cc.o: ; ${CXX} -c ${CXXFLAGS} $<
# To force a full remake when changing targets
LASTMAKE = .lastmake.${MAKEFILE}.${P}.${MYTARGET}
${LASTMAKE}: ${ALL_MAKES}
-/bin/rm -f .lastmake.* quark_action.h
${MAKE} -f ${MAKEFILE} clean
touch ${LASTMAKE}
# All make files used in this compilation
ALL_MAKES = \
Make_template \
${MAKEFILE} \
../Make_template_combos \
../Make_template_scidac \
../generic/Make_template \
../generic_ks/Make_template \
../generic_u1/Make_template
# To force a remake when changing any make file, header, or target
${OBJECTS} : ${LASTMAKE} ${HEADERS} ${ALL_MAKES}
# Directories where we store the improved action headers
QUARKIMP = ../generic_ks/imp_actions
quark_action.h: ${QUARKIMP}/${QUARK}
@echo Copying quark_action.h from ${QUARKIMP}/${QUARK}
/bin/cp ${QUARKIMP}/${QUARK} quark_action.h
##### Targets:
# Optional DEFINES for targets
# -DFN identifies fat-Naik-like actions with only next and 3rd
# next neighbor linkage
su3_eigen_asqtad::
${MAKE} -f ${MAKEFILE} target "MYTARGET = $@" \
"DEFINES = -DFN -DEIGEN_QIO" \
"QUARK = asqtad_action.h" \
"EXTRA_OBJECTS = ${FN_OBJECTS}"
su3_eigen_hisq::
${MAKE} -f ${MAKEFILE} target "MYTARGET = $@" \
"DEFINES = -DFN -DEIGEN_QIO" \
"QUARK = hisq/hisq_u3_action.h" \
"EXTRA_OBJECTS = ${HISQ_OBJECTS}"
su3_eigen_hisq_pack::
${MAKE} -f ${MAKEFILE} target "MYTARGET = $@" \
"DEFINES = -DFN -DEIGEN_QIO -DPACK_EIGEN" \
"QUARK = hisq/hisq_u3_action.h" \
"EXTRA_OBJECTS = ${HISQ_OBJECTS}"
# HISQ + U(1) targets WARNING: Naive implementation
su3_u1_eigen_hisq::
${MAKE} -f ${MAKEFILE} target "MYTARGET = $@" \
"DEFINES = -DFN -DEIGEN_QIO -DU1_FIELD" \
"QUARK = hisq/hisq_u3_action.h" \
"EXTRA_OBJECTS = ${HISQ_OBJECTS} ${G_U1_OBJECTS}"
# No QOP support for p4, so we use pure MILC routines only and
# undefine the macros HAVE_QOP and HAVE_QDP
# Currently not supported. Needs fixing.
su3_eigen_p4fat3::
${MAKE} -f ${MAKEFILE} target "MYTARGET = $@" \
"DEFINES = -DEO \
-UKS_MULTICG -UHAVE_QOP -UHAVE_QDP" \
"QUARK = p4fat3_action.h" \
"EXTRA_OBJECTS = ${EO_OBJECTS}"
clean:
-/bin/rm -f *.o quark_action.h
# Rules for generic routines
include ../generic/Make_template
# Rules for generic_ks routines
include ../generic_ks/Make_template
# Rules for generic_wilson routines
include ../generic_wilson/Make_template
libmake:
@echo Building libraries with ${MAKELIBRARIES}
cd ${LIBDIR} ;\
${MAKE} -f ${MAKELIBRARIES} "APP_CC=${CC}" "PRECISION=${PRECISION}" \
"ARCH=${ARCH}" "COMPILER=${COMPILER}" all
localmake: ${OBJECTS} ${LIBRARIES}
${LD} -o ${MYTARGET} ${LDFLAGS} \
${OBJECTS} ${QCDLIB} ${ILIB} -lm
touch localmake
target: libmake localmake