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 -threadsimulate generate multi-thread simulate version binary
26 echo -optional enable optional
27 echo -debug generate debug symbols
28 echo -prefetch do prefetch analysis
29 echo -transstats generates transaction stats on commits and aborts
30 echo -webinterface enable web interface
31 echo -runtimedebug printout runtime debug messages
32 echo "-thread use support for multiple threads"
33 echo "-optimize call gcc with -O9 (optimize)"
34 echo "-nooptimize call gcc with -O0 (do not optimize)"
35 echo -curdir directory
36 echo -mainclass class with main method
38 echo -nojava do not run bristlecone compiler
39 echo -instructionfailures inject code for instructionfailures
40 echo -profile build with profile options
41 echo "-enable-assertions execute assert statements during compilation"
45 ROBUSTROOT=~/research/Robust/src
46 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
47 REPAIRROOT=~/research/Repair/RepairCompiler/
61 THREADSIMULATEFLAG=false;
84 elif [[ $1 = '-robustroot' ]]
88 elif [[ $1 = '-nojava' ]]
95 elif [[ $1 = '-mainclass' ]]
97 JAVAOPTS="$JAVAOPTS -mainclass $2"
99 elif [[ $1 = '-selfloop' ]]
101 JAVAOPTS="$JAVAOPTS -selfloop $2"
103 elif [[ $1 = '-excprefetch' ]]
105 JAVAOPTS="$JAVAOPTS -excprefetch $2"
107 elif [[ $1 = '-dsm' ]]
109 JAVAOPTS="$JAVAOPTS -dsm"
111 elif [[ $1 = '-prefetch' ]]
113 JAVAOPTS="$JAVAOPTS -prefetch"
114 elif [[ $1 = '-transstats' ]]
117 elif [[ $1 = '-printflat' ]]
119 JAVAOPTS="$JAVAOPTS -printflat"
120 elif [[ $1 = '-trueprob' ]]
122 JAVAOPTS="$JAVAOPTS -trueprob $2"
124 elif [[ $1 = '-mac' ]]
126 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
127 elif [[ $1 = '-profile' ]]
130 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
131 elif [[ $1 = '-taskstate' ]]
133 JAVAOPTS="$JAVAOPTS -taskstate"
134 elif [[ $1 = '-tagstate' ]]
136 JAVAOPTS="$JAVAOPTS -tagstate"
137 elif [[ $1 = '-scheduling' ]]
139 JAVAOPTS="$JAVAOPTS -scheduling"
140 elif [[ $1 = '-multicore' ]]
143 JAVAOPTS="$JAVAOPTS -multicore"
144 elif [[ $1 = '-numcore' ]]
146 JAVAOPTS="$JAVAOPTS -numcore $2"
148 elif [[ $1 = '-raw' ]]
151 JAVAOPTS="$JAVAOPTS -raw"
152 elif [[ $1 = '-rawconfig' ]]
156 elif [[ $1 = '-interrupt' ]]
159 elif [[ $1 = '-threadsimulate' ]]
161 THREADSIMULATEFLAG=true
162 elif [[ $1 = '-optional' ]]
164 JAVAOPTS="$JAVAOPTS -optional"
166 elif [[ $1 = '-dmalloc' ]]
169 elif [[ $1 = '-recover' ]]
172 JAVAOPTS="$JAVAOPTS -task"
173 elif [[ $1 = '-webinterface' ]]
175 JAVAOPTS="$JAVAOPTS -webinterface"
176 elif [[ $1 = '-instructionfailures' ]]
178 JAVAOPTS="$JAVAOPTS -instructionfailures"
179 elif [[ $1 = '-check' ]]
182 JAVAOPTS="$JAVAOPTS -conscheck"
183 elif [[ $1 = '-enable-assertions' ]]
185 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
186 elif [[ $1 = '-specdir' ]]
192 elif [[ $1 = '-debug' ]]
195 EXTRAOPTIONS="$EXTRAOPTIONS -g"
196 elif [[ $1 = '-rawpath' ]]
199 elif [[ $1 = '-runtimedebug' ]]
201 EXTRAOPTIONS="$EXTRAOPTIONS -DCHECKTA"
202 elif [[ $1 = '-dsmcaching' ]]
204 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
205 elif [[ $1 = '-nooptimize' ]]
207 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
208 elif [[ $1 = '-optimize' ]]
210 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
211 elif [[ $1 = '-thread' ]]
213 JAVAOPTS="$JAVAOPTS -thread"
214 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
216 elif [[ $1 = '-curdir' ]]
221 SRCFILES="$SRCFILES $1"
226 BUILDDIR="$CURDIR/tmpbuilddirectory"
234 if $CHECKFLAG #Generate structure files for repair tool
236 JAVAOPTS="$JAVAOPTS -struct structfile"
239 # Build bristlecone/java sources
243 if ! java $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
244 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR \
249 #if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
252 if ! java -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
253 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
260 # Build all of the consistency specs
262 if $CHECKFLAG # CHECKFLAG
265 mkdir $BUILDDIR/specdir
266 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
268 echo > $BUILDDIR/specs
270 # compile specs into C code
271 for i in * # iterate over all directories
273 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
276 cat $BUILDDIR/structfile.struct $i.label > $i.struct
277 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
278 cp size.[c,h] $BUILDDIR/specdir
279 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
280 echo $i >> $BUILDDIR/specs
282 done # iterate over all directories
288 echo > $BUILDDIR/checkers.h
289 for i in `cat $BUILDDIR/specs`
291 gcc -O0 -g -fbounds-check -c $i\_aux.c
292 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
296 #build and link everything
301 MAKEFILE="../Makefile.raw"
307 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
311 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
316 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
320 then # profile version
321 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPROFILE"
325 then #INTERRUPT version
326 MAKEFILE="$MAKEFILE.i"
327 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
328 fi #INTERRUPT version
330 MAKEFILE="$MAKEFILE.$RAWCONFIG"
332 cp $MAKEFILE ./Makefile
337 cp ../tmpbuilddirectory/*.c ./
338 cp ../tmpbuilddirectory/*.h ./
345 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
350 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
352 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
355 FILES="$RUNTIMEFILE \
356 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
357 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
358 $ROBUSTROOT/Runtime/ObjectHash.c \
359 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
360 $ROBUSTROOT/Runtime/math.c \
361 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
365 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
368 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
370 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"
375 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
378 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
380 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
383 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
385 if $THREADSIMULATEFLAG
387 # -lpthread for pthread functions, -lrt for message queue functions
388 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
394 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
395 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
400 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
405 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
406 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
411 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
416 gcc $INCLUDES $EXTRAOPTIONS \
417 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
419 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
420 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin