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/
60 THREADSIMULATEFLAG=false;
83 elif [[ $1 = '-robustroot' ]]
87 elif [[ $1 = '-nojava' ]]
94 elif [[ $1 = '-mainclass' ]]
96 JAVAOPTS="$JAVAOPTS -mainclass $2"
98 elif [[ $1 = '-selfloop' ]]
100 JAVAOPTS="$JAVAOPTS -selfloop $2"
102 elif [[ $1 = '-excprefetch' ]]
104 JAVAOPTS="$JAVAOPTS -excprefetch $2"
106 elif [[ $1 = '-dsm' ]]
108 JAVAOPTS="$JAVAOPTS -dsm"
110 elif [[ $1 = '-prefetch' ]]
112 JAVAOPTS="$JAVAOPTS -prefetch"
113 elif [[ $1 = '-transstats' ]]
116 elif [[ $1 = '-printflat' ]]
118 JAVAOPTS="$JAVAOPTS -printflat"
119 elif [[ $1 = '-trueprob' ]]
121 JAVAOPTS="$JAVAOPTS -trueprob $2"
123 elif [[ $1 = '-mac' ]]
125 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
126 elif [[ $1 = '-profile' ]]
128 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
129 elif [[ $1 = '-taskstate' ]]
131 JAVAOPTS="$JAVAOPTS -taskstate"
132 elif [[ $1 = '-tagstate' ]]
134 JAVAOPTS="$JAVAOPTS -tagstate"
135 elif [[ $1 = '-scheduling' ]]
137 JAVAOPTS="$JAVAOPTS -scheduling"
138 elif [[ $1 = '-multicore' ]]
141 JAVAOPTS="$JAVAOPTS -multicore"
142 elif [[ $1 = '-numcore' ]]
144 JAVAOPTS="$JAVAOPTS -numcore $2"
146 elif [[ $1 = '-raw' ]]
149 JAVAOPTS="$JAVAOPTS -raw"
150 elif [[ $1 = '-rawconfig' ]]
154 elif [[ $1 = '-interrupt' ]]
157 elif [[ $1 = '-threadsimulate' ]]
159 THREADSIMULATEFLAG=true
160 elif [[ $1 = '-optional' ]]
162 JAVAOPTS="$JAVAOPTS -optional"
164 elif [[ $1 = '-dmalloc' ]]
167 elif [[ $1 = '-recover' ]]
170 JAVAOPTS="$JAVAOPTS -task"
171 elif [[ $1 = '-webinterface' ]]
173 JAVAOPTS="$JAVAOPTS -webinterface"
174 elif [[ $1 = '-instructionfailures' ]]
176 JAVAOPTS="$JAVAOPTS -instructionfailures"
177 elif [[ $1 = '-check' ]]
180 JAVAOPTS="$JAVAOPTS -conscheck"
181 elif [[ $1 = '-enable-assertions' ]]
183 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
184 elif [[ $1 = '-specdir' ]]
190 elif [[ $1 = '-debug' ]]
193 EXTRAOPTIONS="$EXTRAOPTIONS -g"
194 elif [[ $1 = '-rawpath' ]]
197 elif [[ $1 = '-runtimedebug' ]]
199 EXTRAOPTIONS="$EXTRAOPTIONS -DCHECKTA"
200 elif [[ $1 = '-dsmcaching' ]]
202 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
203 elif [[ $1 = '-nooptimize' ]]
205 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
206 elif [[ $1 = '-optimize' ]]
208 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
209 elif [[ $1 = '-thread' ]]
211 JAVAOPTS="$JAVAOPTS -thread"
212 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
214 elif [[ $1 = '-curdir' ]]
219 SRCFILES="$SRCFILES $1"
224 BUILDDIR="$CURDIR/tmpbuilddirectory"
232 if $CHECKFLAG #Generate structure files for repair tool
234 JAVAOPTS="$JAVAOPTS -struct structfile"
237 # Build bristlecone/java sources
241 if ! java $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
242 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR \
247 #if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
250 if ! java -Xms50m -Xmx200m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
251 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
258 # Build all of the consistency specs
260 if $CHECKFLAG # CHECKFLAG
263 mkdir $BUILDDIR/specdir
264 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
266 echo > $BUILDDIR/specs
268 # compile specs into C code
269 for i in * # iterate over all directories
271 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
274 cat $BUILDDIR/structfile.struct $i.label > $i.struct
275 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
276 cp size.[c,h] $BUILDDIR/specdir
277 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
278 echo $i >> $BUILDDIR/specs
280 done # iterate over all directories
286 echo > $BUILDDIR/checkers.h
287 for i in `cat $BUILDDIR/specs`
289 gcc -O0 -g -fbounds-check -c $i\_aux.c
290 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
294 #build and link everything
299 MAKEFILE="../Makefile.raw"
305 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
309 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
314 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
318 then #INTERRUPT version
319 MAKEFILE="$MAKEFILE.i"
320 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
321 fi #INTERRUPT version
323 MAKEFILE="$MAKEFILE.$RAWCONFIG"
325 cp $MAKEFILE ./Makefile
330 cp ../tmpbuilddirectory/*.c ./
331 cp ../tmpbuilddirectory/*.h ./
338 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
343 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
345 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
348 FILES="$RUNTIMEFILE \
349 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
350 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
351 $ROBUSTROOT/Runtime/ObjectHash.c \
352 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
353 $ROBUSTROOT/Runtime/math.c \
354 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
358 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
361 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
363 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"
368 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
371 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
373 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
376 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
378 if $THREADSIMULATEFLAG
380 # -lpthread for pthread functions, -lrt for message queue functions
381 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
387 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
388 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
393 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
398 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
399 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
404 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
409 gcc $INCLUDES $EXTRAOPTIONS \
410 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
412 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
413 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin