[ac93b228] | 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 | |
---|
[0c1b566] | 17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names |
---|
| 18 | |
---|
[ac93b228] | 19 | # applies to both programs |
---|
[7a7ab42] | 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 | |
---|
[b7170a64] | 28 | TOOLSDIR = ${abs_top_srcdir}/tools/ |
---|
| 29 | REPEAT = ${TOOLSDIR}repeat |
---|
| 30 | STATS = ${TOOLSDIR}stat.py |
---|
| 31 | repeats = 30 |
---|
[05f4b85] | 32 | skipcompile = no |
---|
[a5b7905] | 33 | TIME_FORMAT = "%E" |
---|
[2086ab2] | 34 | PRINT_FORMAT = %20s: #Comments needed for spacing |
---|
[034165a] | 35 | |
---|
| 36 | .NOTPARALLEL: |
---|
[ac93b228] | 37 | |
---|
[b7170a64] | 38 | noinst_PROGRAMS = |
---|
[ac93b228] | 39 | |
---|
[4cedd9f] | 40 | all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) |
---|
| 41 | |
---|
[a5b7905] | 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 |
---|
[ac93b228] | 50 | |
---|
[a5b7905] | 51 | %.runquiet : |
---|
[52df81c] | 52 | @+make $(basename $@) CFLAGS="-w" |
---|
[05f4b85] | 53 | @taskset -c 1 ./a.out |
---|
[a5b7905] | 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} '",' |
---|
[05f4b85] | 69 | @DOifskipcompile@ |
---|
[91496f3] | 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},' |
---|
[05f4b85] | 74 | @DOendif@ |
---|
[a5b7905] | 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 "}" |
---|
[ac93b228] | 99 | |
---|
[d885a58] | 100 | ## ========================================================================================================= |
---|
| 101 | loop$(EXEEXT): |
---|
[7a7ab42] | 102 | $(COMPILE) -DBENCH_N=5000000000 loop.c |
---|
[d885a58] | 103 | |
---|
| 104 | function$(EXEEXT): |
---|
[7a7ab42] | 105 | $(COMPILE) -DBENCH_N=5000000000 function.c |
---|
[d885a58] | 106 | |
---|
| 107 | fetch_add$(EXEEXT): |
---|
[7a7ab42] | 108 | $(COMPILE) -DBENCH_N=500000000 fetch_add.c |
---|
[d885a58] | 109 | |
---|
[034165a] | 110 | ## ========================================================================================================= |
---|
[41cca44] | 111 | CTXSWITCH_DEPEND = \ |
---|
[d885a58] | 112 | loop.run \ |
---|
| 113 | function.run \ |
---|
| 114 | fetch_add.run \ |
---|
[b7170a64] | 115 | ctxswitch-pthread.run \ |
---|
| 116 | ctxswitch-cfa_coroutine.run \ |
---|
| 117 | ctxswitch-cfa_thread.run \ |
---|
[6810fcb] | 118 | ctxswitch-cfa_thread2.run \ |
---|
[b7170a64] | 119 | ctxswitch-upp_coroutine.run \ |
---|
[50abab9] | 120 | ctxswitch-upp_thread.run \ |
---|
| 121 | ctxswitch-goroutine.run \ |
---|
| 122 | ctxswitch-java_thread.run |
---|
[034165a] | 123 | |
---|
[41cca44] | 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 | |
---|
[6810fcb] | 139 | ctxswitch-pthread$(EXEEXT): |
---|
[7a7ab42] | 140 | @$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c |
---|
[6810fcb] | 141 | |
---|
[034165a] | 142 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
[7a7ab42] | 143 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c |
---|
[034165a] | 144 | |
---|
| 145 | ctxswitch-cfa_thread$(EXEEXT): |
---|
[7a7ab42] | 146 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c |
---|
[6810fcb] | 147 | |
---|
| 148 | ctxswitch-cfa_thread2$(EXEEXT): |
---|
[7a7ab42] | 149 | @$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c |
---|
[034165a] | 150 | |
---|
| 151 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
[7a7ab42] | 152 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc |
---|
[034165a] | 153 | |
---|
| 154 | ctxswitch-upp_thread$(EXEEXT): |
---|
[7a7ab42] | 155 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc |
---|
[ac93b228] | 156 | |
---|
[50abab9] | 157 | ctxswitch-goroutine$(EXEEXT): |
---|
[d3db83c] | 158 | @go build -o a.out $(srcdir)/ctxswitch/goroutine.go |
---|
[50abab9] | 159 | |
---|
| 160 | ctxswitch-java_thread$(EXEEXT): |
---|
[d3db83c] | 161 | @javac $(srcdir)/ctxswitch/JavaThread.java |
---|
[50abab9] | 162 | @echo "#!/bin/sh" > a.out |
---|
| 163 | @echo "cd ctxswitch && java JavaThread" >> a.out |
---|
| 164 | @chmod a+x a.out |
---|
| 165 | |
---|
[f54a0ab] | 166 | ## ========================================================================================================= |
---|
| 167 | mutex$(EXEEXT) :\ |
---|
[d885a58] | 168 | loop.run \ |
---|
| 169 | function.run \ |
---|
| 170 | fetch_add.run \ |
---|
[f54a0ab] | 171 | mutex-pthread_lock.run \ |
---|
| 172 | mutex-upp.run \ |
---|
| 173 | mutex-cfa1.run \ |
---|
| 174 | mutex-cfa2.run \ |
---|
[6aa537a4] | 175 | mutex-cfa4.run \ |
---|
| 176 | mutex-java_thread.run |
---|
[f54a0ab] | 177 | |
---|
| 178 | mutex-pthread_lock$(EXEEXT): |
---|
[7a7ab42] | 179 | @$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c |
---|
[f54a0ab] | 180 | |
---|
| 181 | mutex-upp$(EXEEXT): |
---|
[7a7ab42] | 182 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc |
---|
[f54a0ab] | 183 | |
---|
| 184 | mutex-cfa1$(EXEEXT): |
---|
[7a7ab42] | 185 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c |
---|
[f54a0ab] | 186 | |
---|
| 187 | mutex-cfa2$(EXEEXT): |
---|
[7a7ab42] | 188 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c |
---|
[f54a0ab] | 189 | |
---|
| 190 | mutex-cfa4$(EXEEXT): |
---|
[7a7ab42] | 191 | @$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c |
---|
[034165a] | 192 | |
---|
[6aa537a4] | 193 | mutex-java_thread$(EXEEXT): |
---|
[d3db83c] | 194 | @javac $(srcdir)/mutex/JavaThread.java |
---|
[6aa537a4] | 195 | @echo "#!/bin/sh" > a.out |
---|
| 196 | @echo "cd mutex && java JavaThread" >> a.out |
---|
| 197 | @chmod a+x a.out |
---|
| 198 | |
---|
[9f0b975] | 199 | ## ========================================================================================================= |
---|
| 200 | signal$(EXEEXT) :\ |
---|
[3eb4541] | 201 | signal-pthread_cond.run \ |
---|
[9f0b975] | 202 | signal-upp.run \ |
---|
| 203 | signal-cfa1.run \ |
---|
| 204 | signal-cfa2.run \ |
---|
[56de6b39] | 205 | signal-cfa4.run \ |
---|
| 206 | signal-java_thread.run |
---|
[9f0b975] | 207 | |
---|
[3eb4541] | 208 | signal-pthread_cond$(EXEEXT): |
---|
[7a7ab42] | 209 | @$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c |
---|
[3eb4541] | 210 | |
---|
[9f0b975] | 211 | signal-upp$(EXEEXT): |
---|
[7a7ab42] | 212 | @$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc |
---|
[9f0b975] | 213 | |
---|
| 214 | signal-cfa1$(EXEEXT): |
---|
[7a7ab42] | 215 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c |
---|
[9f0b975] | 216 | |
---|
| 217 | signal-cfa2$(EXEEXT): |
---|
[7a7ab42] | 218 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c |
---|
[9f0b975] | 219 | |
---|
| 220 | signal-cfa4$(EXEEXT): |
---|
[7a7ab42] | 221 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c |
---|
[9f0b975] | 222 | |
---|
[6aa537a4] | 223 | signal-java_thread$(EXEEXT): |
---|
[d3db83c] | 224 | @javac $(srcdir)/schedint/JavaThread.java |
---|
[6aa537a4] | 225 | @echo "#!/bin/sh" > a.out |
---|
| 226 | @echo "cd schedint && java JavaThread" >> a.out |
---|
| 227 | @chmod a+x a.out |
---|
| 228 | |
---|
| 229 | |
---|
[9f0b975] | 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): |
---|
[7a7ab42] | 238 | @$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc |
---|
[9f0b975] | 239 | |
---|
| 240 | waitfor-cfa1$(EXEEXT): |
---|
[7a7ab42] | 241 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c |
---|
[9f0b975] | 242 | |
---|
| 243 | waitfor-cfa2$(EXEEXT): |
---|
[7a7ab42] | 244 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c |
---|
[9f0b975] | 245 | |
---|
| 246 | waitfor-cfa4$(EXEEXT): |
---|
[7a7ab42] | 247 | @$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c |
---|
[9f0b975] | 248 | |
---|
[4cedd9f] | 249 | ## ========================================================================================================= |
---|
| 250 | creation$(EXEEXT) :\ |
---|
[3351cc0] | 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 \ |
---|
[50abab9] | 256 | creation-upp_thread.run \ |
---|
| 257 | creation-goroutine.run \ |
---|
| 258 | creation-java_thread.run |
---|
[4cedd9f] | 259 | |
---|
| 260 | creation-cfa_coroutine$(EXEEXT): |
---|
[7a7ab42] | 261 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
[4cedd9f] | 262 | |
---|
[3351cc0] | 263 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
[7a7ab42] | 264 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
[3351cc0] | 265 | |
---|
[4cedd9f] | 266 | creation-cfa_thread$(EXEEXT): |
---|
[7a7ab42] | 267 | @$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c |
---|
[4cedd9f] | 268 | |
---|
| 269 | creation-upp_coroutine$(EXEEXT): |
---|
[7a7ab42] | 270 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc |
---|
[4cedd9f] | 271 | |
---|
| 272 | creation-upp_thread$(EXEEXT): |
---|
[7a7ab42] | 273 | @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc |
---|
[4cedd9f] | 274 | |
---|
| 275 | creation-pthread$(EXEEXT): |
---|
[7a7ab42] | 276 | @$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c |
---|
[4cedd9f] | 277 | |
---|
[50abab9] | 278 | creation-goroutine$(EXEEXT): |
---|
[d3db83c] | 279 | @go build -o a.out $(srcdir)/creation/goroutine.go |
---|
[50abab9] | 280 | |
---|
| 281 | creation-java_thread$(EXEEXT): |
---|
[d3db83c] | 282 | @javac $(srcdir)/creation/JavaThread.java |
---|
[50abab9] | 283 | @echo "#!/bin/sh" > a.out |
---|
| 284 | @echo "cd creation && java JavaThread" >> a.out |
---|
| 285 | @chmod a+x a.out |
---|
| 286 | |
---|
[034165a] | 287 | ## ========================================================================================================= |
---|
| 288 | |
---|
[3edc2df] | 289 | compile$(EXEEXT) :\ |
---|
[a5b7905] | 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 |
---|
[3edc2df] | 298 | |
---|
| 299 | |
---|
[524ed86] | 300 | testdir = $(top_srcdir)/tests |
---|
[d3db83c] | 301 | |
---|
[3edc2df] | 302 | compile-array$(EXEEXT): |
---|
[7a7ab42] | 303 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c |
---|
[3edc2df] | 304 | |
---|
| 305 | compile-attributes$(EXEEXT): |
---|
[7a7ab42] | 306 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.c |
---|
[3edc2df] | 307 | |
---|
| 308 | compile-empty$(EXEEXT): |
---|
[7a7ab42] | 309 | @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c |
---|
[3edc2df] | 310 | |
---|
| 311 | compile-expression$(EXEEXT): |
---|
[7a7ab42] | 312 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c |
---|
[3edc2df] | 313 | |
---|
| 314 | compile-io$(EXEEXT): |
---|
[7a7ab42] | 315 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c |
---|
[3edc2df] | 316 | |
---|
| 317 | compile-monitor$(EXEEXT): |
---|
[7a7ab42] | 318 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c |
---|
[3edc2df] | 319 | |
---|
| 320 | compile-operators$(EXEEXT): |
---|
[7a7ab42] | 321 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c |
---|
[3edc2df] | 322 | |
---|
| 323 | compile-thread$(EXEEXT): |
---|
[7a7ab42] | 324 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c |
---|
[3edc2df] | 325 | |
---|
| 326 | compile-typeof$(EXEEXT): |
---|
[7a7ab42] | 327 | @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c |
---|
[3edc2df] | 328 | |
---|