4 echo -robustroot set up the ROBUSTROOT to directory other than default one
5 echo -dsm distributed shared memory
6 echo -singleTM single machine committing transactions
7 echo -abortreaders abort readers immediately
8 echo -trueprob double - probabiltiy of true branch
9 echo -dsmcaching -enable caching in dsm runtime
10 echo -mac distributed shared memory mac support
11 echo -check generate check code
12 echo -dmalloc link in dmalloc
13 echo -recover compile task code
14 echo -fastcheck fast checkpointing for Bristlecone
15 echo -specdir directory
16 echo -printflat print out flat representation
17 echo -selfloop task - this task cannot self loop forever
18 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
19 echo -taskstate do task state analysis
20 echo -tagstate do tag state analysis
21 echo -scheduling do task scheduling
22 echo -multicore generate multi-core version binary
23 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
24 echo "-raw generate raw version binary (should be used together with -multicore)"
25 echo "-rawcacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
26 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
27 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
28 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
29 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
30 echo -threadsimulate generate multi-thread simulate version binary
31 echo -printscheduling print out scheduling graphs
32 echo -printschedulesim print out scheduling simulator result graphs
33 echo -abcclose close the array boundary check
34 echo -optional enable optional
35 echo -debug generate debug symbols
36 echo -prefetch do prefetch analysis
37 echo -transstats generates transaction stats on commits and aborts
38 echo -webinterface enable web interface
39 echo -runtimedebug printout runtime debug messages
40 echo "-thread use support for multiple threads"
41 echo "-optimize call gcc with -O9 (optimize)"
42 echo "-nooptimize call gcc with -O0 (do not optimize)"
43 echo -curdir directory
44 echo -mainclass class with main method
46 echo -nojava do not run bristlecone compiler
47 echo -instructionfailures inject code for instructionfailures
48 echo -profile build with profile options
49 echo "-rawuseio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
50 echo "-enable-assertions execute assert statements during compilation"
51 echo -justanalyze exit after compiler analyses complete
56 ROBUSTROOT=~/research/Robust/src
57 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
58 REPAIRROOT=~/research/Repair/RepairCompiler/
69 RAWCACHEFLUSHFLAG=false
76 THREADSIMULATEFLAG=false;
87 EXITAFTERANALYSIS=false
101 elif [[ $1 = '-justanalyze' ]]
103 EXITAFTERANALYSIS=true
104 elif [[ $1 = '-abortreaders' ]]
107 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
108 JAVAOPTS="$JAVAOPTS -abortreaders"
109 elif [[ $1 = '-robustroot' ]]
113 elif [[ $1 = '-nojava' ]]
116 elif [[ $1 = '-fastcheck' ]]
118 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
119 JAVAOPTS="$JAVAOPTS -fastcheck"
125 elif [[ $1 = '-mainclass' ]]
127 JAVAOPTS="$JAVAOPTS -mainclass $2"
129 elif [[ $1 = '-selfloop' ]]
131 JAVAOPTS="$JAVAOPTS -selfloop $2"
133 elif [[ $1 = '-excprefetch' ]]
135 JAVAOPTS="$JAVAOPTS -excprefetch $2"
137 elif [[ $1 = '-dsm' ]]
139 JAVAOPTS="$JAVAOPTS -dsm"
141 elif [[ $1 = '-singleTM' ]]
143 JAVAOPTS="$JAVAOPTS -singleTM"
144 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
146 elif [[ $1 = '-prefetch' ]]
148 JAVAOPTS="$JAVAOPTS -prefetch"
149 elif [[ $1 = '-transstats' ]]
152 elif [[ $1 = '-printflat' ]]
154 JAVAOPTS="$JAVAOPTS -printflat"
155 elif [[ $1 = '-trueprob' ]]
157 JAVAOPTS="$JAVAOPTS -trueprob $2"
159 elif [[ $1 = '-mac' ]]
161 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
162 elif [[ $1 = '-profile' ]]
165 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
166 elif [[ $1 = '-rawuseio' ]]
169 elif [[ $1 = '-taskstate' ]]
171 JAVAOPTS="$JAVAOPTS -taskstate"
172 elif [[ $1 = '-tagstate' ]]
174 JAVAOPTS="$JAVAOPTS -tagstate"
175 elif [[ $1 = '-scheduling' ]]
177 JAVAOPTS="$JAVAOPTS -scheduling"
178 elif [[ $1 = '-multicore' ]]
181 JAVAOPTS="$JAVAOPTS -multicore"
182 elif [[ $1 = '-numcore' ]]
184 JAVAOPTS="$JAVAOPTS -numcore $2"
186 elif [[ $1 = '-raw' ]]
189 JAVAOPTS="$JAVAOPTS -raw"
190 elif [[ $1 = '-rawcacheflush' ]]
192 RAWCACHEFLUSHFLAG=true
193 elif [[ $1 = '-rawconfig' ]]
197 elif [[ $1 = '-interrupt' ]]
200 elif [[ $1 = '-threadsimulate' ]]
202 THREADSIMULATEFLAG=true
203 elif [[ $1 = '-abcclose' ]]
205 JAVAOPTS="$JAVAOPTS -abcclose"
206 elif [[ $1 = '-optional' ]]
208 JAVAOPTS="$JAVAOPTS -optional"
210 elif [[ $1 = '-dmalloc' ]]
213 elif [[ $1 = '-recover' ]]
216 JAVAOPTS="$JAVAOPTS -task"
217 elif [[ $1 = '-useprofile' ]]
219 JAVAOPTS="$JAVAOPTS -useprofile"
220 elif [[ $1 = '-webinterface' ]]
222 JAVAOPTS="$JAVAOPTS -webinterface"
223 elif [[ $1 = '-instructionfailures' ]]
225 JAVAOPTS="$JAVAOPTS -instructionfailures"
226 elif [[ $1 = '-joptimize' ]]
228 JAVAOPTS="$JAVAOPTS -optimize"
229 elif [[ $1 = '-mlp' ]]
231 JAVAOPTS="$JAVAOPTS -mlp"
232 elif [[ $1 = '-check' ]]
235 JAVAOPTS="$JAVAOPTS -conscheck"
236 elif [[ $1 = '-enable-assertions' ]]
238 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
239 elif [[ $1 = '-specdir' ]]
245 elif [[ $1 = '-debug' ]]
248 EXTRAOPTIONS="$EXTRAOPTIONS -g"
249 elif [[ $1 = '-rawpath' ]]
252 elif [[ $1 = '-runtimedebug' ]]
254 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
255 elif [[ $1 = '-dsmcaching' ]]
257 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
258 elif [[ $1 = '-rangeprefetch' ]]
260 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
261 elif [[ $1 = '-nooptimize' ]]
263 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
264 elif [[ $1 = '-optimize' ]]
266 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
267 elif [[ $1 = '-thread' ]]
269 JAVAOPTS="$JAVAOPTS -thread"
270 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
272 elif [[ $1 = '-distributioninfo' ]]
274 JAVAOPTS="$JAVAOPTS -distributioninfo"
275 elif [[ $1 = '-curdir' ]]
279 elif [[ $1 = '-outputdir' ]]
281 JAVAOPTS="$JAVAOPTS -outputdir $2"
284 SRCFILES="$SRCFILES $1"
289 BUILDDIR="$CURDIR/tmpbuilddirectory"
297 if $CHECKFLAG #Generate structure files for repair tool
299 JAVAOPTS="$JAVAOPTS -struct structfile"
309 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
311 #base bristlecone files
312 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
318 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
321 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
324 #threading java stuff
325 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
328 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
331 # Build bristlecone/java sources
335 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
336 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
337 -dir $BUILDDIR $JAVAOPTS $SRCFILES
341 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
344 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
345 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
352 if $EXITAFTERANALYSIS
357 # Build all of the consistency specs
359 if $CHECKFLAG # CHECKFLAG
362 mkdir $BUILDDIR/specdir
363 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
365 echo > $BUILDDIR/specs
367 # compile specs into C code
368 for i in * # iterate over all directories
370 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
373 cat $BUILDDIR/structfile.struct $i.label > $i.struct
374 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
375 cp size.[c,h] $BUILDDIR/specdir
376 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
377 echo $i >> $BUILDDIR/specs
379 done # iterate over all directories
385 echo > $BUILDDIR/checkers.h
386 for i in `cat $BUILDDIR/specs`
388 gcc -O0 -g -fbounds-check -c $i\_aux.c
389 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
393 #build and link everything
398 MAKEFILE="../Makefile.raw"
404 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
406 if $RAWCACHEFLUSHFLAG
408 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWCACHEFLUSH"
413 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
418 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
422 then # profile version
423 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPROFILE"
428 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWUSEIO"
432 then #INTERRUPT version
433 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
434 fi #INTERRUPT version
438 MAKEFILE="$MAKEFILE.io"
439 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
441 MAKEFILE="$MAKEFILE.$RAWCONFIG"
444 cp $MAKEFILE ./Makefile
449 cp ../tmpbuilddirectory/*.c ./
450 cp ../tmpbuilddirectory/*.h ./
457 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
462 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
464 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
467 FILES="$RUNTIMEFILE \
468 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
469 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
470 $ROBUSTROOT/Runtime/ObjectHash.c \
471 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
472 $ROBUSTROOT/Runtime/math.c \
473 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
477 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
480 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
482 FILES="$FILES $DSMRUNTIME/trans.c $DSMRUNTIME/mcpileq.c $DSMRUNTIME/objstr.c $DSMRUNTIME/dstm.c $DSMRUNTIME/mlookup.c $DSMRUNTIME/clookup.c $DSMRUNTIME/llookup.c $DSMRUNTIME/threadnotify.c $DSMRUNTIME/dstmserver.c $DSMRUNTIME/plookup.c $DSMRUNTIME/ip.c $DSMRUNTIME/queue.c $DSMRUNTIME/prelookup.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"
487 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME"
488 FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/clookup.c"
493 FILES="$FILES $DSMRUNTIME/abortreaders.c"
498 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
503 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
508 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
511 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
513 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
516 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
518 if $THREADSIMULATEFLAG
520 # -lpthread for pthread functions, -lrt for message queue functions
521 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
527 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
528 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
533 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
538 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
539 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
544 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
549 gcc $INCLUDES $EXTRAOPTIONS \
550 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
552 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
553 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin