5 echo -singleTM single machine committing transactions
6 echo -stmdebug STM debug
7 echo "-stmstats prints single machine commit (stm) statistics for the benchmark"
8 echo -fastmemcpy use fast memcpy
9 echo -sandbox sandbox transactions
10 echo -dcopts conflict optimizations for transactional memory
11 echo -transstats generates transaction stats on commits and aborts
12 echo -inlineatomic depth inline methods inside of transactions to specified depth
13 echo "-stmarray partial array treatment"
14 echo "-dualview dual view of arrays"
15 echo "-hybrid use fission only when it looks like a good choice"
16 echo "-numa numa aware"
17 echo "-eventmonitor turn on transaction event trace recording"
20 echo -coreprof, turn on profiling API
21 echo -coreprof-eventwords NUM, space in words/thread for coreprof events
22 echo -coreprof-checkoverflow, ONLY use for debugging event overflow
23 echo -coreprof-enable EVENTNAME, only enable desired events to reduce overhead
24 echo EVENTNAME can be: cpe_main, cpe_runmalloc, cpe_runfree, cpe_count_poolalloc, cpe_count_poolreuse, cpe_workschedgrab, cpe_taskdispatch, cpe_taskexecute, cpe_taskretire, cpe_taskstallvar, cpe_taskstallmem
25 echo "-ooojava <numberofcores> <maxseseage>"
26 echo -ooodebug general OOOJava debugging messages
27 echo -ooodebug-disable-task-mem-pool this is a tricky module, disable for simpler runtime
28 echo -rcr turn on runtime conflict resolver
30 echo Disjoint Reachability Analysis options
31 echo -disjoint enable analysis
32 echo -disjoint-k set k-limit for heap nodes per allocation site
33 echo "-disjoint-write-dots <all/final> write reach graphs for all method sols. or only final sols."
34 echo -disjoint-write-initial-contexts write reach graphs for callee initial contexts from all call sites
35 echo -disjoint-write-ihms write reach graphs for each call site\'s Initial Heap Model
36 echo "-disjoint-alias-file <filename> <normal/tabbed> write sharing for normal human reading or LaTeX tabbed"
37 echo "-disjoint-debug-callsite <callee> <caller> <visit to start> <num caps> <T/F stop after>"
38 echo " To debug call site, give callee caller symbols (ie foo) the analysis visit to start capturing, num captures to take, and whether to halt analysis after capturing"
39 echo "-disjoint-debug-snap-method <method> <visit to start> <num caps> <T/F stop after>"
40 echo " To take snapshots at statements, give method symbol, the analysis visit to start capturing, num captures to take, and whether to halt analsyis after capturing"
41 echo "-disjoint-dvisit-stack use stack strat to visit descriptors (tasks or methods)"
42 echo -disjoint-dvisit-stack-callees-on-top alternate stack strat
43 echo -disjoint-dvisit-pqueue use prio. q strat to visit descriptors
44 echo -disjoint-desire-determinism set above interproc for determinism
45 echo -disjoint-debug-scheduling debug when methods are scheduled for analysis
47 echo "-mlp <num cores> <max sese age> build mlp code"
48 echo -mlpdebug if mlp, report progress and interim results
51 echo -dsm distributed shared memory
52 echo -abortreaders abort readers immediately
53 echo -trueprob double - probabiltiy of true branch
54 echo -dsmcaching -enable caching in dsm runtime
56 echo BAMBOO Multicore options
57 echo -scheduling do task scheduling
58 echo "-distributioninfo execute to collect distribution info for simulated annealing in multi-core version"
59 echo "-disall execute to collect whole distribution"
60 echo "-disstart specify the start number of distribution information collection"
61 echo -multicore generate multi-core version binary
62 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
63 echo "-cacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
64 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
65 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
66 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
67 echo -printscheduling print out scheduling graphs
68 echo -printschedulesim print out scheduling simulator result graphs
69 echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
70 echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
71 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
72 echo "-raw generate raw version binary (should be used together with -multicore)"
73 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
74 echo "-tilera_memprof build the memprof version (should be used together with -tilera_xx) "
75 echo -accurateprofile build with accurate profile information including pre/post task processing info
76 echo -profile_interrupt build with profile information of interrupts
77 echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
79 echo Multicore GC options
80 echo -multicoregc generate multi-core binary with garbage collection
81 echo "-numcore4gc set the number of cores for gc (should be used together with -multicoregc), defaultly set as 0"
82 echo "-gcmem_local set the gc shared memory allocation strategy as local (should be used together with -multicoregc)"
83 echo "-gcmem_fixed set the gc shared memory allocation strategy as fixed (should be used together with -multicoregc)"
84 echo "-gcmem_mixed set the gc shared memory allocation strategy as mixed (should be used together with -multicoregc)"
85 echo "-gcmem_global set the gc shared memory allocation strategy as global (should be used together with -multicoregc)"
86 echo "-gccache_local set the gc shared memory cache strategy as local (should be used together with -multicoregc)"
87 echo "-gccache_ran set the gc shared memory cache strategy as random (should be used together with -multicoregc)"
88 echo "-gccontroller_near set the gc shared memory to use the nearest controller for each core (should be used together with -multicoregc)"
89 echo "-gccontroller_remote set the gc shared memory to use a remote controller for each core (should be used together with -multicoregc)"
90 echo "-gcsmallpagesize(2) set the gc shared memory to use small page size (should be used together with -multicoregc)"
91 echo "-gclargepagesize set the gc shared memory to use large page size (should be used together with -multicoregc)"
92 echo "-gclargesharedheap(2) set the gc shared memory as large (should be used together with -multicoregc)"
93 echo "-gccacheadapt setup as cacheadaptable mode (should be used together with -multicoregc)"
94 echo -gcprofile build with gcprofile options
95 echo -mgc generate Multicore GC binary without task stuff
98 echo -abcclose turnoff array boundary checks
99 echo -builddir setup different build directory
100 echo -robustroot set up the ROBUSTROOT to directory other than default one
101 echo -readset turn on readset
102 echo -mac distributed shared memory mac support
103 echo -check generate check code
104 echo -dmalloc link in dmalloc
105 echo -64bit compile for 64 bit machine
106 echo -32bit compile for 32 bit machine
107 echo -joptimize java compiler optimizations
108 echo -noloop turnoff loop optimizations
109 echo -recover compile task code
110 echo -fastcheck fast checkpointing for Bristlecone
111 echo -specdir directory
112 echo -printflat print out flat representation
113 echo -selfloop task - this task cannot self loop forever
114 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
115 echo -taskstate do task state analysis
116 echo -tagstate do tag state analysis
117 echo -optional enable optional
118 echo -debug generate debug symbols
119 echo -prefetch do prefetch analysis
120 echo -heapsize-mb NUM set initial heap size in MB, default is 256
121 echo -garbagestats Print garbage collection statistics
122 echo -webinterface enable web interface
123 echo -runtimedebug printout runtime debug messages
124 echo "-thread use support for multiple threads"
125 echo "-optimize call gcc with -O9 (optimize)"
126 echo "-nooptimize call gcc with -O0 (do not optimize)"
127 echo -curdir directory
128 echo -mainclass class with main method
130 echo -nojava do not run bristlecone compiler
131 echo -instructionfailures inject code for instructionfailures
132 echo -profile build with profile options
133 echo "-enable-assertions execute assert statements during compilation"
134 echo -justanalyze exit after compiler analyses complete
135 echo -assembly generate assembly
136 echo -recovery compile recovery code
137 echo -dsmtask support work and task class library
138 echo -recoverystats print out recovery record
142 tmpbuilddirectory="tmpbuilddirectory"
147 ROBUSTROOT=~/research/Robust/src
148 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
149 STMRUNTIME=$ROBUSTROOT/Runtime/STM/
150 DSMRECOVERYRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface_recovery/
151 REPAIRROOT=~/research/Repair/RepairCompiler/
170 TILERAZLINUXFLAG=false
171 TILERAMEMPROFFLAG=false
180 ACCURATEPROFILEFLAG=false
181 PROFILEINTERRUPTFLAG=false
184 THREADSIMULATEFLAG=false;
185 MULTICOREGCFLAG=false;
186 GCMEMLOCALFLAG=false;
187 GCMEMFIXEDFLAG=false;
188 GCMEMMIXEDFLAG=false;
189 GCMEMGLOBALFLAG=false;
190 GCCACHELOCALFLAG=false;
191 GCCACHERANFLAG=false;
192 GCCONTROLLERNEARFLAG=false;
193 GCCONTROLLERREMOTEFLAG=false;
194 GCSMALLPAGESIZEFLAG=false;
195 GCLARGEPAGESIZEFLAG=false;
196 GCLARGEPAGESIZE2FLAG=false;
197 GCLARGESHAREDHEAPFLAG=false;
198 GCSMALLPAGESIZEFLAG2=false;
199 GCLARGESHAREDHEAPFLAG2=false;
200 GCCACHEADAPTFLAG=false
201 GCCACHEADAPTPOLICYFLAG=false
202 GCCACHEADAPTPOLICY=''
203 GCCACHESAMPLINGFLAG=false
215 EXITAFTERANALYSIS=false
218 TILERAN1COREFLAG=false
219 TILERA56COREFLAG=false
229 if [[ $1 = '-help' ]]
233 elif [[ $1 = '-justanalyze' ]]
235 EXITAFTERANALYSIS=true
236 elif [[ $1 = '-assembly' ]]
239 elif [[ $1 = '-abortreaders' ]]
242 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
243 JAVAOPTS="$JAVAOPTS -abortreaders"
244 elif [[ $1 = '-sandbox' ]]
247 EXTRAOPTIONS="$EXTRAOPTIONS -DSANDBOX"
248 JAVAOPTS="$JAVAOPTS -sandbox"
249 elif [[ $1 = '-numa' ]]
251 EXTRAOPTIONS="$EXTRAOPTIONS -DAFFINITY -D_GNU_SOURCE"
253 elif [[ $1 = '-robustroot' ]]
257 elif [[ $1 = '-builddir' ]]
259 tmpbuilddirectory="$2"
261 elif [[ $1 = '-nojava' ]]
264 elif [[ $1 = '-eventmonitor' ]]
266 JAVAOPTS="$JAVAOPTS -eventmonitor"
268 EXTRAOPTIONS="$EXTRAOPTIONS -DEVENTMONITOR"
269 elif [[ $1 = '-garbagestats' ]]
271 EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
272 elif [[ $1 = '-64bit' ]]
274 EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64 -m64"
275 elif [[ $1 = '-32bit' ]]
277 EXTRAOPTIONS="$EXTRAOPTIONS -m32"
278 elif [[ $1 = '-fastcheck' ]]
280 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
281 JAVAOPTS="$JAVAOPTS -fastcheck"
287 elif [[ $1 = '-mainclass' ]]
289 JAVAOPTS="$JAVAOPTS -mainclass $2"
291 elif [[ $1 = '-selfloop' ]]
293 JAVAOPTS="$JAVAOPTS -selfloop $2"
295 elif [[ $1 = '-excprefetch' ]]
297 JAVAOPTS="$JAVAOPTS -excprefetch $2"
299 elif [[ $1 = '-arraypad' ]]
301 JAVAOPTS="$JAVAOPTS -arraypad"
302 elif [[ $1 = '-dsm' ]]
304 JAVAOPTS="$JAVAOPTS -dsm"
306 elif [[ $1 = '-fastmemcpy' ]]
309 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTMEMCPY"
310 elif [[ $1 = '-singleTM' ]]
312 JAVAOPTS="$JAVAOPTS -singleTM"
313 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
315 elif [[ $1 = '-stmarray' ]]
317 JAVAOPTS="$JAVAOPTS -stmarray"
318 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMARRAY"
320 elif [[ $1 = '-dualview' ]]
322 JAVAOPTS="$JAVAOPTS -dualview"
323 EXTRAOPTIONS="$EXTRAOPTIONS -DDUALVIEW"
325 elif [[ $1 = '-readset' ]]
327 JAVAOPTS="$JAVAOPTS -readset"
328 EXTRAOPTIONS="$EXTRAOPTIONS -DREADSET"
329 elif [[ $1 = '-stmdebug' ]]
331 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
332 elif [[ $1 = '-stmstats' ]]
334 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
335 elif [[ $1 = '-stmlog' ]]
337 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMLOG"
338 elif [[ $1 = '-prefetch' ]]
340 JAVAOPTS="$JAVAOPTS -prefetch"
341 elif [[ $1 = '-transstats' ]]
343 EXTRAOPTIONS="$EXTRAOPTIONS -DTRANSSTATS"
344 elif [[ $1 = '-printflat' ]]
346 JAVAOPTS="$JAVAOPTS -printflat"
347 elif [[ $1 = '-trueprob' ]]
349 JAVAOPTS="$JAVAOPTS -trueprob $2"
351 elif [[ $1 = '-inlineatomic' ]]
353 JAVAOPTS="$JAVAOPTS -inlineatomic $2"
355 elif [[ $1 = '-mac' ]]
357 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
358 elif [[ $1 = '-profile' ]]
361 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
362 elif [[ $1 = '-gcprofile' ]]
365 elif [[ $1 = '-gcprofile_s' ]]
368 elif [[ $1 = '-accurateprofile' ]]
370 ACCURATEPROFILEFLAG=true
371 elif [[ $1 = '-profile_interrupt' ]]
373 PROFILEINTERRUPTFLAG=true
374 elif [[ $1 = '-useio' ]]
377 elif [[ $1 = '-taskstate' ]]
379 JAVAOPTS="$JAVAOPTS -taskstate"
380 elif [[ $1 = '-tagstate' ]]
382 JAVAOPTS="$JAVAOPTS -tagstate"
383 elif [[ $1 = '-scheduling' ]]
385 JAVAOPTS="$JAVAOPTS -scheduling"
386 elif [[ $1 = '-multicore' ]]
389 JAVAOPTS="$JAVAOPTS -multicore"
390 elif [[ $1 = '-numcore' ]]
392 JAVAOPTS="$JAVAOPTS -numcore $2"
393 if [[ "$2" -gt "1" ]]
395 TILERAN1COREFLAG=true
396 if [[ "$2" -eq "56" ]]
398 TILERA56COREFLAG=true
402 elif [[ $1 = '-numcore4gc' ]]
404 JAVAOPTS="$JAVAOPTS -numcore4gc $2"
407 elif [[ $1 = '-raw' ]]
410 JAVAOPTS="$JAVAOPTS -raw"
411 elif [[ $1 = '-tilera_bme' ]]
415 elif [[ $1 = '-tilera_zlinux' ]]
418 TILERAZLINUXFLAG=true
419 elif [[ $1 = '-tilera_memprof' ]]
421 TILERAMEMPROFFLAG=true
422 elif [[ $1 = '-tileraconfig' ]]
426 elif [[ $1 = '-cacheflush' ]]
429 elif [[ $1 = '-rawconfig' ]]
433 elif [[ $1 = '-interrupt' ]]
436 elif [[ $1 = '-abcclose' ]]
438 JAVAOPTS="$JAVAOPTS -abcclose"
439 elif [[ $1 = '-optional' ]]
441 JAVAOPTS="$JAVAOPTS -optional"
443 elif [[ $1 = '-multicoregc' ]]
446 JAVAOPTS="$JAVAOPTS -multicoregc"
447 elif [[ $1 = '-gcmem_local' ]]
450 elif [[ $1 = '-gcmem_fixed' ]]
453 elif [[ $1 = '-gcmem_mixed' ]]
456 elif [[ $1 = '-gcmem_global' ]]
459 elif [[ $1 = '-gccache_local' ]]
461 GCCACHELOCALFLAG=true
462 elif [[ $1 = '-gccache_ran' ]]
465 elif [[ $1 = '-gccontroller_near' ]]
467 GCCONTROLLERNEARFLAG=true
468 elif [[ $1 = '-gccontroller_remote' ]]
470 GCCONTROLLERREMOTEFLAG=true
471 elif [[ $1 = '-gcsmallpagesize' ]]
473 GCSMALLPAGESIZEFLAG=true
474 elif [[ $1 = '-gcsmallpagesize2' ]]
476 GCSMALLPAGESIZEFLAG2=true
477 elif [[ $1 = '-gclargepagesize' ]]
479 GCLARGEPAGESIZEFLAG=true
480 elif [[ $1 = '-gclargepagesize2' ]]
482 GCLARGEPAGESIZE2FLAG=true
483 elif [[ $1 = '-gclargesharedheap' ]]
485 GCLARGESHAREDHEAPFLAG=true
486 elif [[ $1 = '-gclargesharedheap2' ]]
488 GCLARGESHAREDHEAPFLAG2=true
489 elif [[ $1 = '-gccacheadapt' ]]
491 GCCACHEADAPTFLAG=true
492 elif [[ $1 = '-gccacheadaptpolicy' ]]
494 GCCACHEADAPTPOLICYFLAG=true
495 GCCACHEADAPTPOLICY="$2"
497 elif [[ $1 = '-gccachesampling' ]]
499 GCCACHESAMPLINGFLAG=true
500 elif [[ $1 = '-mgc' ]]
503 elif [[ $1 = '-dmalloc' ]]
506 elif [[ $1 = '-recover' ]]
509 JAVAOPTS="$JAVAOPTS -task"
510 elif [[ $1 = '-useprofile' ]]
512 JAVAOPTS="$JAVAOPTS -useprofile $2"
514 elif [[ $1 = '-webinterface' ]]
516 JAVAOPTS="$JAVAOPTS -webinterface"
517 elif [[ $1 = '-instructionfailures' ]]
519 JAVAOPTS="$JAVAOPTS -instructionfailures"
520 elif [[ $1 = '-joptimize' ]]
522 JAVAOPTS="$JAVAOPTS -optimize"
523 elif [[ $1 = '-noloop' ]]
525 JAVAOPTS="$JAVAOPTS -noloop"
526 elif [[ $1 = '-dcopts' ]]
528 JAVAOPTS="$JAVAOPTS -dcopts"
529 elif [[ $1 = '-delaycomp' ]]
531 JAVAOPTS="$JAVAOPTS -delaycomp"
532 EXTRAOPTIONS="$EXTRAOPTIONS -DDELAYCOMP"
533 elif [[ $1 = '-hybrid' ]]
535 JAVAOPTS="$JAVAOPTS -hybrid"
536 EXTRAOPTIONS="$EXTRAOPTIONS -DHYBRID"
537 elif [[ $1 = '-minimize' ]]
539 JAVAOPTS="$JAVAOPTS -minimize"
541 elif [[ $1 = '-ooojava' ]]
544 JAVAOPTS="$JAVAOPTS -ooojava $2 $3"
545 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
549 elif [[ $1 = '-ooodebug-disable-task-mem-pool' ]]
551 EXTRAOPTIONS="$EXTRAOPTIONS -DOOO_DISABLE_TASKMEMPOOL"
553 elif [[ $1 = '-heapsize-mb' ]]
555 EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
558 elif [[ $1 = '-rcr' ]]
560 JAVAOPTS="$JAVAOPTS -rcr"
562 EXTRAOPTIONS="$EXTRAOPTIONS -I$ROBUSTROOT/Runtime/oooJava"
565 elif [[ $1 = '-coreprof' ]]
568 JAVAOPTS="$JAVAOPTS -coreprof"
569 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF -I$ROBUSTROOT/Runtime/coreprof"
571 elif [[ $1 = '-coreprof-eventwords' ]]
573 EXTRAOPTIONS="$EXTRAOPTIONS -DCP_MAXEVENTWORDS=($2)"
576 elif [[ $1 = '-coreprof-checkoverflow' ]]
578 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF_CHECKOVERFLOW"
580 elif [[ $1 = '-coreprof-enable' ]]
582 EXTRAOPTIONS="$EXTRAOPTIONS -D$2"
585 elif [[ $1 = '-mlp' ]]
588 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
589 JAVAOPTS="$JAVAOPTS -mlp $2 $3"
593 elif [[ $1 = '-mlpdebug' ]]
595 JAVAOPTS="$JAVAOPTS -mlpdebug"
597 elif [[ $1 = '-check' ]]
600 JAVAOPTS="$JAVAOPTS -conscheck"
601 elif [[ $1 = '-enable-assertions' ]]
603 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
604 elif [[ $1 = '-specdir' ]]
610 elif [[ $1 = '-debug' ]]
613 EXTRAOPTIONS="$EXTRAOPTIONS -g -rdynamic"
614 elif [[ $1 = '-rawpath' ]]
617 elif [[ $1 = '-runtimedebug' ]]
619 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
620 elif [[ $1 = '-dsmcaching' ]]
622 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
623 elif [[ $1 = '-rangeprefetch' ]]
625 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
626 elif [[ $1 = '-nooptimize' ]]
628 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
629 elif [[ $1 = '-optimize' ]]
631 EXTRAOPTIONS="$EXTRAOPTIONS -O3"
632 elif [[ $1 = '-thread' ]]
634 JAVAOPTS="$JAVAOPTS -thread"
635 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
637 elif [[ $1 = '-recovery' ]]
639 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERY"
641 elif [[ $1 = '-recoverystats' ]]
643 JAVAOPTS="$JAVAOPTS -recoverystats"
644 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERYSTATS"
645 elif [[ $1 = '-distributioninfo' ]]
647 JAVAOPTS="$JAVAOPTS -distributioninfo"
648 elif [[ $1 = '-disall' ]]
650 JAVAOPTS="$JAVAOPTS -disall"
651 elif [[ $1 = '-disstart' ]]
653 JAVAOPTS="$JAVAOPTS -disstart $2"
655 elif [[ $1 = '-noc' ]]
658 elif [[ $1 = '-curdir' ]]
662 elif [[ $1 = '-outputdir' ]]
664 JAVAOPTS="$JAVAOPTS -outputdir $2"
667 SRCFILES="$SRCFILES $1"
672 BUILDDIR="$CURDIR/$tmpbuilddirectory"
674 BAMBOORUNTIME=$ROBUSTROOT/Runtime/bamboo
682 if $CHECKFLAG #Generate structure files for repair tool
684 JAVAOPTS="$JAVAOPTS -struct structfile"
694 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
696 #base bristlecone files
697 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
703 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
706 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
709 #threading java stuff
710 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
713 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
716 # Build bristlecone/java sources
720 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
721 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
722 -dir $BUILDDIR $JAVAOPTS $SRCFILES
726 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
729 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
730 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
737 if $EXITAFTERANALYSIS
742 # Build all of the consistency specs
744 if $CHECKFLAG # CHECKFLAG
747 mkdir $BUILDDIR/specdir
748 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
750 echo > $BUILDDIR/specs
752 # compile specs into C code
753 for i in * # iterate over all directories
755 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
758 cat $BUILDDIR/structfile.struct $i.label > $i.struct
759 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
760 cp size.[c,h] $BUILDDIR/specdir
761 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
762 echo $i >> $BUILDDIR/specs
764 done # iterate over all directories
770 echo > $BUILDDIR/checkers.h
771 for i in `cat $BUILDDIR/specs`
773 gcc -O0 -g -fbounds-check -c $i\_aux.c
774 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
778 #build and link everything
783 MAKEFILE="Makefile.raw"
789 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
793 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
798 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
803 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DDEBUG"
807 then # profile version
808 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
811 if $ACCURATEPROFILEFLAG
812 then # accurateprofile version
813 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DACCURATEPROFILE"
818 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
822 then #INTERRUPT version
823 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
824 fi #INTERRUPT version
828 MAKEFILE="$MAKEFILE.io"
829 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
831 MAKEFILE="$MAKEFILE.$RAWCONFIG"
834 cp $BAMBOORUNTIME/RAW/$MAKEFILE ./Makefile
840 cp ../Runtime/coreprof/*.c ./coreprof/
841 cp ../Runtime/coreprof/*.h ./coreprof/
842 cp $BAMBOORUNTIME/*.c ./
843 cp $BAMBOORUNTIME/*.h ./
844 cp $BAMBOORUNTIME/RAW/*.c ./
845 cp $BAMBOORUNTIME/RAW/*.h ./
846 cp $BAMBOORUNTIME/RAW/*.S ./
847 cp $BAMBOORUNTIME/RAW/*.s ./
848 cp ../$tmpbuilddirectory/*.c ./
849 cp ../$tmpbuilddirectory/*.h ./
855 TILERADIR="$CURDIR/tilera"
859 MAKEFILE="Makefile.tilera.$TILERACONFIG"
860 SIMHVC="sim.hvc.$TILERACONFIG"
861 PCIHVC="pci.hvc.$TILERACONFIG"
866 elif $TILERAZLINUXFLAG
867 then # TILERAZLINUXFLAG
868 TILERA_INDIR="ZLinux"
869 MAKEFILE="Makefile.tilera.$TILERACONFIG"
877 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
879 if $TILERAMEMPROFFLAG
880 then # not only with 1 core
881 PCIHVC="$PCIHVC.memprof"
882 TILERACFLAGS="${TILERACFLAGS} -DBAMBOO_MEMPROF"
887 TILERACFLAGS="${TILERACFLAGS} -DTILERA_BME"
888 elif $TILERAZLINUXFLAG
889 then # TILERAZLINUXFLAG
890 TILERACFLAGS="${TILERACFLAGS} -DTILERA_ZLINUX"
895 TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
900 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
905 TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
909 then # profile version
910 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
913 if $ACCURATEPROFILEFLAG
914 then # accurateprofile version
915 TILERACFLAGS="${TILERACFLAGS} -DACCURATEPROFILE"
918 if $PROFILEINTERRUPTFLAG
919 then # profile_interrupt version
920 TILERACFLAGS="${TILERACFLAGS} -DPROFILE_INTERRUPT"
925 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
929 then #INTERRUPT version
930 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
931 fi #INTERRUPT version
935 TILERACFLAGS="${TILERACFLAGS} -DMGC"
939 then #MULTICOREGC version
940 TILERACFLAGS="${TILERACFLAGS} -DMULTICORE_GC -D${GCCORES}"
944 then # GC_PROFILE version
945 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
949 then # GC_PROFILE_S version
950 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE_S"
954 then # SMEMLOCAL version
955 TILERACFLAGS="${TILERACFLAGS} -DSMEML"
959 then # SMEMFIXED version
960 TILERACFLAGS="${TILERACFLAGS} -DSMEMF"
964 then # SMEMMIXED version
965 TILERACFLAGS="${TILERACFLAGS} -DSMEMM"
969 then # SMEMGLOBAL version
970 TILERACFLAGS="${TILERACFLAGS} -DSMEMG"
974 then # CACHE_LOCAL version
975 TILERACFLAGS="${TILERACFLAGS} -DCACHE_LOCAL"
979 then # CACHE_RAN version
980 TILERACFLAGS="${TILERACFLAGS} -DCACHE_RAN"
983 if $GCCONTROLLERNEARFLAG
984 then # CONTROLLER_NEAR version
985 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_NEAR"
988 if $GCCONTROLLERREMOTEFLAG
989 then # CONTROLLER_REMOTE version
990 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_REMOTE"
993 if $GCSMALLPAGESIZEFLAG
994 then # GC_SMALLPAGESIZE version
995 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE"
998 if $GCLARGEPAGESIZEFLAG
999 then # GC_LARGEPAGESIZE version
1000 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE"
1003 if $GCLARGEPAGESIZE2FLAG
1004 then # GC_LARGEPAGESIZE2 version
1005 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE2"
1008 if $GCLARGESHAREDHEAPFLAG
1009 then # GC_LARGESHAREDHEAP version
1010 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP"
1013 if $GCSMALLPAGESIZEFLAG2
1014 then # GC_SMALLPAGESIZE2 version
1015 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE2"
1018 if $GCLARGESHAREDHEAPFLAG2
1019 then # GC_LARGESHAREDHEAP2 version
1020 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP2"
1023 if $GCCACHEADAPTFLAG
1024 then # GC_CACHE_ADAPT version
1025 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT"
1028 if $GCCACHEADAPTPOLICYFLAG
1029 then # GC_CACHE_ADAPT version
1030 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT_POLICY${GCCACHEADAPTPOLICY}"
1033 if $GCCACHESAMPLINGFLAG
1034 then # GC_CACHE_ADAPT version
1035 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_SAMPLING"
1038 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
1040 then # TILERABMEFLAG
1041 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
1042 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
1043 if $TILERA56COREFLAG
1045 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc.56 ./bamboo-vmlinux-pci.hvc.56
1047 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
1050 cp ../Runtime/Queue.c ./
1051 cp ../Runtime/file.c ./
1052 cp ../Runtime/math.c ./
1053 cp ../Runtime/object.c ./
1054 cp ../Runtime/GenericHashtable.c ./
1055 cp ../Runtime/SimpleHash.c ./
1056 cp ../Runtime/ObjectHash.c ./
1057 cp ../Runtime/socket.c ./
1058 cp ../Runtime/mem.c ./
1059 cp ../Runtime/GenericHashtable.h ./
1060 cp ../Runtime/mem.h ./
1061 cp ../Runtime/object.h ./
1062 cp ../Runtime/ObjectHash.h ./
1063 cp ../Runtime/Queue.h ./
1064 cp ../Runtime/runtime.h ./
1065 cp ../Runtime/SimpleHash.h ./
1067 cp ../Runtime/coreprof/coreprof.c ./coreprof/
1068 cp ../Runtime/coreprof/coreprof.h ./coreprof/
1069 cp $BAMBOORUNTIME/multicoretask.c ./
1070 cp $BAMBOORUNTIME/multicoreruntime.c ./
1071 cp $BAMBOORUNTIME/multicoremem.c ./
1072 cp $BAMBOORUNTIME/multicoregarbage.c ./
1073 cp $BAMBOORUNTIME/GCSharedHash.c ./
1074 cp $BAMBOORUNTIME/MGCHash.c ./
1075 cp $BAMBOORUNTIME/multicoreruntime.h ./
1076 cp $BAMBOORUNTIME/multicoremem.h ./
1077 cp $BAMBOORUNTIME/multicoregarbage.h ./
1078 cp $BAMBOORUNTIME/multicorecache.h ./
1079 cp $BAMBOORUNTIME/multicoregc.h ./
1080 cp $BAMBOORUNTIME/multicorehelper.h ./
1081 cp $BAMBOORUNTIME/GCSharedHash.h ./
1082 cp $BAMBOORUNTIME/MGCHash.h ./
1083 cp ../Tilera/Runtime/*.c ./
1084 cp ../Tilera/Runtime/*.h ./
1085 cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
1086 cp ../Tilera/Runtime/$TILERA_INDIR/*.h ./
1087 if $TILERAZLINUXFLAG
1088 then # TILERAZLINUXFLAG
1089 cp ../Tilera/Runtime/$TILERA_INDIR/*.S ./
1091 #if $TILERAMEMPROFFLAG
1092 #then # TILERAMEMPROFFLAG
1093 cp ../Tilera/Runtime/$TILERA_INDIR/linux_client.c ./
1095 cp ../Tilera/lib/* ./
1096 cp ../$tmpbuilddirectory/*.c ./
1097 cp ../$tmpbuilddirectory/*.h ./
1101 else #!RAWFLAG && !TILERABMEFLAG && ! TILERAZLINUXFLAG
1104 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
1109 RUNTIMEFILE="$BAMBOORUNTIME/multicoreruntime.c $BAMBOORUNTIME/multicoretask.c"
1110 INCLUDES="$INCLUDES -I$BAMBOORUNTIME"
1112 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
1115 FILES="$RUNTIMEFILE \
1116 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
1117 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
1118 $ROBUSTROOT/Runtime/ObjectHash.c \
1119 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
1120 $ROBUSTROOT/Runtime/math.c \
1121 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
1125 FILES="$FILES $ROBUSTROOT/Runtime/affinity.c"
1130 FILES="$FILES $ROBUSTROOT/Runtime/STM/monitor.c"
1135 FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
1142 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRECOVERYRUNTIME"
1143 FILES="$FILES $DSMRECOVERYRUNTIME/trans.c $DSMRECOVERYRUNTIME/mcpileq.c $DSMRECOVERYRUNTIME/objstr.c $DSMRECOVERYRUNTIME/dstm.c $DSMRECOVERYRUNTIME/altmlookup.c $DSMRECOVERYRUNTIME/clookup.c $DSMRECOVERYRUNTIME/llookup.c $DSMRECOVERYRUNTIME/tlookup.c $DSMRECOVERYRUNTIME/threadnotify.c $DSMRECOVERYRUNTIME/dstmserver.c $DSMRECOVERYRUNTIME/plookup.c $DSMRECOVERYRUNTIME/ip.c $DSMRECOVERYRUNTIME/queue.c $DSMRECOVERYRUNTIME/altprelookup.c $DSMRECOVERYRUNTIME/machinepile.c $ROBUSTROOT/Runtime/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRECOVERYRUNTIME/sockpool.c $DSMRECOVERYRUNTIME/addUdpEnhance.c $DSMRECOVERYRUNTIME/signal.c $DSMRECOVERYRUNTIME/gCollect.c $DSMRECOVERYRUNTIME/addPrefetchEnhance.c $DSMRECOVERYRUNTIME/dsmlock.c $DSMRECOVERYRUNTIME/translist.c $DSMRECOVERYRUNTIME/paxos.c"
1145 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
1146 FILES="$FILES $DSMRUNTIME/trans.c $DSMRUNTIME/mcpileq.c $DSMRUNTIME/objstr.c $DSMRUNTIME/dstm.c $DSMRUNTIME/clookup.c $DSMRUNTIME/llookup.c $DSMRUNTIME/threadnotify.c $DSMRUNTIME/dstmserver.c $DSMRUNTIME/plookup.c $DSMRUNTIME/ip.c $DSMRUNTIME/queue.c $DSMRUNTIME/altprelookup.c $DSMRUNTIME/machinepile.c $ROBUSTROOT/Runtime/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRUNTIME/sockpool.c $DSMRUNTIME/addUdpEnhance.c $DSMRUNTIME/signal.c $DSMRUNTIME/gCollect.c $DSMRUNTIME/addPrefetchEnhance.c $DSMRUNTIME/dsmlock.c $DSMRUNTIME/prefetch.c $DSMRUNTIME/altmlookup.c"
1152 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$STMRUNTIME"
1153 FILES="$FILES $STMRUNTIME/stmlock.c $STMRUNTIME/stm.c $STMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c $STMRUNTIME/stats.c $STMRUNTIME/commit.c $STMRUNTIME/objstr.c"
1160 FILES="$FILES $DSMRUNTIME/sandbox.c"
1162 FILES="$FILES $STMRUNTIME/sandbox.c"
1168 FILES="$FILES $DSMRUNTIME/abortreaders.c"
1173 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
1178 FILES="$FILES $ROBUSTROOT/Runtime/coreprof/coreprof.c"
1183 FILES="$FILES $tmpbuilddirectory/RuntimeConflictResolver.c $ROBUSTROOT/Runtime/oooJava/hashRCR.c $ROBUSTROOT/Runtime/oooJava/Queue_RCR.c"
1188 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
1189 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
1190 FILES="$FILES $ROBUSTROOT/Runtime/workschedule.c"
1195 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
1198 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
1200 FILES="$FILES $tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
1203 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
1205 if $THREADSIMULATEFLAG
1207 # -lpthread for pthread functions, -lrt for message queue functions
1208 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
1214 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
1215 FILES="$FILES $tmpbuilddirectory/optionalarrays.c"
1220 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
1225 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
1226 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
1231 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
1235 echo EXTRAOPTIONS=$EXTRAOPTIONS
1239 gcc -S $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
1240 -c $tmpbuilddirectory/methods.c -lm
1245 gcc $INCLUDES $EXTRAOPTIONS \
1246 $tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
1248 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
1249 $tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin