4 echo -dsm distributed shared memory
5 echo -trueprob double - probabiltiy of true branch
6 echo -mac distributed shared memory mac support
7 echo -check generate check code
8 echo -dmalloc link in dmalloc
9 echo -recover compile task code
10 echo -specdir directory
11 echo -printflat print out flat representation
12 echo -selfloop task - this task cannot self loop forever
13 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
14 echo -taskstate do task state analysis
15 echo -tagstate do tag state analysis
16 echo -scheduling do task scheduling
17 echo -optional enable optional
18 echo -debug generate debug symbols
19 echo -prefetch do prefetch analysis
20 echo -webinterface enable web interface
21 echo -runtimedebug printout runtime debug messages
22 echo "-thread use support for multiple threads"
23 echo "-optimize call gcc with -O9 (optimize)"
24 echo "-nooptimize call gcc with -O0 (do not optimize)"
25 echo -curdir directory
26 echo -mainclass class with main method
28 echo -instructionfailures inject code for instructionfailures
29 echo -profile build with profile options
30 echo "-enable-assertions execute assert statements during compilation"
34 ROBUSTROOT=~/research/Robust/src
35 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
36 REPAIRROOT=~/research/Repair/RepairCompiler/
67 elif [[ $1 = '-mainclass' ]]
69 JAVAOPTS="$JAVAOPTS -mainclass $2"
71 elif [[ $1 = '-selfloop' ]]
73 JAVAOPTS="$JAVAOPTS -selfloop $2"
75 elif [[ $1 = '-excprefetch' ]]
77 JAVAOPTS="$JAVAOPTS -excprefetch $2"
79 elif [[ $1 = '-dsm' ]]
81 JAVAOPTS="$JAVAOPTS -dsm"
83 elif [[ $1 = '-prefetch' ]]
85 JAVAOPTS="$JAVAOPTS -prefetch"
86 elif [[ $1 = '-printflat' ]]
88 JAVAOPTS="$JAVAOPTS -printflat"
89 elif [[ $1 = '-trueprob' ]]
91 JAVAOPTS="$JAVAOPTS -trueprob $2"
93 elif [[ $1 = '-mac' ]]
95 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
96 elif [[ $1 = '-profile' ]]
98 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
99 elif [[ $1 = '-taskstate' ]]
101 JAVAOPTS="$JAVAOPTS -taskstate"
102 elif [[ $1 = '-tagstate' ]]
104 JAVAOPTS="$JAVAOPTS -tagstate"
105 elif [[ $1 = '-scheduling' ]]
107 JAVAOPTS="$JAVAOPTS -scheduling"
108 elif [[ $1 = '-optional' ]]
110 JAVAOPTS="$JAVAOPTS -optional"
112 elif [[ $1 = '-dmalloc' ]]
115 elif [[ $1 = '-recover' ]]
118 JAVAOPTS="$JAVAOPTS -task"
119 elif [[ $1 = '-webinterface' ]]
121 JAVAOPTS="$JAVAOPTS -webinterface"
122 elif [[ $1 = '-instructionfailures' ]]
124 JAVAOPTS="$JAVAOPTS -instructionfailures"
125 elif [[ $1 = '-check' ]]
128 JAVAOPTS="$JAVAOPTS -conscheck"
129 elif [[ $1 = '-enable-assertions' ]]
131 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
132 elif [[ $1 = '-specdir' ]]
138 elif [[ $1 = '-debug' ]]
140 EXTRAOPTIONS="$EXTRAOPTIONS -g"
141 elif [[ $1 = '-runtimedebug' ]]
143 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
144 elif [[ $1 = '-nooptimize' ]]
146 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
147 elif [[ $1 = '-optimize' ]]
149 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
150 elif [[ $1 = '-thread' ]]
152 JAVAOPTS="$JAVAOPTS -thread"
153 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
155 elif [[ $1 = '-curdir' ]]
160 SRCFILES="$SRCFILES $1"
165 BUILDDIR="$CURDIR/tmpbuilddirectory"
173 if $CHECKFLAG #Generate structure files for repair tool
175 JAVAOPTS="$JAVAOPTS -struct structfile"
178 # Build bristlecone/java sources
180 #if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
181 if ! java $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
182 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
187 # Build all of the consistency specs
189 if $CHECKFLAG # CHECKFLAG
192 mkdir $BUILDDIR/specdir
193 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
195 echo > $BUILDDIR/specs
197 # compile specs into C code
198 for i in * # iterate over all directories
200 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
203 cat $BUILDDIR/structfile.struct $i.label > $i.struct
204 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
205 cp size.[c,h] $BUILDDIR/specdir
206 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
207 echo $i >> $BUILDDIR/specs
209 done # iterate over all directories
215 echo > $BUILDDIR/checkers.h
216 for i in `cat $BUILDDIR/specs`
218 gcc -O0 -g -fbounds-check -c $i\_aux.c
219 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
223 #build and link everything
227 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
230 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c \
231 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
232 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
233 $ROBUSTROOT/Runtime/ObjectHash.c \
234 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
235 $ROBUSTROOT/Runtime/math.c \
236 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
240 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
241 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"
246 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
247 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
252 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
253 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
258 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
263 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
264 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
269 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
272 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
273 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin