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