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