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