1 | ######################## -*- Mode: Makefile-Automake -*- ###################### |
---|
2 | ## |
---|
3 | ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
4 | ## |
---|
5 | ## The contents of this file are covered under the licence agreement in the |
---|
6 | ## file "LICENCE" distributed with Cforall. |
---|
7 | ## |
---|
8 | ## Makefile.am -- |
---|
9 | ## |
---|
10 | ## Author : Peter A. Buhr |
---|
11 | ## Created On : Sun May 31 09:08:15 2015 |
---|
12 | ## Last Modified By : Peter A. Buhr |
---|
13 | ## Last Modified On : Tue Nov 6 09:01:23 2018 |
---|
14 | ## Update Count : 26 |
---|
15 | ############################################################################### |
---|
16 | |
---|
17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names |
---|
18 | ACLOCAL_AMFLAGS = -I automake |
---|
19 | |
---|
20 | # applies to both programs |
---|
21 | include $(top_srcdir)/src/cfa.make |
---|
22 | |
---|
23 | AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread |
---|
24 | AM_CFAFLAGS = -quiet -in-tree -nodebug |
---|
25 | AM_UPPFLAGS = -quiet -nodebug -multi |
---|
26 | |
---|
27 | BENCH_V_CC = $(__bench_v_CC_$(__quiet)) |
---|
28 | BENCH_V_CFA = $(__bench_v_CFA_$(__quiet)) |
---|
29 | BENCH_V_CXX = $(__bench_v_CXX_$(__quiet)) |
---|
30 | BENCH_V_GOC = $(__bench_v_GOC_$(__quiet)) |
---|
31 | BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) |
---|
32 | BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) |
---|
33 | |
---|
34 | __quiet = verbose |
---|
35 | __bench_v_CC_quiet = @ |
---|
36 | __bench_v_CFA_quiet = @ |
---|
37 | __bench_v_CXX_quiet = @ |
---|
38 | __bench_v_GOC_quiet = @ |
---|
39 | __bench_v_JAVAC_quiet = @ |
---|
40 | __bench_v_UPP_quiet = @ |
---|
41 | __bench_v_CC_verbose = $(AM_V_CC) |
---|
42 | __bench_v_CFA_verbose = $(AM_V_CFA) |
---|
43 | __bench_v_CXX_verbose = $(AM_V_CXX) |
---|
44 | __bench_v_GOC_verbose = $(AM_V_GOC) |
---|
45 | __bench_v_JAVAC_verbose = $(AM_V_JAVAC) |
---|
46 | __bench_v_UPP_verbose = $(AM_V_UPP) |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | TOOLSDIR = ${abs_top_builddir}/tools/ |
---|
51 | REPEAT = ${abs_top_builddir}/tools/repeat |
---|
52 | STATS = ${abs_top_srcdir}/tools/stat.py |
---|
53 | repeats = 30 |
---|
54 | skipcompile = no |
---|
55 | TIME_FORMAT = "%E" |
---|
56 | PRINT_FORMAT = %20s: #Comments needed for spacing |
---|
57 | |
---|
58 | # Dummy hack tricks |
---|
59 | EXTRA_PROGRAMS = dummy # build but do not install |
---|
60 | dummy_SOURCES = dummyC.c dummyCXX.cpp |
---|
61 | |
---|
62 | dummyC.c: |
---|
63 | @echo "int main() { return 0; }" > ${@} |
---|
64 | |
---|
65 | dummyCXX.cpp: |
---|
66 | @echo "int main() { return 0; }" > ${@} |
---|
67 | |
---|
68 | .NOTPARALLEL: |
---|
69 | |
---|
70 | ## ========================================================================================================= |
---|
71 | all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) |
---|
72 | |
---|
73 | %.run : %$(EXEEXT) ${REPEAT} |
---|
74 | @rm -f .result.log |
---|
75 | @echo "------------------------------------------------------" |
---|
76 | @echo $< |
---|
77 | @${REPEAT} ${repeats} ./a.out | tee -a .result.log |
---|
78 | @${STATS} .result.log |
---|
79 | @echo "------------------------------------------------------" |
---|
80 | @rm -f a.out .result.log *.class |
---|
81 | |
---|
82 | %.runquiet : |
---|
83 | @+make $(basename $@) CFLAGS="-w" __quiet=quiet |
---|
84 | @taskset -c 1 ./a.out |
---|
85 | @rm -f a.out |
---|
86 | |
---|
87 | %.make : |
---|
88 | @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) |
---|
89 | @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 |
---|
90 | |
---|
91 | ${REPEAT} : |
---|
92 | @+make -C ${abs_top_builddir}/tools repeat |
---|
93 | |
---|
94 | ## ========================================================================================================= |
---|
95 | |
---|
96 | jenkins$(EXEEXT): |
---|
97 | @echo "{" |
---|
98 | @echo -e '\t"githash": "'${githash}'",' |
---|
99 | @echo -e '\t"arch": "' ${arch} '",' |
---|
100 | @DOifskipcompile@ |
---|
101 | @echo -e '\t"compile": {' |
---|
102 | @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' |
---|
103 | @echo -e '\t\t"dummy" : {}' |
---|
104 | @echo -e '\t},' |
---|
105 | @DOendif@ |
---|
106 | @echo -e '\t"ctxswitch": {' |
---|
107 | @echo -en '\t\t"coroutine":' |
---|
108 | @+make ctxswitch-cfa_coroutine.runquiet |
---|
109 | @echo -en '\t\t,"thread":' |
---|
110 | @+make ctxswitch-cfa_thread.runquiet |
---|
111 | @echo -e '\t},' |
---|
112 | @echo -e '\t"mutex": [' |
---|
113 | @echo -en '\t\t' |
---|
114 | @+make mutex-cfa1.runquiet |
---|
115 | @echo -en '\t\t,' |
---|
116 | @+make mutex-cfa2.runquiet |
---|
117 | @echo -e '\t],' |
---|
118 | @echo -e '\t"scheduling": [' |
---|
119 | @echo -en '\t\t' |
---|
120 | @+make signal-cfa1.runquiet |
---|
121 | @echo -en '\t\t,' |
---|
122 | @+make signal-cfa2.runquiet |
---|
123 | @echo -en '\t\t,' |
---|
124 | @+make waitfor-cfa1.runquiet |
---|
125 | @echo -en '\t\t,' |
---|
126 | @+make waitfor-cfa2.runquiet |
---|
127 | @echo -e '\n\t],' |
---|
128 | @echo -e '\t"epoch": ' $(shell date +%s) |
---|
129 | @echo "}" |
---|
130 | |
---|
131 | ## ========================================================================================================= |
---|
132 | loop$(EXEEXT): |
---|
133 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c |
---|
134 | |
---|
135 | function$(EXEEXT): |
---|
136 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c |
---|
137 | |
---|
138 | fetch_add$(EXEEXT): |
---|
139 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c |
---|
140 | |
---|
141 | ## ========================================================================================================= |
---|
142 | CTXSWITCH_DEPEND = \ |
---|
143 | loop.run \ |
---|
144 | function.run \ |
---|
145 | fetch_add.run \ |
---|
146 | ctxswitch-pthread.run \ |
---|
147 | ctxswitch-cfa_coroutine.run \ |
---|
148 | ctxswitch-cfa_thread.run \ |
---|
149 | ctxswitch-cfa_thread2.run \ |
---|
150 | ctxswitch-upp_coroutine.run \ |
---|
151 | ctxswitch-upp_thread.run \ |
---|
152 | ctxswitch-goroutine.run \ |
---|
153 | ctxswitch-java_thread.run |
---|
154 | |
---|
155 | if WITH_LIBFIBRE |
---|
156 | CTXSWITCH_DEPEND += \ |
---|
157 | ctxswitch-kos_fibre.run \ |
---|
158 | ctxswitch-kos_fibre2.run |
---|
159 | |
---|
160 | |
---|
161 | ctxswitch-kos_fibre$(EXEEXT): |
---|
162 | $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
163 | |
---|
164 | ctxswitch-kos_fibre2$(EXEEXT): |
---|
165 | $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
166 | endif |
---|
167 | |
---|
168 | ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) |
---|
169 | |
---|
170 | ctxswitch-pthread$(EXEEXT): |
---|
171 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c |
---|
172 | |
---|
173 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
174 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa |
---|
175 | |
---|
176 | ctxswitch-cfa_thread$(EXEEXT): |
---|
177 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa |
---|
178 | |
---|
179 | ctxswitch-cfa_thread2$(EXEEXT): |
---|
180 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa |
---|
181 | |
---|
182 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
183 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc |
---|
184 | |
---|
185 | ctxswitch-upp_thread$(EXEEXT): |
---|
186 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc |
---|
187 | |
---|
188 | ctxswitch-goroutine$(EXEEXT): |
---|
189 | $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go |
---|
190 | |
---|
191 | ctxswitch-java_thread$(EXEEXT): |
---|
192 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java |
---|
193 | @echo "#!/bin/sh" > a.out |
---|
194 | @echo "java JavaThread" >> a.out |
---|
195 | @chmod a+x a.out |
---|
196 | |
---|
197 | ## ========================================================================================================= |
---|
198 | mutex$(EXEEXT) :\ |
---|
199 | loop.run \ |
---|
200 | function.run \ |
---|
201 | fetch_add.run \ |
---|
202 | mutex-pthread_lock.run \ |
---|
203 | mutex-upp.run \ |
---|
204 | mutex-cfa1.run \ |
---|
205 | mutex-cfa2.run \ |
---|
206 | mutex-cfa4.run \ |
---|
207 | mutex-java_thread.run |
---|
208 | |
---|
209 | mutex-pthread_lock$(EXEEXT): |
---|
210 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c |
---|
211 | |
---|
212 | mutex-upp$(EXEEXT): |
---|
213 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc |
---|
214 | |
---|
215 | mutex-cfa1$(EXEEXT): |
---|
216 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa |
---|
217 | |
---|
218 | mutex-cfa2$(EXEEXT): |
---|
219 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa |
---|
220 | |
---|
221 | mutex-cfa4$(EXEEXT): |
---|
222 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa |
---|
223 | |
---|
224 | mutex-java_thread$(EXEEXT): |
---|
225 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java |
---|
226 | @echo "#!/bin/sh" > a.out |
---|
227 | @echo "java JavaThread" >> a.out |
---|
228 | @chmod a+x a.out |
---|
229 | |
---|
230 | ## ========================================================================================================= |
---|
231 | signal$(EXEEXT) :\ |
---|
232 | signal-pthread_cond.run \ |
---|
233 | signal-upp.run \ |
---|
234 | signal-cfa1.run \ |
---|
235 | signal-cfa2.run \ |
---|
236 | signal-cfa4.run \ |
---|
237 | signal-java_thread.run |
---|
238 | |
---|
239 | signal-pthread_cond$(EXEEXT): |
---|
240 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c |
---|
241 | |
---|
242 | signal-upp$(EXEEXT): |
---|
243 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc |
---|
244 | |
---|
245 | signal-cfa1$(EXEEXT): |
---|
246 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa |
---|
247 | |
---|
248 | signal-cfa2$(EXEEXT): |
---|
249 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa |
---|
250 | |
---|
251 | signal-cfa4$(EXEEXT): |
---|
252 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa |
---|
253 | |
---|
254 | signal-java_thread$(EXEEXT): |
---|
255 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java |
---|
256 | @echo "#!/bin/sh" > a.out |
---|
257 | @echo "java JavaThread" >> a.out |
---|
258 | @chmod a+x a.out |
---|
259 | |
---|
260 | |
---|
261 | ## ========================================================================================================= |
---|
262 | waitfor$(EXEEXT) :\ |
---|
263 | waitfor-upp.run \ |
---|
264 | waitfor-cfa1.run \ |
---|
265 | waitfor-cfa2.run \ |
---|
266 | waitfor-cfa4.run |
---|
267 | |
---|
268 | waitfor-upp$(EXEEXT): |
---|
269 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc |
---|
270 | |
---|
271 | waitfor-cfa1$(EXEEXT): |
---|
272 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa |
---|
273 | |
---|
274 | waitfor-cfa2$(EXEEXT): |
---|
275 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa |
---|
276 | |
---|
277 | waitfor-cfa4$(EXEEXT): |
---|
278 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa |
---|
279 | |
---|
280 | ## ========================================================================================================= |
---|
281 | creation$(EXEEXT) :\ |
---|
282 | creation-pthread.run \ |
---|
283 | creation-cfa_coroutine.run \ |
---|
284 | creation-cfa_coroutine_eager.run \ |
---|
285 | creation-cfa_thread.run \ |
---|
286 | creation-upp_coroutine.run \ |
---|
287 | creation-upp_thread.run \ |
---|
288 | creation-goroutine.run \ |
---|
289 | creation-java_thread.run |
---|
290 | |
---|
291 | creation-cfa_coroutine$(EXEEXT): |
---|
292 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa |
---|
293 | |
---|
294 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
295 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa -DEAGER |
---|
296 | |
---|
297 | creation-cfa_thread$(EXEEXT): |
---|
298 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa |
---|
299 | |
---|
300 | creation-upp_coroutine$(EXEEXT): |
---|
301 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc |
---|
302 | |
---|
303 | creation-upp_thread$(EXEEXT): |
---|
304 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc |
---|
305 | |
---|
306 | creation-pthread$(EXEEXT): |
---|
307 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c |
---|
308 | |
---|
309 | creation-goroutine$(EXEEXT): |
---|
310 | $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go |
---|
311 | |
---|
312 | creation-java_thread$(EXEEXT): |
---|
313 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java |
---|
314 | @echo "#!/bin/sh" > a.out |
---|
315 | @echo "java JavaThread" >> a.out |
---|
316 | @chmod a+x a.out |
---|
317 | |
---|
318 | ## ========================================================================================================= |
---|
319 | |
---|
320 | compile$(EXEEXT) :\ |
---|
321 | compile-array.make \ |
---|
322 | compile-attributes.make \ |
---|
323 | compile-empty.make \ |
---|
324 | compile-expression.make \ |
---|
325 | compile-io.make \ |
---|
326 | compile-monitor.make \ |
---|
327 | compile-operators.make \ |
---|
328 | compile-typeof.make |
---|
329 | |
---|
330 | |
---|
331 | testdir = $(top_srcdir)/tests |
---|
332 | |
---|
333 | compile-array$(EXEEXT): |
---|
334 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa |
---|
335 | |
---|
336 | compile-attributes$(EXEEXT): |
---|
337 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa |
---|
338 | |
---|
339 | compile-empty$(EXEEXT): |
---|
340 | @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa |
---|
341 | |
---|
342 | compile-expression$(EXEEXT): |
---|
343 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa |
---|
344 | |
---|
345 | compile-io$(EXEEXT): |
---|
346 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa |
---|
347 | |
---|
348 | compile-monitor$(EXEEXT): |
---|
349 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa |
---|
350 | |
---|
351 | compile-operators$(EXEEXT): |
---|
352 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa |
---|
353 | |
---|
354 | compile-thread$(EXEEXT): |
---|
355 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa |
---|
356 | |
---|
357 | compile-typeof$(EXEEXT): |
---|
358 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa |
---|
359 | |
---|