4 echo -robustroot set up the ROBUSTROOT to directory other than default one
5 echo -dsm distributed shared memory
6 echo -abortreaders abort readers immediately
7 echo -trueprob double - probabiltiy of true branch
8 echo -dsmcaching -enable caching in dsm runtime
9 echo -mac distributed shared memory mac support
10 echo -check generate check code
11 echo -dmalloc link in dmalloc
12 echo -recover compile task code
13 echo -fastcheck fast checkpointing for Bristlecone
14 echo -specdir directory
15 echo -printflat print out flat representation
16 echo -selfloop task - this task cannot self loop forever
17 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
18 echo -taskstate do task state analysis
19 echo -tagstate do tag state analysis
20 echo -scheduling do task scheduling
21 echo -multicore generate multi-core version binary
22 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
23 echo "-raw generate raw version binary (should be used together with -multicore)"
24 echo "-rawcacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
25 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
26 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
27 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
28 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
29 echo -threadsimulate generate multi-thread simulate version binary
30 echo -printscheduling print out scheduling graphs
31 echo -printschedulesim print out scheduling simulator result graphs
32 echo -optional enable optional
33 echo -debug generate debug symbols
34 echo -prefetch do prefetch analysis
35 echo -transstats generates transaction stats on commits and aborts
36 echo -webinterface enable web interface
37 echo -runtimedebug printout runtime debug messages
38 echo "-thread use support for multiple threads"
39 echo "-optimize call gcc with -O9 (optimize)"
40 echo "-nooptimize call gcc with -O0 (do not optimize)"
41 echo -curdir directory
42 echo -mainclass class with main method
44 echo -nojava do not run bristlecone compiler
45 echo -instructionfailures inject code for instructionfailures
46 echo -profile build with profile options
47 echo "-rawuseio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
48 echo "-enable-assertions execute assert statements during compilation"
49 echo -justanalyze exit after compiler analyses complete
54 ROBUSTROOT=~/research/Robust/src
55 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
56 REPAIRROOT=~/research/Repair/RepairCompiler/
65 RAWCACHEFLUSHFLAG=false
72 THREADSIMULATEFLAG=false;
83 EXITAFTERANALYSIS=false
97 elif [[ $1 = '-justanalyze' ]]
99 EXITAFTERANALYSIS=true
100 elif [[ $1 = '-abortreaders' ]]
103 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
104 JAVAOPTS="$JAVAOPTS -abortreaders"
105 elif [[ $1 = '-robustroot' ]]
109 elif [[ $1 = '-nojava' ]]
112 elif [[ $1 = '-fastcheck' ]]
114 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
115 JAVAOPTS="$JAVAOPTS -fastcheck"
121 elif [[ $1 = '-mainclass' ]]
123 JAVAOPTS="$JAVAOPTS -mainclass $2"
125 elif [[ $1 = '-selfloop' ]]
127 JAVAOPTS="$JAVAOPTS -selfloop $2"
129 elif [[ $1 = '-excprefetch' ]]
131 JAVAOPTS="$JAVAOPTS -excprefetch $2"
133 elif [[ $1 = '-dsm' ]]
135 JAVAOPTS="$JAVAOPTS -dsm"
137 elif [[ $1 = '-prefetch' ]]
139 JAVAOPTS="$JAVAOPTS -prefetch"
140 elif [[ $1 = '-transstats' ]]
143 elif [[ $1 = '-printflat' ]]
145 JAVAOPTS="$JAVAOPTS -printflat"
146 elif [[ $1 = '-trueprob' ]]
148 JAVAOPTS="$JAVAOPTS -trueprob $2"
150 elif [[ $1 = '-mac' ]]
152 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
153 elif [[ $1 = '-profile' ]]
156 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
157 elif [[ $1 = '-rawuseio' ]]
160 elif [[ $1 = '-taskstate' ]]
162 JAVAOPTS="$JAVAOPTS -taskstate"
163 elif [[ $1 = '-tagstate' ]]
165 JAVAOPTS="$JAVAOPTS -tagstate"
166 elif [[ $1 = '-scheduling' ]]
168 JAVAOPTS="$JAVAOPTS -scheduling"
169 elif [[ $1 = '-multicore' ]]
172 JAVAOPTS="$JAVAOPTS -multicore"
173 elif [[ $1 = '-numcore' ]]
175 JAVAOPTS="$JAVAOPTS -numcore $2"
177 elif [[ $1 = '-raw' ]]
180 JAVAOPTS="$JAVAOPTS -raw"
181 elif [[ $1 = '-rawcacheflush' ]]
183 RAWCACHEFLUSHFLAG=true
184 elif [[ $1 = '-rawconfig' ]]
188 elif [[ $1 = '-interrupt' ]]
191 elif [[ $1 = '-threadsimulate' ]]
193 THREADSIMULATEFLAG=true
194 elif [[ $1 = '-optional' ]]
196 JAVAOPTS="$JAVAOPTS -optional"
198 elif [[ $1 = '-dmalloc' ]]
201 elif [[ $1 = '-recover' ]]
204 JAVAOPTS="$JAVAOPTS -task"
205 elif [[ $1 = '-useprofile' ]]
207 JAVAOPTS="$JAVAOPTS -useprofile"
208 elif [[ $1 = '-webinterface' ]]
210 JAVAOPTS="$JAVAOPTS -webinterface"
211 elif [[ $1 = '-instructionfailures' ]]
213 JAVAOPTS="$JAVAOPTS -instructionfailures"
214 elif [[ $1 = '-check' ]]
217 JAVAOPTS="$JAVAOPTS -conscheck"
218 elif [[ $1 = '-enable-assertions' ]]
220 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
221 elif [[ $1 = '-specdir' ]]
227 elif [[ $1 = '-debug' ]]
230 EXTRAOPTIONS="$EXTRAOPTIONS -g"
231 elif [[ $1 = '-rawpath' ]]
234 elif [[ $1 = '-runtimedebug' ]]
236 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
237 elif [[ $1 = '-dsmcaching' ]]
239 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
240 elif [[ $1 = '-rangeprefetch' ]]
242 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
243 elif [[ $1 = '-nooptimize' ]]
245 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
246 elif [[ $1 = '-optimize' ]]
248 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
249 elif [[ $1 = '-thread' ]]
251 JAVAOPTS="$JAVAOPTS -thread"
252 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
254 elif [[ $1 = '-curdir' ]]
258 elif [[ $1 = '-outputdir' ]]
260 JAVAOPTS="$JAVAOPTS -outputdir $2"
263 SRCFILES="$SRCFILES $1"
268 BUILDDIR="$CURDIR/tmpbuilddirectory"
276 if $CHECKFLAG #Generate structure files for repair tool
278 JAVAOPTS="$JAVAOPTS -struct structfile"
288 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
290 #base bristlecone files
291 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
296 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
299 #threading java stuff
300 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
303 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
306 # Build bristlecone/java sources
310 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
311 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
312 -dir $BUILDDIR $JAVAOPTS $SRCFILES
316 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
319 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
320 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
327 if $EXITAFTERANALYSIS
332 # Build all of the consistency specs
334 if $CHECKFLAG # CHECKFLAG
337 mkdir $BUILDDIR/specdir
338 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
340 echo > $BUILDDIR/specs
342 # compile specs into C code
343 for i in * # iterate over all directories
345 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
348 cat $BUILDDIR/structfile.struct $i.label > $i.struct
349 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
350 cp size.[c,h] $BUILDDIR/specdir
351 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
352 echo $i >> $BUILDDIR/specs
354 done # iterate over all directories
360 echo > $BUILDDIR/checkers.h
361 for i in `cat $BUILDDIR/specs`
363 gcc -O0 -g -fbounds-check -c $i\_aux.c
364 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
368 #build and link everything
373 MAKEFILE="../Makefile.raw"
379 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
381 if $RAWCACHEFLUSHFLAG
383 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWCACHEFLUSH"
388 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
393 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
397 then # profile version
398 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPROFILE"
403 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWUSEIO"
407 then #INTERRUPT version
408 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
409 fi #INTERRUPT version
413 MAKEFILE="$MAKEFILE.io"
414 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
416 MAKEFILE="$MAKEFILE.$RAWCONFIG"
419 cp $MAKEFILE ./Makefile
424 cp ../tmpbuilddirectory/*.c ./
425 cp ../tmpbuilddirectory/*.h ./
432 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
437 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
439 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
442 FILES="$RUNTIMEFILE \
443 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
444 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
445 $ROBUSTROOT/Runtime/ObjectHash.c \
446 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
447 $ROBUSTROOT/Runtime/math.c \
448 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
452 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
455 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
457 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"
462 FILES="$FILES $DSMRUNTIME/abortreaders.c"
467 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
472 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
475 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
477 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
480 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
482 if $THREADSIMULATEFLAG
484 # -lpthread for pthread functions, -lrt for message queue functions
485 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
491 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
492 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
497 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
502 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
503 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
508 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
513 gcc $INCLUDES $EXTRAOPTIONS \
514 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
516 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
517 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin