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 -mac distributed shared memory mac support
8 echo -check generate check code
9 echo -dmalloc link in dmalloc
10 echo -recover compile task code
11 echo -specdir directory
12 echo -printflat print out flat representation
13 echo -selfloop task - this task cannot self loop forever
14 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
15 echo -taskstate do task state analysis
16 echo -tagstate do tag state analysis
17 echo -scheduling do task scheduling
18 echo -multicore generate multi-core version binary
19 echo "-raw generate raw version binary (should be used with -multicore)"
20 echo -optional enable optional
21 echo -debug generate debug symbols
22 echo -prefetch do prefetch analysis
23 echo -webinterface enable web interface
24 echo -runtimedebug printout runtime debug messages
25 echo "-thread use support for multiple threads"
26 echo "-optimize call gcc with -O9 (optimize)"
27 echo "-nooptimize call gcc with -O0 (do not optimize)"
28 echo -curdir directory
29 echo -mainclass class with main method
31 echo -instructionfailures inject code for instructionfailures
32 echo -profile build with profile options
33 echo "-enable-assertions execute assert statements during compilation"
37 ROBUSTROOT=~/research/Robust/src
38 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
39 REPAIRROOT=~/research/Repair/RepairCompiler/
68 elif [[ $1 = '-robustroot' ]]
76 elif [[ $1 = '-mainclass' ]]
78 JAVAOPTS="$JAVAOPTS -mainclass $2"
80 elif [[ $1 = '-selfloop' ]]
82 JAVAOPTS="$JAVAOPTS -selfloop $2"
84 elif [[ $1 = '-excprefetch' ]]
86 JAVAOPTS="$JAVAOPTS -excprefetch $2"
88 elif [[ $1 = '-dsm' ]]
90 JAVAOPTS="$JAVAOPTS -dsm"
92 elif [[ $1 = '-prefetch' ]]
94 JAVAOPTS="$JAVAOPTS -prefetch"
95 elif [[ $1 = '-printflat' ]]
97 JAVAOPTS="$JAVAOPTS -printflat"
98 elif [[ $1 = '-trueprob' ]]
100 JAVAOPTS="$JAVAOPTS -trueprob $2"
102 elif [[ $1 = '-mac' ]]
104 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
105 elif [[ $1 = '-profile' ]]
107 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
108 elif [[ $1 = '-taskstate' ]]
110 JAVAOPTS="$JAVAOPTS -taskstate"
111 elif [[ $1 = '-tagstate' ]]
113 JAVAOPTS="$JAVAOPTS -tagstate"
114 elif [[ $1 = '-scheduling' ]]
116 JAVAOPTS="$JAVAOPTS -scheduling"
117 elif [[ $1 = '-multicore' ]]
120 JAVAOPTS="$JAVAOPTS -multicore"
121 elif [[ $1 = '-raw' ]]
124 #JAVAOPTS="$JAVAOPTS -raw"
125 elif [[ $1 = '-optional' ]]
127 JAVAOPTS="$JAVAOPTS -optional"
129 elif [[ $1 = '-dmalloc' ]]
132 elif [[ $1 = '-recover' ]]
135 JAVAOPTS="$JAVAOPTS -task"
136 elif [[ $1 = '-webinterface' ]]
138 JAVAOPTS="$JAVAOPTS -webinterface"
139 elif [[ $1 = '-instructionfailures' ]]
141 JAVAOPTS="$JAVAOPTS -instructionfailures"
142 elif [[ $1 = '-check' ]]
145 JAVAOPTS="$JAVAOPTS -conscheck"
146 elif [[ $1 = '-enable-assertions' ]]
148 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
149 elif [[ $1 = '-specdir' ]]
155 elif [[ $1 = '-debug' ]]
157 EXTRAOPTIONS="$EXTRAOPTIONS -g"
158 elif [[ $1 = '-runtimedebug' ]]
160 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
161 elif [[ $1 = '-nooptimize' ]]
163 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
164 elif [[ $1 = '-optimize' ]]
166 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
167 elif [[ $1 = '-thread' ]]
169 JAVAOPTS="$JAVAOPTS -thread"
170 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
172 elif [[ $1 = '-curdir' ]]
177 SRCFILES="$SRCFILES $1"
182 BUILDDIR="$CURDIR/tmpbuilddirectory"
190 if $CHECKFLAG #Generate structure files for repair tool
192 JAVAOPTS="$JAVAOPTS -struct structfile"
195 # Build bristlecone/java sources
197 #if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
198 if ! java $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
199 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
204 # Build all of the consistency specs
206 if $CHECKFLAG # CHECKFLAG
209 mkdir $BUILDDIR/specdir
210 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
212 echo > $BUILDDIR/specs
214 # compile specs into C code
215 for i in * # iterate over all directories
217 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
220 cat $BUILDDIR/structfile.struct $i.label > $i.struct
221 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
222 cp size.[c,h] $BUILDDIR/specdir
223 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
224 echo $i >> $BUILDDIR/specs
226 done # iterate over all directories
232 echo > $BUILDDIR/checkers.h
233 for i in `cat $BUILDDIR/specs`
235 gcc -O0 -g -fbounds-check -c $i\_aux.c
236 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
240 #build and link everything
244 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
247 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c \
248 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
249 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
250 $ROBUSTROOT/Runtime/ObjectHash.c \
251 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
252 $ROBUSTROOT/Runtime/math.c \
253 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
257 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
258 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"
263 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
266 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
270 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
272 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
277 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
278 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
283 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
288 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
289 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
294 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
297 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
298 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin