4 echo -dsm distributed shared memory
5 echo -mac distributed shared memory mac support
6 echo -check generate check code
7 echo -dmalloc link in dmalloc
8 echo -recover compile task code
9 echo -specdir directory
10 echo -selfloop task - this task cannot self loop forever
11 echo -taskstate do task state analysis
12 echo -optional enable optional
13 echo -debug generate debug symbols
14 echo -prefetch prefetch analysis
15 echo -webinterface enable web interface
16 echo -runtimedebug printout runtime debug messages
17 echo "-thread use support for multiple threads"
18 echo "-optimize call gcc with -O9 (optimize)"
19 echo "-nooptimize call gcc with -O0 (do not optimize)"
20 echo -curdir directory
21 echo -mainclass class with main method
23 echo -instructionfailures inject code for instructionfailures
24 echo -profile build with profile options
25 echo "-enable-assertions execute assert statements during compilation"
29 ROBUSTROOT=~/research/Robust/src
30 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
31 REPAIRROOT=~/research/Repair/RepairCompiler/
62 elif [[ $1 = '-mainclass' ]]
64 JAVAOPTS="$JAVAOPTS -mainclass $2"
66 elif [[ $1 = '-selfloop' ]]
68 JAVAOPTS="$JAVAOPTS -selfloop $2"
70 elif [[ $1 = '-dsm' ]]
72 JAVAOPTS="$JAVAOPTS -dsm"
74 elif [[ $1 = '-prefetch' ]]
76 JAVAOPTS="$JAVAOPTS -prefetch"
77 elif [[ $1 = '-mac' ]]
79 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
80 elif [[ $1 = '-profile' ]]
82 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
83 elif [[ $1 = '-taskstate' ]]
85 JAVAOPTS="$JAVAOPTS -taskstate"
86 elif [[ $1 = '-optional' ]]
88 JAVAOPTS="$JAVAOPTS -optional"
90 elif [[ $1 = '-dmalloc' ]]
93 elif [[ $1 = '-recover' ]]
96 JAVAOPTS="$JAVAOPTS -task"
97 elif [[ $1 = '-webinterface' ]]
99 JAVAOPTS="$JAVAOPTS -webinterface"
100 elif [[ $1 = '-instructionfailures' ]]
102 JAVAOPTS="$JAVAOPTS -instructionfailures"
103 elif [[ $1 = '-check' ]]
106 JAVAOPTS="$JAVAOPTS -conscheck"
107 elif [[ $1 = '-enable-assertions' ]]
109 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
110 elif [[ $1 = '-specdir' ]]
116 elif [[ $1 = '-debug' ]]
118 EXTRAOPTIONS="$EXTRAOPTIONS -g"
119 elif [[ $1 = '-runtimedebug' ]]
121 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
122 elif [[ $1 = '-nooptimize' ]]
124 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
125 elif [[ $1 = '-optimize' ]]
127 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
128 elif [[ $1 = '-thread' ]]
130 JAVAOPTS="$JAVAOPTS -thread"
131 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
133 elif [[ $1 = '-curdir' ]]
138 SRCFILES="$SRCFILES $1"
143 BUILDDIR="$CURDIR/tmpbuilddirectory"
151 if $CHECKFLAG #Generate structure files for repair tool
153 JAVAOPTS="$JAVAOPTS -struct structfile"
156 # Build bristlecone/java sources
158 if ! java $JAVAFORWARDOPTS -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
159 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
164 # Build all of the consistency specs
166 if $CHECKFLAG # CHECKFLAG
169 mkdir $BUILDDIR/specdir
170 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
172 echo > $BUILDDIR/specs
174 # compile specs into C code
175 for i in * # iterate over all directories
177 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
180 cat $BUILDDIR/structfile.struct $i.label > $i.struct
181 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
182 cp size.[c,h] $BUILDDIR/specdir
183 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
184 echo $i >> $BUILDDIR/specs
186 done # iterate over all directories
192 echo > $BUILDDIR/checkers.h
193 for i in `cat $BUILDDIR/specs`
195 gcc -O0 -g -c $i\_aux.c
196 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
200 #build and link everything
204 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
207 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c \
208 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
209 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
210 $ROBUSTROOT/Runtime/ObjectHash.c \
211 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
212 $ROBUSTROOT/Runtime/math.c \
213 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
217 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
218 FILES="$FILES $DSMRUNTIME/trans.c $DSMRUNTIME/mcpileq.c $DSMRUNTIME/objstr.c $DSMRUNTIME/dstm.c $DSMRUNTIME/mlookup.c $DSMRUNTIME/clookup.c $DSMRUNTIME/llookup.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"
223 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
224 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
229 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
230 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
235 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
240 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
241 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
246 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
249 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
250 tmpbuilddirectory/methods.c $FILES -o $MAINFILE.bin