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