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