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