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