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 = '-mlp' ]]
228 JAVAOPTS="$JAVAOPTS -mlp"
229 elif [[ $1 = '-check' ]]
232 JAVAOPTS="$JAVAOPTS -conscheck"
233 elif [[ $1 = '-enable-assertions' ]]
235 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
236 elif [[ $1 = '-specdir' ]]
242 elif [[ $1 = '-debug' ]]
245 EXTRAOPTIONS="$EXTRAOPTIONS -g"
246 elif [[ $1 = '-rawpath' ]]
249 elif [[ $1 = '-runtimedebug' ]]
251 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
252 elif [[ $1 = '-dsmcaching' ]]
254 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
255 elif [[ $1 = '-rangeprefetch' ]]
257 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
258 elif [[ $1 = '-nooptimize' ]]
260 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
261 elif [[ $1 = '-optimize' ]]
263 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
264 elif [[ $1 = '-thread' ]]
266 JAVAOPTS="$JAVAOPTS -thread"
267 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
269 elif [[ $1 = '-distributioninfo' ]]
271 JAVAOPTS="$JAVAOPTS -distributioninfo"
272 elif [[ $1 = '-curdir' ]]
276 elif [[ $1 = '-outputdir' ]]
278 JAVAOPTS="$JAVAOPTS -outputdir $2"
281 SRCFILES="$SRCFILES $1"
286 BUILDDIR="$CURDIR/tmpbuilddirectory"
294 if $CHECKFLAG #Generate structure files for repair tool
296 JAVAOPTS="$JAVAOPTS -struct structfile"
306 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
308 #base bristlecone files
309 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
315 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
318 #threading java stuff
319 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
322 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
325 # Build bristlecone/java sources
329 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
330 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
331 -dir $BUILDDIR $JAVAOPTS $SRCFILES
335 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
338 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
339 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
346 if $EXITAFTERANALYSIS
351 # Build all of the consistency specs
353 if $CHECKFLAG # CHECKFLAG
356 mkdir $BUILDDIR/specdir
357 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
359 echo > $BUILDDIR/specs
361 # compile specs into C code
362 for i in * # iterate over all directories
364 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
367 cat $BUILDDIR/structfile.struct $i.label > $i.struct
368 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
369 cp size.[c,h] $BUILDDIR/specdir
370 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
371 echo $i >> $BUILDDIR/specs
373 done # iterate over all directories
379 echo > $BUILDDIR/checkers.h
380 for i in `cat $BUILDDIR/specs`
382 gcc -O0 -g -fbounds-check -c $i\_aux.c
383 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
387 #build and link everything
392 MAKEFILE="../Makefile.raw"
398 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
400 if $RAWCACHEFLUSHFLAG
402 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWCACHEFLUSH"
407 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
412 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
416 then # profile version
417 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPROFILE"
422 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWUSEIO"
426 then #INTERRUPT version
427 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
428 fi #INTERRUPT version
432 MAKEFILE="$MAKEFILE.io"
433 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
435 MAKEFILE="$MAKEFILE.$RAWCONFIG"
438 cp $MAKEFILE ./Makefile
443 cp ../tmpbuilddirectory/*.c ./
444 cp ../tmpbuilddirectory/*.h ./
451 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
456 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
458 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
461 FILES="$RUNTIMEFILE \
462 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
463 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
464 $ROBUSTROOT/Runtime/ObjectHash.c \
465 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
466 $ROBUSTROOT/Runtime/math.c \
467 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
471 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
474 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
476 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"
481 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER"
482 FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/clookup.c"
487 FILES="$FILES $DSMRUNTIME/abortreaders.c"
492 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
497 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
502 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
505 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
507 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
510 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
512 if $THREADSIMULATEFLAG
514 # -lpthread for pthread functions, -lrt for message queue functions
515 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
521 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
522 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
527 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
532 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
533 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
538 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
543 gcc $INCLUDES $EXTRAOPTIONS \
544 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
546 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
547 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin