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