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
28 ROBUSTROOT=~/research/Robust/src
29 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
30 REPAIRROOT=~/research/Repair/RepairCompiler/
60 elif [[ $1 = '-mainclass' ]]
62 JAVAOPTS="$JAVAOPTS -mainclass $2"
64 elif [[ $1 = '-selfloop' ]]
66 JAVAOPTS="$JAVAOPTS -selfloop $2"
68 elif [[ $1 = '-dsm' ]]
70 JAVAOPTS="$JAVAOPTS -dsm"
72 elif [[ $1 = '-prefetch' ]]
74 JAVAOPTS="$JAVAOPTS -prefetch"
75 elif [[ $1 = '-mac' ]]
77 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
78 elif [[ $1 = '-profile' ]]
80 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
81 elif [[ $1 = '-taskstate' ]]
83 JAVAOPTS="$JAVAOPTS -taskstate"
84 elif [[ $1 = '-optional' ]]
86 JAVAOPTS="$JAVAOPTS -optional"
88 elif [[ $1 = '-dmalloc' ]]
91 elif [[ $1 = '-recover' ]]
94 JAVAOPTS="$JAVAOPTS -task"
95 elif [[ $1 = '-webinterface' ]]
97 JAVAOPTS="$JAVAOPTS -webinterface"
98 elif [[ $1 = '-instructionfailures' ]]
100 JAVAOPTS="$JAVAOPTS -instructionfailures"
101 elif [[ $1 = '-check' ]]
104 JAVAOPTS="$JAVAOPTS -conscheck"
105 elif [[ $1 = '-enable-assertions' ]]
107 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
108 elif [[ $1 = '-specdir' ]]
114 elif [[ $1 = '-debug' ]]
116 EXTRAOPTIONS="$EXTRAOPTIONS -g"
117 elif [[ $1 = '-runtimedebug' ]]
119 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
120 elif [[ $1 = '-nooptimize' ]]
122 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
123 elif [[ $1 = '-optimize' ]]
125 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
126 elif [[ $1 = '-thread' ]]
128 JAVAOPTS="$JAVAOPTS -thread"
129 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
131 elif [[ $1 = '-curdir' ]]
136 SRCFILES="$SRCFILES $1"
141 BUILDDIR="$CURDIR/tmpbuilddirectory"
149 if $CHECKFLAG #Generate structure files for repair tool
151 JAVAOPTS="$JAVAOPTS -struct structfile"
154 # Build bristlecone/java sources
156 if ! java $JAVAFORWARDOPTS -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
157 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
162 # Build all of the consistency specs
164 if $CHECKFLAG # CHECKFLAG
167 mkdir $BUILDDIR/specdir
168 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
170 echo > $BUILDDIR/specs
172 # compile specs into C code
173 for i in * # iterate over all directories
175 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
178 cat $BUILDDIR/structfile.struct $i.label > $i.struct
179 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
180 cp size.[c,h] $BUILDDIR/specdir
181 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
182 echo $i >> $BUILDDIR/specs
184 done # iterate over all directories
190 echo > $BUILDDIR/checkers.h
191 for i in `cat $BUILDDIR/specs`
193 gcc -O0 -g -c $i\_aux.c
194 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
198 #build and link everything
202 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
205 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c \
206 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
207 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
208 $ROBUSTROOT/Runtime/ObjectHash.c \
209 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
210 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
214 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
215 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"
220 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
221 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
226 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
227 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
232 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
237 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
238 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
243 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
246 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
247 tmpbuilddirectory/methods.c $FILES -o $MAINFILE.bin