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