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 -std=c++14 |
---|
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 | tls-fetch_add$(EXEEXT): |
---|
142 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/tls-fetch_add.c |
---|
143 | |
---|
144 | ## ========================================================================================================= |
---|
145 | CTXSWITCH_DEPEND = \ |
---|
146 | loop.run \ |
---|
147 | function.run \ |
---|
148 | fetch_add.run \ |
---|
149 | tls-fetch_add.run \ |
---|
150 | ctxswitch-pthread.run \ |
---|
151 | ctxswitch-cfa_coroutine.run \ |
---|
152 | ctxswitch-cfa_thread.run \ |
---|
153 | ctxswitch-cfa_thread2.run \ |
---|
154 | ctxswitch-upp_coroutine.run \ |
---|
155 | ctxswitch-upp_thread.run \ |
---|
156 | ctxswitch-goroutine.run \ |
---|
157 | ctxswitch-java_thread.run |
---|
158 | |
---|
159 | if WITH_LIBFIBRE |
---|
160 | CTXSWITCH_DEPEND += \ |
---|
161 | ctxswitch-kos_fibre.run \ |
---|
162 | ctxswitch-kos_fibre2.run |
---|
163 | |
---|
164 | |
---|
165 | ctxswitch-kos_fibre$(EXEEXT): |
---|
166 | $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
167 | |
---|
168 | ctxswitch-kos_fibre2$(EXEEXT): |
---|
169 | $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
170 | endif |
---|
171 | |
---|
172 | ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) |
---|
173 | |
---|
174 | ctxswitch-pthread$(EXEEXT): |
---|
175 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c |
---|
176 | |
---|
177 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
178 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa |
---|
179 | |
---|
180 | ctxswitch-cfa_thread$(EXEEXT): |
---|
181 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa |
---|
182 | |
---|
183 | ctxswitch-cfa_thread2$(EXEEXT): |
---|
184 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa |
---|
185 | |
---|
186 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
187 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc |
---|
188 | |
---|
189 | ctxswitch-upp_thread$(EXEEXT): |
---|
190 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc |
---|
191 | |
---|
192 | ctxswitch-goroutine$(EXEEXT): |
---|
193 | $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go |
---|
194 | |
---|
195 | ctxswitch-java_thread$(EXEEXT): |
---|
196 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java |
---|
197 | @echo "#!/bin/sh" > a.out |
---|
198 | @echo "java JavaThread" >> a.out |
---|
199 | @chmod a+x a.out |
---|
200 | |
---|
201 | ## ========================================================================================================= |
---|
202 | mutex$(EXEEXT) :\ |
---|
203 | loop.run \ |
---|
204 | function.run \ |
---|
205 | fetch_add.run \ |
---|
206 | mutex-pthread_lock.run \ |
---|
207 | mutex-upp.run \ |
---|
208 | mutex-cfa1.run \ |
---|
209 | mutex-cfa2.run \ |
---|
210 | mutex-cfa4.run \ |
---|
211 | mutex-java_thread.run |
---|
212 | |
---|
213 | mutex-pthread_lock$(EXEEXT): |
---|
214 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c |
---|
215 | |
---|
216 | mutex-upp$(EXEEXT): |
---|
217 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc |
---|
218 | |
---|
219 | mutex-cfa1$(EXEEXT): |
---|
220 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa |
---|
221 | |
---|
222 | mutex-cfa2$(EXEEXT): |
---|
223 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa |
---|
224 | |
---|
225 | mutex-cfa4$(EXEEXT): |
---|
226 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa |
---|
227 | |
---|
228 | mutex-java_thread$(EXEEXT): |
---|
229 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java |
---|
230 | @echo "#!/bin/sh" > a.out |
---|
231 | @echo "java JavaThread" >> a.out |
---|
232 | @chmod a+x a.out |
---|
233 | |
---|
234 | ## ========================================================================================================= |
---|
235 | signal$(EXEEXT) :\ |
---|
236 | signal-pthread_cond.run \ |
---|
237 | signal-upp.run \ |
---|
238 | signal-cfa1.run \ |
---|
239 | signal-cfa2.run \ |
---|
240 | signal-cfa4.run \ |
---|
241 | signal-java_thread.run |
---|
242 | |
---|
243 | signal-pthread_cond$(EXEEXT): |
---|
244 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c |
---|
245 | |
---|
246 | signal-upp$(EXEEXT): |
---|
247 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc |
---|
248 | |
---|
249 | signal-cfa1$(EXEEXT): |
---|
250 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa |
---|
251 | |
---|
252 | signal-cfa2$(EXEEXT): |
---|
253 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa |
---|
254 | |
---|
255 | signal-cfa4$(EXEEXT): |
---|
256 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa |
---|
257 | |
---|
258 | signal-java_thread$(EXEEXT): |
---|
259 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java |
---|
260 | @echo "#!/bin/sh" > a.out |
---|
261 | @echo "java JavaThread" >> a.out |
---|
262 | @chmod a+x a.out |
---|
263 | |
---|
264 | |
---|
265 | ## ========================================================================================================= |
---|
266 | waitfor$(EXEEXT) :\ |
---|
267 | waitfor-upp.run \ |
---|
268 | waitfor-cfa1.run \ |
---|
269 | waitfor-cfa2.run \ |
---|
270 | waitfor-cfa4.run |
---|
271 | |
---|
272 | waitfor-upp$(EXEEXT): |
---|
273 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc |
---|
274 | |
---|
275 | waitfor-cfa1$(EXEEXT): |
---|
276 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa |
---|
277 | |
---|
278 | waitfor-cfa2$(EXEEXT): |
---|
279 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa |
---|
280 | |
---|
281 | waitfor-cfa4$(EXEEXT): |
---|
282 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa |
---|
283 | |
---|
284 | ## ========================================================================================================= |
---|
285 | creation$(EXEEXT) :\ |
---|
286 | creation-pthread.run \ |
---|
287 | creation-cfa_coroutine.run \ |
---|
288 | creation-cfa_coroutine_eager.run \ |
---|
289 | creation-cfa_thread.run \ |
---|
290 | creation-upp_coroutine.run \ |
---|
291 | creation-upp_thread.run \ |
---|
292 | creation-goroutine.run \ |
---|
293 | creation-java_thread.run |
---|
294 | |
---|
295 | creation-cfa_coroutine$(EXEEXT): |
---|
296 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa |
---|
297 | |
---|
298 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
299 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa -DEAGER |
---|
300 | |
---|
301 | creation-cfa_thread$(EXEEXT): |
---|
302 | $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa |
---|
303 | |
---|
304 | creation-upp_coroutine$(EXEEXT): |
---|
305 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc |
---|
306 | |
---|
307 | creation-upp_thread$(EXEEXT): |
---|
308 | $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc |
---|
309 | |
---|
310 | creation-pthread$(EXEEXT): |
---|
311 | $(BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c |
---|
312 | |
---|
313 | creation-goroutine$(EXEEXT): |
---|
314 | $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go |
---|
315 | |
---|
316 | creation-java_thread$(EXEEXT): |
---|
317 | $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java |
---|
318 | @echo "#!/bin/sh" > a.out |
---|
319 | @echo "java JavaThread" >> a.out |
---|
320 | @chmod a+x a.out |
---|
321 | |
---|
322 | ## ========================================================================================================= |
---|
323 | |
---|
324 | compile$(EXEEXT) :\ |
---|
325 | compile-array.make \ |
---|
326 | compile-attributes.make \ |
---|
327 | compile-empty.make \ |
---|
328 | compile-expression.make \ |
---|
329 | compile-io.make \ |
---|
330 | compile-monitor.make \ |
---|
331 | compile-operators.make \ |
---|
332 | compile-typeof.make |
---|
333 | |
---|
334 | |
---|
335 | testdir = $(top_srcdir)/tests |
---|
336 | |
---|
337 | compile-array$(EXEEXT): |
---|
338 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa |
---|
339 | |
---|
340 | compile-attributes$(EXEEXT): |
---|
341 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa |
---|
342 | |
---|
343 | compile-empty$(EXEEXT): |
---|
344 | @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa |
---|
345 | |
---|
346 | compile-expression$(EXEEXT): |
---|
347 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa |
---|
348 | |
---|
349 | compile-io$(EXEEXT): |
---|
350 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa |
---|
351 | |
---|
352 | compile-monitor$(EXEEXT): |
---|
353 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa |
---|
354 | |
---|
355 | compile-operators$(EXEEXT): |
---|
356 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa |
---|
357 | |
---|
358 | compile-thread$(EXEEXT): |
---|
359 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa |
---|
360 | |
---|
361 | compile-typeof$(EXEEXT): |
---|
362 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa |
---|
363 | |
---|