4 echo -robustroot set up the ROBUSTROOT to directory other than default one
5 echo -dsm distributed shared memory
6 echo -trueprob double - probabiltiy of true branch
7 echo -dsmcaching -enable caching in dsm runtime
8 echo -mac distributed shared memory mac support
9 echo -check generate check code
10 echo -dmalloc link in dmalloc
11 echo -recover compile task code
12 echo -specdir directory
13 echo -printflat print out flat representation
14 echo -selfloop task - this task cannot self loop forever
15 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
16 echo -taskstate do task state analysis
17 echo -tagstate do tag state analysis
18 echo -scheduling do task scheduling
19 echo -multicore generate multi-core version binary
20 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
21 echo "-raw generate raw version binary (should be used together with -multicore)"
22 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
23 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
24 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
25 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
26 echo -threadsimulate generate multi-thread simulate version binary
27 echo -optional enable optional
28 echo -debug generate debug symbols
29 echo -prefetch do prefetch analysis
30 echo -transstats generates transaction stats on commits and aborts
31 echo -webinterface enable web interface
32 echo -runtimedebug printout runtime debug messages
33 echo "-thread use support for multiple threads"
34 echo "-optimize call gcc with -O9 (optimize)"
35 echo "-nooptimize call gcc with -O0 (do not optimize)"
36 echo -curdir directory
37 echo -mainclass class with main method
39 echo -nojava do not run bristlecone compiler
40 echo -instructionfailures inject code for instructionfailures
41 echo -profile build with profile options
42 echo "-rawuseio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
43 echo "-enable-assertions execute assert statements during compilation"
47 ROBUSTROOT=~/research/Robust/src
48 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
49 REPAIRROOT=~/research/Repair/RepairCompiler/
64 THREADSIMULATEFLAG=false;
87 elif [[ $1 = '-robustroot' ]]
91 elif [[ $1 = '-nojava' ]]
98 elif [[ $1 = '-mainclass' ]]
100 JAVAOPTS="$JAVAOPTS -mainclass $2"
102 elif [[ $1 = '-selfloop' ]]
104 JAVAOPTS="$JAVAOPTS -selfloop $2"
106 elif [[ $1 = '-excprefetch' ]]
108 JAVAOPTS="$JAVAOPTS -excprefetch $2"
110 elif [[ $1 = '-dsm' ]]
112 JAVAOPTS="$JAVAOPTS -dsm"
114 elif [[ $1 = '-prefetch' ]]
116 JAVAOPTS="$JAVAOPTS -prefetch"
117 elif [[ $1 = '-transstats' ]]
120 elif [[ $1 = '-printflat' ]]
122 JAVAOPTS="$JAVAOPTS -printflat"
123 elif [[ $1 = '-trueprob' ]]
125 JAVAOPTS="$JAVAOPTS -trueprob $2"
127 elif [[ $1 = '-mac' ]]
129 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
130 elif [[ $1 = '-profile' ]]
133 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
134 elif [[ $1 = '-rawuseio' ]]
137 elif [[ $1 = '-taskstate' ]]
139 JAVAOPTS="$JAVAOPTS -taskstate"
140 elif [[ $1 = '-tagstate' ]]
142 JAVAOPTS="$JAVAOPTS -tagstate"
143 elif [[ $1 = '-scheduling' ]]
145 JAVAOPTS="$JAVAOPTS -scheduling"
146 elif [[ $1 = '-multicore' ]]
149 JAVAOPTS="$JAVAOPTS -multicore"
150 elif [[ $1 = '-numcore' ]]
152 JAVAOPTS="$JAVAOPTS -numcore $2"
154 elif [[ $1 = '-raw' ]]
157 JAVAOPTS="$JAVAOPTS -raw"
158 elif [[ $1 = '-rawconfig' ]]
162 elif [[ $1 = '-interrupt' ]]
165 elif [[ $1 = '-threadsimulate' ]]
167 THREADSIMULATEFLAG=true
168 elif [[ $1 = '-optional' ]]
170 JAVAOPTS="$JAVAOPTS -optional"
172 elif [[ $1 = '-dmalloc' ]]
175 elif [[ $1 = '-recover' ]]
178 JAVAOPTS="$JAVAOPTS -task"
179 elif [[ $1 = '-useprofile' ]]
181 JAVAOPTS="$JAVAOPTS -useprofile"
182 elif [[ $1 = '-webinterface' ]]
184 JAVAOPTS="$JAVAOPTS -webinterface"
185 elif [[ $1 = '-instructionfailures' ]]
187 JAVAOPTS="$JAVAOPTS -instructionfailures"
188 elif [[ $1 = '-check' ]]
191 JAVAOPTS="$JAVAOPTS -conscheck"
192 elif [[ $1 = '-enable-assertions' ]]
194 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
195 elif [[ $1 = '-specdir' ]]
201 elif [[ $1 = '-debug' ]]
204 EXTRAOPTIONS="$EXTRAOPTIONS -g"
205 elif [[ $1 = '-rawpath' ]]
208 elif [[ $1 = '-runtimedebug' ]]
210 EXTRAOPTIONS="$EXTRAOPTIONS -DCHECKTA"
211 elif [[ $1 = '-dsmcaching' ]]
213 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
214 elif [[ $1 = '-nooptimize' ]]
216 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
217 elif [[ $1 = '-optimize' ]]
219 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
220 elif [[ $1 = '-thread' ]]
222 JAVAOPTS="$JAVAOPTS -thread"
223 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
225 elif [[ $1 = '-curdir' ]]
230 SRCFILES="$SRCFILES $1"
235 BUILDDIR="$CURDIR/tmpbuilddirectory"
243 if $CHECKFLAG #Generate structure files for repair tool
245 JAVAOPTS="$JAVAOPTS -struct structfile"
248 # Build bristlecone/java sources
252 if ! java -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
253 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR \
258 #if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
261 if ! java -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
262 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
269 # Build all of the consistency specs
271 if $CHECKFLAG # CHECKFLAG
274 mkdir $BUILDDIR/specdir
275 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
277 echo > $BUILDDIR/specs
279 # compile specs into C code
280 for i in * # iterate over all directories
282 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
285 cat $BUILDDIR/structfile.struct $i.label > $i.struct
286 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
287 cp size.[c,h] $BUILDDIR/specdir
288 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
289 echo $i >> $BUILDDIR/specs
291 done # iterate over all directories
297 echo > $BUILDDIR/checkers.h
298 for i in `cat $BUILDDIR/specs`
300 gcc -O0 -g -fbounds-check -c $i\_aux.c
301 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
305 #build and link everything
310 MAKEFILE="../Makefile.raw"
316 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
320 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
325 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
329 then # profile version
330 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPROFILE"
335 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWUSEIO"
339 then #INTERRUPT version
340 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
341 fi #INTERRUPT version
343 MAKEFILE="$MAKEFILE.$RAWCONFIG"
347 MAKEFILE="$MAKEFILE.io"
348 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
351 cp $MAKEFILE ./Makefile
356 cp ../tmpbuilddirectory/*.c ./
357 cp ../tmpbuilddirectory/*.h ./
364 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
369 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
371 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
374 FILES="$RUNTIMEFILE \
375 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
376 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
377 $ROBUSTROOT/Runtime/ObjectHash.c \
378 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
379 $ROBUSTROOT/Runtime/math.c \
380 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
384 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
387 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
389 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 $DSMRUNTIME/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRUNTIME/sockpool.c $DSMRUNTIME/addUdpEnhance.c $DSMRUNTIME/signal.c $DSMRUNTIME/gCollect.c $DSMRUNTIME/addPrefetchEnhance.c $DSMRUNTIME/dsmlock.c"
394 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
397 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
399 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
402 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
404 if $THREADSIMULATEFLAG
406 # -lpthread for pthread functions, -lrt for message queue functions
407 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
413 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
414 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
419 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
424 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
425 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
430 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
435 gcc $INCLUDES $EXTRAOPTIONS \
436 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
438 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
439 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin