updates for multicore version runtime, temporarily disable math operations in multico...
[IRC.git] / Robust / src / buildscript
1 #!/bin/bash
2
3 printhelp() {
4 echo -robustroot set up the ROBUSTROOT to directory other than default one
5 echo -dsm distributed shared memory
6 echo -singleTM single machine committing transactions
7 echo -stmdebug STM debug
8 echo "-stmstats prints single machine commit (stm) statistics for the benchmark"
9 echo -abortreaders abort readers immediately
10 echo -trueprob double - probabiltiy of true branch
11 echo -dsmcaching -enable caching in dsm runtime
12 echo -mac distributed shared memory mac support
13 echo -check generate check code
14 echo -dmalloc link in dmalloc
15 echo -64bit compile for 64 bit machine
16 echo -joptimize java compiler optimizations
17 echo -dcopts conflict optimizations for transactional memory
18 echo -recover compile task code
19 echo -fastcheck fast checkpointing for Bristlecone
20 echo -specdir directory
21 echo -printflat print out flat representation
22 echo -selfloop task - this task cannot self loop forever
23 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
24 echo -taskstate do task state analysis
25 echo -tagstate do tag state analysis
26 echo -scheduling do task scheduling
27 echo -multicore generate multi-core version binary
28 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
29 echo "-cacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
30 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
31 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
32 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
33 echo -printscheduling print out scheduling graphs
34 echo -printschedulesim print out scheduling simulator result graphs
35 echo -abcclose close the array boundary check
36 echo "-tilera generate tilera version binary (should be used together with -multicore"
37 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
38 echo "-raw generate raw version binary (should be used together with -multicore)"
39 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
40 echo -threadsimulate generate multi-thread simulate version binary
41 echo -optional enable optional
42 echo -debug generate debug symbols
43 echo -prefetch do prefetch analysis
44 echo -transstats generates transaction stats on commits and aborts
45 echo -garbagestats Print garbage collection statistics
46 echo -webinterface enable web interface
47 echo -runtimedebug printout runtime debug messages
48 echo "-thread use support for multiple threads"
49 echo "-optimize call gcc with -O9 (optimize)"
50 echo "-nooptimize call gcc with -O0 (do not optimize)"
51 echo -curdir directory 
52 echo -mainclass class with main method
53 echo -o binary
54 echo -nojava do not run bristlecone compiler
55 echo -instructionfailures inject code for instructionfailures
56 echo -profile build with profile options
57 echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
58 echo "-enable-assertions execute assert statements during compilation"
59 echo -justanalyze exit after compiler analyses complete
60 echo -help help
61 }
62
63 ABORTREADERS=false;
64 ROBUSTROOT=~/research/Robust/src
65 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
66 REPAIRROOT=~/research/Repair/RepairCompiler/
67 CURDIR=`pwd`
68 DSMFLAG=false
69 SINGLETM=false
70 NOJAVA=false
71 CHECKFLAG=false
72 RECOVERFLAG=false
73 MLPFLAG=false
74 MLPDEBUG=false
75 MULTICOREFLAG=false
76 RAWFLAG=false
77 TILERAFLAG=false
78 TILERACONFIG=''
79 CACHEFLUSHFLAG=false
80 RAWCONFIG=''
81 DEBUGFLAG=false
82 RAWPATHFLAG=false
83 PROFILEFLAG=false
84 USEIOFLAG=false
85 INTERRUPTFLAG=false
86 THREADSIMULATEFLAG=false;
87 USEDMALLOC=false
88 THREADFLAG=false
89 FASTCHECK=false
90 SPECDIR=`pwd`
91 SRCFILES=''
92 EXTRAOPTIONS=''
93 MAINFILE='a'
94 JAVAFORWARDOPTS=''
95 JAVAOPTS=''
96 OPTIONALFLAG=false
97 EXITAFTERANALYSIS=false
98
99 if [[ -z $1 ]]
100 then
101 printhelp
102 exit
103 fi
104
105 while [[ -n $1 ]]
106 do
107 if [[ $1 = '-help' ]]
108 then
109 printhelp
110 exit
111 elif [[ $1 = '-justanalyze' ]]
112 then
113 EXITAFTERANALYSIS=true
114 elif [[ $1 = '-abortreaders' ]]
115 then
116 ABORTREADERS=true
117 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
118 JAVAOPTS="$JAVAOPTS -abortreaders"
119 elif [[ $1 = '-robustroot' ]]
120 then
121 ROBUSTROOT="$2"
122 shift
123 elif [[ $1 = '-nojava' ]]
124 then
125 NOJAVA=true
126 elif [[ $1 = '-garbagestats' ]]
127 then
128 EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
129 elif [[ $1 = '-64bit' ]]
130 then
131 EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64"
132 elif [[ $1 = '-fastcheck' ]]
133 then
134 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
135 JAVAOPTS="$JAVAOPTS -fastcheck"
136 FASTCHECK=true
137 elif [[ $1 = '-o' ]]
138 then
139 MAINFILE="$2"
140 shift
141 elif [[ $1 = '-mainclass' ]]
142 then
143 JAVAOPTS="$JAVAOPTS -mainclass $2"
144 shift
145 elif [[ $1 = '-selfloop' ]]
146 then
147 JAVAOPTS="$JAVAOPTS -selfloop $2"
148 shift
149 elif [[ $1 = '-excprefetch' ]]
150 then
151 JAVAOPTS="$JAVAOPTS -excprefetch $2"
152 shift
153 elif [[ $1 = '-dsm' ]]
154 then
155 JAVAOPTS="$JAVAOPTS -dsm"
156 DSMFLAG=true
157 elif [[ $1 = '-singleTM' ]]
158 then
159 JAVAOPTS="$JAVAOPTS -singleTM"
160 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
161 SINGLETM=true
162 elif [[ $1 = '-stmdebug' ]]
163 then
164 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
165 elif [[ $1 = '-stmstats' ]]
166 then
167 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
168 elif [[ $1 = '-prefetch' ]]
169 then
170 JAVAOPTS="$JAVAOPTS -prefetch"
171 elif [[ $1 = '-transstats' ]]
172 then
173 EXTRAOPTIONS="$EXTRAOPTIONS -DTRANSSTATS"
174 elif [[ $1 = '-printflat' ]]
175 then
176 JAVAOPTS="$JAVAOPTS -printflat"
177 elif [[ $1 = '-trueprob' ]]
178 then
179 JAVAOPTS="$JAVAOPTS -trueprob $2"
180 shift
181 elif [[ $1 = '-mac' ]]
182 then
183 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
184 elif [[ $1 = '-profile' ]]
185 then
186 PROFILEFLAG=true
187 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
188 elif [[ $1 = '-useio' ]]
189 then
190 USEIOFLAG=true
191 elif [[ $1 = '-taskstate' ]]
192 then
193 JAVAOPTS="$JAVAOPTS -taskstate"
194 elif [[ $1 = '-tagstate' ]]
195 then
196 JAVAOPTS="$JAVAOPTS -tagstate"
197 elif [[ $1 = '-scheduling' ]]
198 then
199 JAVAOPTS="$JAVAOPTS -scheduling"
200 elif [[ $1 = '-multicore' ]]
201 then
202 MULTICOREFLAG=true
203 JAVAOPTS="$JAVAOPTS -multicore"
204 elif [[ $1 = '-numcore' ]]
205 then
206 JAVAOPTS="$JAVAOPTS -numcore $2"
207 shift
208 elif [[ $1 = '-raw' ]]
209 then
210 RAWFLAG=true
211 JAVAOPTS="$JAVAOPTS -raw"
212 elif [[ $1 = '-tilera' ]]
213 then
214 TILERAFLAG=true
215 elif [[ $1 = '-tileraconfig' ]]
216 then
217 TILERACONFIG="$2"
218 shift
219 elif [[ $1 = '-cacheflush' ]]
220 then
221 CACHEFLUSHFLAG=true
222 elif [[ $1 = '-rawconfig' ]]
223 then
224 RAWCONFIG="$2"
225 shift
226 elif [[ $1 = '-interrupt' ]]
227 then
228 INTERRUPTFLAG=true
229 elif [[ $1 = '-threadsimulate' ]]
230 then
231 THREADSIMULATEFLAG=true
232 elif [[ $1 = '-abcclose' ]]
233 then
234 JAVAOPTS="$JAVAOPTS -abcclose"
235 elif [[ $1 = '-optional' ]]
236 then
237 JAVAOPTS="$JAVAOPTS -optional"
238 OPTIONALFLAG=true
239 elif [[ $1 = '-dmalloc' ]]
240 then
241 USEDMALLOC=true
242 elif [[ $1 = '-recover' ]]
243 then
244 RECOVERFLAG=true
245 JAVAOPTS="$JAVAOPTS -task"
246 elif [[ $1 = '-useprofile' ]]
247 then
248 JAVAOPTS="$JAVAOPTS -useprofile"
249 elif [[ $1 = '-webinterface' ]]
250 then
251 JAVAOPTS="$JAVAOPTS -webinterface"
252 elif [[ $1 = '-instructionfailures' ]]
253 then
254 JAVAOPTS="$JAVAOPTS -instructionfailures"
255 elif [[ $1 = '-joptimize' ]]
256 then
257 JAVAOPTS="$JAVAOPTS -optimize"
258 elif [[ $1 = '-dcopts' ]]
259 then
260 JAVAOPTS="$JAVAOPTS -dcopts"
261 elif [[ $1 = '-mlp' ]]
262 then
263 JAVAOPTS="$JAVAOPTS -mlp"
264 elif [[ $1 = '-mlpdebug' ]]
265 then
266 JAVAOPTS="$JAVAOPTS -mlpdebug"
267 elif [[ $1 = '-check' ]]
268 then
269 CHECKFLAG=true
270 JAVAOPTS="$JAVAOPTS -conscheck"
271 elif [[ $1 = '-enable-assertions' ]]
272 then
273 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
274 elif [[ $1 = '-specdir' ]]
275 then
276 cd $2
277 SPECDIR=`pwd`
278 cd $CURDIR
279 shift
280 elif [[ $1 = '-debug' ]]
281 then
282 DEBUGFLAG=true
283 EXTRAOPTIONS="$EXTRAOPTIONS -g"
284 elif [[ $1 = '-rawpath' ]]
285 then
286 RAWPATHFLAG=true
287 elif [[ $1 = '-runtimedebug' ]]
288 then
289 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
290 elif [[ $1 = '-dsmcaching' ]]
291 then
292 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
293 elif [[ $1 = '-rangeprefetch' ]]
294 then
295 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
296 elif [[ $1 = '-nooptimize' ]]
297 then
298 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
299 elif [[ $1 = '-optimize' ]]
300 then
301 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
302 elif [[ $1 = '-thread' ]]
303 then
304 JAVAOPTS="$JAVAOPTS -thread"
305 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
306 THREADFLAG=true
307 elif [[ $1 = '-distributioninfo' ]]
308 then
309 JAVAOPTS="$JAVAOPTS -distributioninfo"
310 elif [[ $1 = '-curdir' ]]
311 then
312 CURDIR=$2
313 shift
314 elif [[ $1 = '-outputdir' ]]
315 then
316 JAVAOPTS="$JAVAOPTS -outputdir $2"
317 shift
318 else
319 SRCFILES="$SRCFILES $1"
320 fi
321 shift
322 done
323
324 BUILDDIR="$CURDIR/tmpbuilddirectory"
325
326 cd $1
327 cd $CURDIR
328 shift
329
330 mkdir $BUILDDIR
331
332 if $CHECKFLAG #Generate structure files for repair tool
333 then
334 JAVAOPTS="$JAVAOPTS -struct structfile"
335 fi
336
337 # Setup class path
338
339 if $RECOVERFLAG
340 then
341 if $FASTCHECK
342 then
343 #fast transactions
344 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
345 else
346 #base bristlecone files
347 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
348 fi
349 else
350 if $DSMFLAG
351 then
352 #dsm stuff
353 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
354 elif $SINGLETM
355 then
356 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
357 elif $THREADFLAG
358 then
359 #threading java stuff
360 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
361 fi
362 #base java stuff
363 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
364 fi
365
366 # Build bristlecone/java sources
367
368 if $MULTICOREFLAG
369 then
370 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
371 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
372 -dir $BUILDDIR $JAVAOPTS $SRCFILES
373 then exit $?
374 fi
375 else
376 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
377 if ! $NOJAVA
378 then
379 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
380 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
381 $JAVAOPTS $SRCFILES
382 then exit $?
383 fi
384 fi
385 fi
386
387 if $EXITAFTERANALYSIS
388 then
389 exit
390 fi
391
392 # Build all of the consistency specs
393
394 if $CHECKFLAG # CHECKFLAG
395 then
396 cd $SPECDIR
397 mkdir $BUILDDIR/specdir
398 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
399
400 echo > $BUILDDIR/specs
401
402 # compile specs into C code
403 for i in * # iterate over all directories
404 do
405 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
406 then
407 cd $SPECDIR/$i
408 cat $BUILDDIR/structfile.struct $i.label > $i.struct
409 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
410 cp size.[c,h] $BUILDDIR/specdir
411 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
412 echo $i >> $BUILDDIR/specs
413 fi # CVSDIR CHECK
414 done # iterate over all directories
415
416 #compile C code
417
418 cd $BUILDDIR/specdir
419 ./buildrobust
420 echo > $BUILDDIR/checkers.h
421 for i in `cat $BUILDDIR/specs`
422 do
423 gcc -O0 -g -fbounds-check -c $i\_aux.c
424 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
425 done
426 fi # CHECKFLAG
427
428 #build and link everything
429
430 if $RAWFLAG
431 then # RAWFLAG
432 RAWDIR="$CURDIR/raw"
433 MAKEFILE="Makefile.raw"
434 mkdir $RAWDIR
435 cd $RAWDIR
436 make clean
437 rm ./*
438
439 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
440
441 if $CACHEFLUSHFLAG
442 then # print path
443 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
444 fi
445
446 if $RAWPATHFLAG
447 then # print path
448 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
449 fi
450
451 if $DEBUGFLAG
452 then #debug version
453 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DDEBUG"
454 fi
455
456 if $PROFILEFLAG
457 then # profile version
458 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
459 fi
460
461 if $USEIOFLAG
462 then # useio version
463 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
464 fi
465
466 if $INTERRUPTFLAG
467 then #INTERRUPT version
468 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
469 fi #INTERRUPT version
470
471 if $USEIOFLAG
472 then # useio version
473 MAKEFILE="$MAKEFILE.io"
474 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
475 else
476 MAKEFILE="$MAKEFILE.$RAWCONFIG"
477 fi #useio version
478
479 cp $ROBUSTROOT/Runtime/RAW/$MAKEFILE ./Makefile
480 cp ../Runtime/*.c ./
481 cp ../Runtime/*.h ./
482 cp ../Runtime/*.S ./
483 cp ../Runtime/*.s ./
484 cp ../Runtime/RAW/*.c ./
485 cp ../Runtime/RAW/*.h ./
486 cp ../Runtime/RAW/*.S ./
487 cp ../Runtime/RAW/*.s ./
488 cp ../tmpbuilddirectory/*.c ./
489 cp ../tmpbuilddirectory/*.h ./
490
491 make
492
493 elif $TILERAFLAG
494 then # TILERAFLAG
495 TILERADIR="$CURDIR/tilera"
496 MAKEFILE="Makefile.tilera.$TILERACONFIG"
497 SIMHVC="sim.hvc.$TILERACONFIG"
498 mkdir $TILERADIR
499 cd $TILERADIR
500 make clean
501 rm ./*
502
503 export TILERACFLAGS="-DTASK -DMULTICORE"
504
505 if $CACHEFLUSHFLAG
506 then # print path
507 TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
508 fi
509
510 if $RAWPATHFLAG
511 then # print path
512 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
513 fi
514
515 if $DEBUGFLAG
516 then #debug version
517 TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
518 fi
519
520 if $PROFILEFLAG
521 then # profile version
522 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
523 fi
524
525 if $USEIOFLAG
526 then # useio version
527 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
528 fi
529
530 if $INTERRUPTFLAG
531 then #INTERRUPT version
532 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
533 fi #INTERRUPT version
534
535 cp $ROBUSTROOT/Runtime/Tilera/$MAKEFILE ./Makefile
536 cp $ROBUSTROOT/Runtime/Tilera/$SIMHVS ./sim.hvc
537 cp ../Runtime/multicoretask.c ./
538 cp ../Runtime/multicoreruntime.c ./
539 cp ../Runtime/Queue.c ./
540 cp ../Runtime/file.c ./
541 cp ../Runtime/math.c ./
542 cp ../Runtime/object.c ./
543 cp ../Runtime/GenericHashtable.c ./
544 cp ../Runtime/SimpleHash.c ./
545 cp ../Runtime/ObjectHash.c ./
546 cp ../Runtime/socket.c ./
547 cp ../Runtime/mem.c ./
548 cp ../Runtime/GenericHashtable.h ./
549 cp ../Runtime/mem.h ./
550 cp ../Runtime/multicoreruntime.h ./
551 cp ../Runtime/object.h ./
552 cp ../Runtime/ObjectHash.h ./
553 cp ../Runtime/Queue.h ./
554 cp ../Runtime/runtime.h ./
555 cp ../Runtime/SimpleHash.h ./
556 cp ../Runtime/Tilera/*.c ./
557 cp ../Runtime/Tilera/*.h ./
558 cp ../tmpbuilddirectory/*.c ./
559 cp ../tmpbuilddirectory/*.h ./
560
561 else #!RAWFLAG && !TILERAFLAG
562 cd $CURDIR 
563
564 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
565 -I$BUILDDIR"
566
567 if $MULTICOREFLAG
568 then
569 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
570 else
571 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
572 fi
573
574 FILES="$RUNTIMEFILE \
575 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
576 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
577 $ROBUSTROOT/Runtime/ObjectHash.c \
578 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
579 $ROBUSTROOT/Runtime/math.c \
580 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
581
582 if $DSMFLAG
583 then
584 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
585 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 $ROBUSTROOT/Runtime/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRUNTIME/sockpool.c $DSMRUNTIME/addUdpEnhance.c $DSMRUNTIME/signal.c $DSMRUNTIME/gCollect.c $DSMRUNTIME/addPrefetchEnhance.c $DSMRUNTIME/dsmlock.c $DSMRUNTIME/prefetch.c"
586 fi
587
588 if $SINGLETM
589 then
590 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME"
591 FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c"
592 fi
593
594 if $ABORTREADERS
595 then
596 FILES="$FILES $DSMRUNTIME/abortreaders.c"
597 fi
598
599 if $FASTCHECK
600 then
601 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
602 fi
603
604 if $MLP
605 then
606 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
607 fi
608
609 if $RECOVERFLAG
610 then
611 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
612 if $MULTICOREFLAG
613 then
614 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
615 fi
616 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
617 if $RAWFLAG
618 then
619 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
620 fi
621 if $THREADSIMULATEFLAG
622 then
623 # -lpthread for pthread functions, -lrt for message queue functions
624 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
625 fi
626 fi
627
628 if $OPTIONALFLAG
629 then
630 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
631 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
632 fi
633
634 if $THREADFLAG
635 then
636 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
637 fi
638
639 if $CHECKFLAG
640 then
641 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
642 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
643 fi
644
645 if $USEDMALLOC
646 then
647 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
648 fi
649
650 if $MULTICOREFLAG
651 then
652 gcc $INCLUDES $EXTRAOPTIONS \
653 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
654 else
655 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
656 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
657 fi
658
659 fi #!RAWFLAG
660
661 exit
662