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 | |
---|
19 | # applies to both programs |
---|
20 | include $(top_srcdir)/src/cfa.make |
---|
21 | |
---|
22 | UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) |
---|
23 | |
---|
24 | AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread |
---|
25 | AM_CFAFLAGS = -quiet -in-tree -nodebug |
---|
26 | AM_UPPFLAGS = -quiet -nodebug -multi |
---|
27 | |
---|
28 | TOOLSDIR = ${abs_top_srcdir}/tools/ |
---|
29 | REPEAT = ${TOOLSDIR}repeat |
---|
30 | STATS = ${TOOLSDIR}stat.py |
---|
31 | repeats = 30 |
---|
32 | skipcompile = no |
---|
33 | TIME_FORMAT = "%E" |
---|
34 | PRINT_FORMAT = %20s: #Comments needed for spacing |
---|
35 | |
---|
36 | .NOTPARALLEL: |
---|
37 | |
---|
38 | noinst_PROGRAMS = |
---|
39 | |
---|
40 | all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) |
---|
41 | |
---|
42 | %.run : %$(EXEEXT) ${REPEAT} |
---|
43 | @rm -f .result.log |
---|
44 | @echo "------------------------------------------------------" |
---|
45 | @echo $< |
---|
46 | @${REPEAT} ${repeats} ./a.out | tee -a .result.log |
---|
47 | @${STATS} .result.log |
---|
48 | @echo "------------------------------------------------------" |
---|
49 | @rm -f a.out .result.log |
---|
50 | |
---|
51 | %.runquiet : |
---|
52 | @+make $(basename $@) CFLAGS="-w" |
---|
53 | @taskset -c 1 ./a.out |
---|
54 | @rm -f a.out |
---|
55 | |
---|
56 | %.make : |
---|
57 | @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) |
---|
58 | @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 |
---|
59 | |
---|
60 | ${REPEAT} : |
---|
61 | @+make -C ${TOOLSDIR} repeat |
---|
62 | |
---|
63 | ## ========================================================================================================= |
---|
64 | |
---|
65 | jenkins$(EXEEXT): |
---|
66 | @echo "{" |
---|
67 | @echo -e '\t"githash": "'${githash}'",' |
---|
68 | @echo -e '\t"arch": "' ${arch} '",' |
---|
69 | @DOifskipcompile@ |
---|
70 | @echo -e '\t"compile": {' |
---|
71 | @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' |
---|
72 | @echo -e '\t\t"dummy" : {}' |
---|
73 | @echo -e '\t},' |
---|
74 | @DOendif@ |
---|
75 | @echo -e '\t"ctxswitch": {' |
---|
76 | @echo -en '\t\t"coroutine":' |
---|
77 | @+make ctxswitch-cfa_coroutine.runquiet |
---|
78 | @echo -en '\t\t,"thread":' |
---|
79 | @+make ctxswitch-cfa_thread.runquiet |
---|
80 | @echo -e '\t},' |
---|
81 | @echo -e '\t"mutex": [' |
---|
82 | @echo -en '\t\t' |
---|
83 | @+make mutex-cfa1.runquiet |
---|
84 | @echo -en '\t\t,' |
---|
85 | @+make mutex-cfa2.runquiet |
---|
86 | @echo -e '\t],' |
---|
87 | @echo -e '\t"scheduling": [' |
---|
88 | @echo -en '\t\t' |
---|
89 | @+make signal-cfa1.runquiet |
---|
90 | @echo -en '\t\t,' |
---|
91 | @+make signal-cfa2.runquiet |
---|
92 | @echo -en '\t\t,' |
---|
93 | @+make waitfor-cfa1.runquiet |
---|
94 | @echo -en '\t\t,' |
---|
95 | @+make waitfor-cfa2.runquiet |
---|
96 | @echo -e '\n\t],' |
---|
97 | @echo -e '\t"epoch": ' $(shell date +%s) |
---|
98 | @echo "}" |
---|
99 | |
---|
100 | ## ========================================================================================================= |
---|
101 | loop$(EXEEXT): |
---|
102 | $(COMPILE) -DBENCH_N=5000000000 loop.c |
---|
103 | |
---|
104 | function$(EXEEXT): |
---|
105 | $(COMPILE) -DBENCH_N=5000000000 function.c |
---|
106 | |
---|
107 | fetch_add$(EXEEXT): |
---|
108 | $(COMPILE) -DBENCH_N=500000000 fetch_add.c |
---|
109 | |
---|
110 | ## ========================================================================================================= |
---|
111 | CTXSWITCH_DEPEND = \ |
---|
112 | loop.run \ |
---|
113 | function.run \ |
---|
114 | fetch_add.run \ |
---|
115 | ctxswitch-pthread.run \ |
---|
116 | ctxswitch-cfa_coroutine.run \ |
---|
117 | ctxswitch-cfa_thread.run \ |
---|
118 | ctxswitch-cfa_thread2.run \ |
---|
119 | ctxswitch-upp_coroutine.run \ |
---|
120 | ctxswitch-upp_thread.run \ |
---|
121 | ctxswitch-goroutine.run \ |
---|
122 | ctxswitch-java_thread.run |
---|
123 | |
---|
124 | if WITH_LIBFIBRE |
---|
125 | CTXSWITCH_DEPEND += \ |
---|
126 | ctxswitch-kos_fibre.run \ |
---|
127 | ctxswitch-kos_fibre2.run |
---|
128 | |
---|
129 | |
---|
130 | ctxswitch-kos_fibre$(EXEEXT): |
---|
131 | @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
132 | |
---|
133 | ctxswitch-kos_fibre2$(EXEEXT): |
---|
134 | @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
135 | endif |
---|
136 | |
---|
137 | ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) |
---|
138 | |
---|
139 | ctxswitch-pthread$(EXEEXT): |
---|
140 | @$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c |
---|
141 | |
---|
142 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
143 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c |
---|
144 | |
---|
145 | ctxswitch-cfa_thread$(EXEEXT): |
---|
146 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c |
---|
147 | |
---|
148 | ctxswitch-cfa_thread2$(EXEEXT): |
---|
149 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c |
---|
150 | |
---|
151 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
152 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc |
---|
153 | |
---|
154 | ctxswitch-upp_thread$(EXEEXT): |
---|
155 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc |
---|
156 | |
---|
157 | ctxswitch-goroutine$(EXEEXT): |
---|
158 | @go build -o a.out $(srcdir)/ctxswitch/goroutine.go |
---|
159 | |
---|
160 | ctxswitch-java_thread$(EXEEXT): |
---|
161 | @javac $(srcdir)/ctxswitch/JavaThread.java |
---|
162 | @echo "#!/bin/sh" > a.out |
---|
163 | @echo "cd ctxswitch && java JavaThread" >> a.out |
---|
164 | @chmod a+x a.out |
---|
165 | |
---|
166 | ## ========================================================================================================= |
---|
167 | mutex$(EXEEXT) :\ |
---|
168 | loop.run \ |
---|
169 | function.run \ |
---|
170 | fetch_add.run \ |
---|
171 | mutex-pthread_lock.run \ |
---|
172 | mutex-upp.run \ |
---|
173 | mutex-cfa1.run \ |
---|
174 | mutex-cfa2.run \ |
---|
175 | mutex-cfa4.run \ |
---|
176 | mutex-java_thread.run |
---|
177 | |
---|
178 | mutex-pthread_lock$(EXEEXT): |
---|
179 | @$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c |
---|
180 | |
---|
181 | mutex-upp$(EXEEXT): |
---|
182 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc |
---|
183 | |
---|
184 | mutex-cfa1$(EXEEXT): |
---|
185 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c |
---|
186 | |
---|
187 | mutex-cfa2$(EXEEXT): |
---|
188 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c |
---|
189 | |
---|
190 | mutex-cfa4$(EXEEXT): |
---|
191 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c |
---|
192 | |
---|
193 | mutex-java_thread$(EXEEXT): |
---|
194 | @javac $(srcdir)/mutex/JavaThread.java |
---|
195 | @echo "#!/bin/sh" > a.out |
---|
196 | @echo "cd mutex && java JavaThread" >> a.out |
---|
197 | @chmod a+x a.out |
---|
198 | |
---|
199 | ## ========================================================================================================= |
---|
200 | signal$(EXEEXT) :\ |
---|
201 | signal-pthread_cond.run \ |
---|
202 | signal-upp.run \ |
---|
203 | signal-cfa1.run \ |
---|
204 | signal-cfa2.run \ |
---|
205 | signal-cfa4.run \ |
---|
206 | signal-java_thread.run |
---|
207 | |
---|
208 | signal-pthread_cond$(EXEEXT): |
---|
209 | @$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c |
---|
210 | |
---|
211 | signal-upp$(EXEEXT): |
---|
212 | @$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc |
---|
213 | |
---|
214 | signal-cfa1$(EXEEXT): |
---|
215 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c |
---|
216 | |
---|
217 | signal-cfa2$(EXEEXT): |
---|
218 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c |
---|
219 | |
---|
220 | signal-cfa4$(EXEEXT): |
---|
221 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c |
---|
222 | |
---|
223 | signal-java_thread$(EXEEXT): |
---|
224 | @javac $(srcdir)/schedint/JavaThread.java |
---|
225 | @echo "#!/bin/sh" > a.out |
---|
226 | @echo "cd schedint && java JavaThread" >> a.out |
---|
227 | @chmod a+x a.out |
---|
228 | |
---|
229 | |
---|
230 | ## ========================================================================================================= |
---|
231 | waitfor$(EXEEXT) :\ |
---|
232 | waitfor-upp.run \ |
---|
233 | waitfor-cfa1.run \ |
---|
234 | waitfor-cfa2.run \ |
---|
235 | waitfor-cfa4.run |
---|
236 | |
---|
237 | waitfor-upp$(EXEEXT): |
---|
238 | @$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc |
---|
239 | |
---|
240 | waitfor-cfa1$(EXEEXT): |
---|
241 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c |
---|
242 | |
---|
243 | waitfor-cfa2$(EXEEXT): |
---|
244 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c |
---|
245 | |
---|
246 | waitfor-cfa4$(EXEEXT): |
---|
247 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c |
---|
248 | |
---|
249 | ## ========================================================================================================= |
---|
250 | creation$(EXEEXT) :\ |
---|
251 | creation-pthread.run \ |
---|
252 | creation-cfa_coroutine.run \ |
---|
253 | creation-cfa_coroutine_eager.run \ |
---|
254 | creation-cfa_thread.run \ |
---|
255 | creation-upp_coroutine.run \ |
---|
256 | creation-upp_thread.run \ |
---|
257 | creation-goroutine.run \ |
---|
258 | creation-java_thread.run |
---|
259 | |
---|
260 | creation-cfa_coroutine$(EXEEXT): |
---|
261 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
262 | |
---|
263 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
264 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
265 | |
---|
266 | creation-cfa_thread$(EXEEXT): |
---|
267 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c |
---|
268 | |
---|
269 | creation-upp_coroutine$(EXEEXT): |
---|
270 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc |
---|
271 | |
---|
272 | creation-upp_thread$(EXEEXT): |
---|
273 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc |
---|
274 | |
---|
275 | creation-pthread$(EXEEXT): |
---|
276 | @$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c |
---|
277 | |
---|
278 | creation-goroutine$(EXEEXT): |
---|
279 | @go build -o a.out $(srcdir)/creation/goroutine.go |
---|
280 | |
---|
281 | creation-java_thread$(EXEEXT): |
---|
282 | @javac $(srcdir)/creation/JavaThread.java |
---|
283 | @echo "#!/bin/sh" > a.out |
---|
284 | @echo "cd creation && java JavaThread" >> a.out |
---|
285 | @chmod a+x a.out |
---|
286 | |
---|
287 | ## ========================================================================================================= |
---|
288 | |
---|
289 | compile$(EXEEXT) :\ |
---|
290 | compile-array.make \ |
---|
291 | compile-attributes.make \ |
---|
292 | compile-empty.make \ |
---|
293 | compile-expression.make \ |
---|
294 | compile-io.make \ |
---|
295 | compile-monitor.make \ |
---|
296 | compile-operators.make \ |
---|
297 | compile-typeof.make |
---|
298 | |
---|
299 | |
---|
300 | testdir = $(top_srcdir)/tests |
---|
301 | |
---|
302 | compile-array$(EXEEXT): |
---|
303 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c |
---|
304 | |
---|
305 | compile-attributes$(EXEEXT): |
---|
306 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa |
---|
307 | |
---|
308 | compile-empty$(EXEEXT): |
---|
309 | @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c |
---|
310 | |
---|
311 | compile-expression$(EXEEXT): |
---|
312 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c |
---|
313 | |
---|
314 | compile-io$(EXEEXT): |
---|
315 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c |
---|
316 | |
---|
317 | compile-monitor$(EXEEXT): |
---|
318 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c |
---|
319 | |
---|
320 | compile-operators$(EXEEXT): |
---|
321 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c |
---|
322 | |
---|
323 | compile-thread$(EXEEXT): |
---|
324 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c |
---|
325 | |
---|
326 | compile-typeof$(EXEEXT): |
---|
327 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c |
---|
328 | |
---|