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 -printscheduling print out scheduling graphs
28 echo -printschedulesim print out scheduling simulator result graphs
29 echo -optional enable optional
30 echo -debug generate debug symbols
31 echo -prefetch do prefetch analysis
32 echo -transstats generates transaction stats on commits and aborts
33 echo -webinterface enable web interface
34 echo -runtimedebug printout runtime debug messages
35 echo "-thread use support for multiple threads"
36 echo "-optimize call gcc with -O9 (optimize)"
37 echo "-nooptimize call gcc with -O0 (do not optimize)"
38 echo -curdir directory
39 echo -mainclass class with main method
41 echo -nojava do not run bristlecone compiler
42 echo -instructionfailures inject code for instructionfailures
43 echo -profile build with profile options
44 echo "-rawuseio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
45 echo "-enable-assertions execute assert statements during compilation"
49 ROBUSTROOT=~/research/Robust/src
50 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
51 REPAIRROOT=~/research/Repair/RepairCompiler/
66 THREADSIMULATEFLAG=false;
89 elif [[ $1 = '-robustroot' ]]
93 elif [[ $1 = '-nojava' ]]
100 elif [[ $1 = '-mainclass' ]]
102 JAVAOPTS="$JAVAOPTS -mainclass $2"
104 elif [[ $1 = '-selfloop' ]]
106 JAVAOPTS="$JAVAOPTS -selfloop $2"
108 elif [[ $1 = '-excprefetch' ]]
110 JAVAOPTS="$JAVAOPTS -excprefetch $2"
112 elif [[ $1 = '-dsm' ]]
114 JAVAOPTS="$JAVAOPTS -dsm"
116 elif [[ $1 = '-prefetch' ]]
118 JAVAOPTS="$JAVAOPTS -prefetch"
119 elif [[ $1 = '-transstats' ]]
122 elif [[ $1 = '-printflat' ]]
124 JAVAOPTS="$JAVAOPTS -printflat"
125 elif [[ $1 = '-trueprob' ]]
127 JAVAOPTS="$JAVAOPTS -trueprob $2"
129 elif [[ $1 = '-mac' ]]
131 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
132 elif [[ $1 = '-profile' ]]
135 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
136 elif [[ $1 = '-rawuseio' ]]
139 elif [[ $1 = '-taskstate' ]]
141 JAVAOPTS="$JAVAOPTS -taskstate"
142 elif [[ $1 = '-tagstate' ]]
144 JAVAOPTS="$JAVAOPTS -tagstate"
145 elif [[ $1 = '-scheduling' ]]
147 JAVAOPTS="$JAVAOPTS -scheduling"
148 elif [[ $1 = '-multicore' ]]
151 JAVAOPTS="$JAVAOPTS -multicore"
152 elif [[ $1 = '-numcore' ]]
154 JAVAOPTS="$JAVAOPTS -numcore $2"
156 elif [[ $1 = '-raw' ]]
159 JAVAOPTS="$JAVAOPTS -raw"
160 elif [[ $1 = '-rawconfig' ]]
164 elif [[ $1 = '-interrupt' ]]
167 elif [[ $1 = '-threadsimulate' ]]
169 THREADSIMULATEFLAG=true
170 elif [[ $1 = '-optional' ]]
172 JAVAOPTS="$JAVAOPTS -optional"
174 elif [[ $1 = '-dmalloc' ]]
177 elif [[ $1 = '-recover' ]]
180 JAVAOPTS="$JAVAOPTS -task"
181 elif [[ $1 = '-useprofile' ]]
183 JAVAOPTS="$JAVAOPTS -useprofile"
184 elif [[ $1 = '-webinterface' ]]
186 JAVAOPTS="$JAVAOPTS -webinterface"
187 elif [[ $1 = '-instructionfailures' ]]
189 JAVAOPTS="$JAVAOPTS -instructionfailures"
190 elif [[ $1 = '-check' ]]
193 JAVAOPTS="$JAVAOPTS -conscheck"
194 elif [[ $1 = '-enable-assertions' ]]
196 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
197 elif [[ $1 = '-specdir' ]]
203 elif [[ $1 = '-debug' ]]
206 EXTRAOPTIONS="$EXTRAOPTIONS -g"
207 elif [[ $1 = '-rawpath' ]]
210 elif [[ $1 = '-runtimedebug' ]]
212 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
213 elif [[ $1 = '-dsmcaching' ]]
215 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
216 elif [[ $1 = '-nooptimize' ]]
218 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
219 elif [[ $1 = '-optimize' ]]
221 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
222 elif [[ $1 = '-thread' ]]
224 JAVAOPTS="$JAVAOPTS -thread"
225 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
227 elif [[ $1 = '-curdir' ]]
232 SRCFILES="$SRCFILES $1"
237 BUILDDIR="$CURDIR/tmpbuilddirectory"
245 if $CHECKFLAG #Generate structure files for repair tool
247 JAVAOPTS="$JAVAOPTS -struct structfile"
250 # Build bristlecone/java sources
254 if ! ./ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
255 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR \
260 #if ! ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
263 if ! ./ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
264 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
271 # Build all of the consistency specs
273 if $CHECKFLAG # CHECKFLAG
276 mkdir $BUILDDIR/specdir
277 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
279 echo > $BUILDDIR/specs
281 # compile specs into C code
282 for i in * # iterate over all directories
284 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
287 cat $BUILDDIR/structfile.struct $i.label > $i.struct
288 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
289 cp size.[c,h] $BUILDDIR/specdir
290 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
291 echo $i >> $BUILDDIR/specs
293 done # iterate over all directories
299 echo > $BUILDDIR/checkers.h
300 for i in `cat $BUILDDIR/specs`
302 gcc -O0 -g -fbounds-check -c $i\_aux.c
303 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
307 #build and link everything
312 MAKEFILE="../Makefile.raw"
318 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
322 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
327 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
331 then # profile version
332 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPROFILE"
337 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWUSEIO"
341 then #INTERRUPT version
342 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
343 fi #INTERRUPT version
347 MAKEFILE="$MAKEFILE.io"
348 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
350 MAKEFILE="$MAKEFILE.$RAWCONFIG"
353 cp $MAKEFILE ./Makefile
358 cp ../tmpbuilddirectory/*.c ./
359 cp ../tmpbuilddirectory/*.h ./
366 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
371 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
373 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
376 FILES="$RUNTIMEFILE \
377 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
378 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
379 $ROBUSTROOT/Runtime/ObjectHash.c \
380 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
381 $ROBUSTROOT/Runtime/math.c \
382 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
386 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
389 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
391 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"
396 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
399 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
401 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
404 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
406 if $THREADSIMULATEFLAG
408 # -lpthread for pthread functions, -lrt for message queue functions
409 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
415 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
416 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
421 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
426 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
427 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
432 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
437 gcc $INCLUDES $EXTRAOPTIONS \
438 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
440 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
441 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin