0b827e40b8689715b11a87a69cc9a744428732f7
[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 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread"
271 elif [[ $1 = '-mlpdebug' ]]
272 then
273 JAVAOPTS="$JAVAOPTS -mlpdebug"
274 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread"
275 elif [[ $1 = '-check' ]]
276 then
277 CHECKFLAG=true
278 JAVAOPTS="$JAVAOPTS -conscheck"
279 elif [[ $1 = '-enable-assertions' ]]
280 then
281 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
282 elif [[ $1 = '-specdir' ]]
283 then
284 cd $2
285 SPECDIR=`pwd`
286 cd $CURDIR
287 shift
288 elif [[ $1 = '-debug' ]]
289 then
290 DEBUGFLAG=true
291 EXTRAOPTIONS="$EXTRAOPTIONS -g -rdynamic"
292 elif [[ $1 = '-rawpath' ]]
293 then
294 RAWPATHFLAG=true
295 elif [[ $1 = '-runtimedebug' ]]
296 then
297 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
298 elif [[ $1 = '-dsmcaching' ]]
299 then
300 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
301 elif [[ $1 = '-rangeprefetch' ]]
302 then
303 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
304 elif [[ $1 = '-nooptimize' ]]
305 then
306 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
307 elif [[ $1 = '-optimize' ]]
308 then
309 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
310 elif [[ $1 = '-thread' ]]
311 then
312 JAVAOPTS="$JAVAOPTS -thread"
313 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
314 THREADFLAG=true
315 elif [[ $1 = '-distributioninfo' ]]
316 then
317 JAVAOPTS="$JAVAOPTS -distributioninfo"
318 elif [[ $1 = '-curdir' ]]
319 then
320 CURDIR=$2
321 shift
322 elif [[ $1 = '-outputdir' ]]
323 then
324 JAVAOPTS="$JAVAOPTS -outputdir $2"
325 shift
326 else
327 SRCFILES="$SRCFILES $1"
328 fi
329 shift
330 done
331
332 BUILDDIR="$CURDIR/tmpbuilddirectory"
333
334 cd $1
335 cd $CURDIR
336 shift
337
338 mkdir $BUILDDIR
339
340 if $CHECKFLAG #Generate structure files for repair tool
341 then
342 JAVAOPTS="$JAVAOPTS -struct structfile"
343 fi
344
345 # Setup class path
346
347 if $RECOVERFLAG
348 then
349 if $FASTCHECK
350 then
351 #fast transactions
352 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
353 else
354 #base bristlecone files
355 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
356 fi
357 else
358 if $DSMFLAG
359 then
360 #dsm stuff
361 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
362 elif $SINGLETM
363 then
364 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
365 elif $THREADFLAG
366 then
367 #threading java stuff
368 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
369 fi
370 #base java stuff
371 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
372 fi
373
374 # Build bristlecone/java sources
375
376 if $MULTICOREFLAG
377 then
378 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
379 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
380 -dir $BUILDDIR $JAVAOPTS $SRCFILES
381 then exit $?
382 fi
383 else
384 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
385 if ! $NOJAVA
386 then
387 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
388 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
389 $JAVAOPTS $SRCFILES
390 then exit $?
391 fi
392 fi
393 fi
394
395 if $EXITAFTERANALYSIS
396 then
397 exit
398 fi
399
400 # Build all of the consistency specs
401
402 if $CHECKFLAG # CHECKFLAG
403 then
404 cd $SPECDIR
405 mkdir $BUILDDIR/specdir
406 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
407
408 echo > $BUILDDIR/specs
409
410 # compile specs into C code
411 for i in * # iterate over all directories
412 do
413 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
414 then
415 cd $SPECDIR/$i
416 cat $BUILDDIR/structfile.struct $i.label > $i.struct
417 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
418 cp size.[c,h] $BUILDDIR/specdir
419 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
420 echo $i >> $BUILDDIR/specs
421 fi # CVSDIR CHECK
422 done # iterate over all directories
423
424 #compile C code
425
426 cd $BUILDDIR/specdir
427 ./buildrobust
428 echo > $BUILDDIR/checkers.h
429 for i in `cat $BUILDDIR/specs`
430 do
431 gcc -O0 -g -fbounds-check -c $i\_aux.c
432 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
433 done
434 fi # CHECKFLAG
435
436 #build and link everything
437
438 if $RAWFLAG
439 then # RAWFLAG
440 RAWDIR="$CURDIR/raw"
441 MAKEFILE="Makefile.raw"
442 mkdir $RAWDIR
443 cd $RAWDIR
444 make clean
445 rm ./*
446
447 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
448
449 if $CACHEFLUSHFLAG
450 then # print path
451 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
452 fi
453
454 if $RAWPATHFLAG
455 then # print path
456 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
457 fi
458
459 if $DEBUGFLAG
460 then #debug version
461 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DDEBUG"
462 fi
463
464 if $PROFILEFLAG
465 then # profile version
466 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
467 fi
468
469 if $USEIOFLAG
470 then # useio version
471 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
472 fi
473
474 if $INTERRUPTFLAG
475 then #INTERRUPT version
476 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
477 fi #INTERRUPT version
478
479 if $USEIOFLAG
480 then # useio version
481 MAKEFILE="$MAKEFILE.io"
482 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
483 else
484 MAKEFILE="$MAKEFILE.$RAWCONFIG"
485 fi #useio version
486
487 cp $ROBUSTROOT/Runtime/RAW/$MAKEFILE ./Makefile
488 cp ../Runtime/*.c ./
489 cp ../Runtime/*.h ./
490 cp ../Runtime/*.S ./
491 cp ../Runtime/*.s ./
492 cp ../Runtime/RAW/*.c ./
493 cp ../Runtime/RAW/*.h ./
494 cp ../Runtime/RAW/*.S ./
495 cp ../Runtime/RAW/*.s ./
496 cp ../tmpbuilddirectory/*.c ./
497 cp ../tmpbuilddirectory/*.h ./
498
499 make
500
501 elif $TILERAFLAG
502 then # TILERAFLAG
503 TILERADIR="$CURDIR/tilera"
504 MAKEFILE="Makefile.tilera.$TILERACONFIG"
505 SIMHVC="sim.hvc.$TILERACONFIG"
506 PCIHVC="pci.hvc.$TILERACONFIG"
507 mkdir $TILERADIR
508 cd $TILERADIR
509 make clean
510 rm ./*
511
512 export TILERACFLAGS="-DTASK -DMULTICORE"
513
514 if $CACHEFLUSHFLAG
515 then # print path
516 TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
517 fi
518
519 if $RAWPATHFLAG
520 then # print path
521 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
522 fi
523
524 if $DEBUGFLAG
525 then #debug version
526 TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
527 fi
528
529 if $PROFILEFLAG
530 then # profile version
531 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
532 fi
533
534 if $USEIOFLAG
535 then # useio version
536 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
537 fi
538
539 if $INTERRUPTFLAG
540 then #INTERRUPT version
541 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
542 fi #INTERRUPT version
543
544 cp $ROBUSTROOT/Tilera/Runtime/$MAKEFILE ./Makefile
545 cp $ROBUSTROOT/Tilera/Runtime/$SIMHVC ./sim.hvc
546 cp $ROBUSTROOT/Tilera/Runtime/$PCIHVC ./pci.hvc
547 cp $ROBUSTROOT/Tilera/Runtime/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
548 cp ../Runtime/multicoretask.c ./
549 cp ../Runtime/multicoreruntime.c ./
550 cp ../Runtime/Queue.c ./
551 cp ../Runtime/file.c ./
552 cp ../Runtime/math.c ./
553 cp ../Runtime/object.c ./
554 cp ../Runtime/GenericHashtable.c ./
555 cp ../Runtime/SimpleHash.c ./
556 cp ../Runtime/ObjectHash.c ./
557 cp ../Runtime/socket.c ./
558 cp ../Runtime/mem.c ./
559 cp ../Runtime/GenericHashtable.h ./
560 cp ../Runtime/mem.h ./
561 cp ../Runtime/multicoreruntime.h ./
562 cp ../Runtime/object.h ./
563 cp ../Runtime/ObjectHash.h ./
564 cp ../Runtime/Queue.h ./
565 cp ../Runtime/runtime.h ./
566 cp ../Runtime/SimpleHash.h ./
567 cp ../Tilera/Runtime/*.c ./
568 cp ../Tilera/Runtime/*.h ./
569 cp ../Tilera/lib/* ./
570 cp ../tmpbuilddirectory/*.c ./
571 cp ../tmpbuilddirectory/*.h ./
572
573 else #!RAWFLAG && !TILERAFLAG
574 cd $CURDIR 
575
576 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
577 -I$BUILDDIR"
578
579 if $MULTICOREFLAG
580 then
581 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
582 else
583 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
584 fi
585
586 FILES="$RUNTIMEFILE \
587 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
588 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
589 $ROBUSTROOT/Runtime/ObjectHash.c \
590 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
591 $ROBUSTROOT/Runtime/math.c \
592 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
593
594 if $FASTMEMCPY
595 then
596 FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
597 fi
598
599 if $DSMFLAG
600 then
601 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
602 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"
603 fi
604
605 if $SINGLETM
606 then
607 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME"
608 FILES="$FILES $DSMRUNTIME/stmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c"
609 fi
610
611 if $ABORTREADERS
612 then
613 FILES="$FILES $DSMRUNTIME/abortreaders.c"
614 fi
615
616 if $FASTCHECK
617 then
618 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
619 fi
620
621 if $MLP
622 then
623 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
624 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
625 FILES="$FILES $ROBUSTROOT/Runtime/workschedule.c"
626 fi
627
628 if $RECOVERFLAG
629 then
630 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
631 if $MULTICOREFLAG
632 then
633 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
634 fi
635 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
636 if $RAWFLAG
637 then
638 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
639 fi
640 if $THREADSIMULATEFLAG
641 then
642 # -lpthread for pthread functions, -lrt for message queue functions
643 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
644 fi
645 fi
646
647 if $OPTIONALFLAG
648 then
649 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
650 FILES="$FILES tmpbuilddirectory/optionalarrays.c"
651 fi
652
653 if $THREADFLAG
654 then
655 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
656 fi
657
658 if $CHECKFLAG
659 then
660 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
661 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
662 fi
663
664 if $USEDMALLOC
665 then
666 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
667 fi
668
669 if $MULTICOREFLAG
670 then
671 gcc $INCLUDES $EXTRAOPTIONS \
672 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
673 else
674 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
675 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
676 fi
677
678 fi #!RAWFLAG
679
680 exit
681