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