Recent code changes: remove redundant code/comment and format the code a little bit
[IRC.git] / Robust / src / buildscript
1 #!/bin/bash
2
3 printhelp() {
4 echo STM Options
5 echo -singleTM single machine committing transactions
6 echo -stmdebug STM debug
7 echo "-stmstats prints single machine commit (stm) statistics for the benchmark"
8 echo -fastmemcpy use fast memcpy
9 echo -sandbox sandbox transactions
10 echo -dcopts conflict optimizations for transactional memory
11 echo -transstats generates transaction stats on commits and aborts
12 echo -inlineatomic depth inline methods inside of transactions to specified depth
13 echo "-stmarray partial array treatment"
14 echo "-dualview dual view of arrays"
15 echo "-hybrid use fission only when it looks like a good choice"
16 echo "-numa numa aware"
17 echo "-eventmonitor turn on transaction event trace recording"
18 echo
19 echo OOOJava options
20 echo -coreprof turn on profiling API
21 echo -coreprof-checkoverflow ONLY use for debugging event overflow
22 echo "-ooojava <numberofcores> <maxseseage>"
23 echo -ooodebug general OOOJava debugging messages
24 echo -rcr turn on runtime conflict resolver
25 echo
26 echo Disjoint Reachability Analysis options
27 echo -disjoint enable analysis
28 echo -disjoint-k set k-limit for heap nodes per allocation site
29 echo "-disjoint-write-dots <all/final> write reach graphs for all method sols. or only final sols."
30 echo -disjoint-write-initial-contexts write reach graphs for callee initial contexts from all call sites
31 echo -disjoint-write-ihms write reach graphs for each call site\'s Initial Heap Model
32 echo "-disjoint-alias-file <filename> <normal/tabbed> write sharing for normal human reading or LaTeX tabbed"
33 echo "-disjoint-debug-callsite <callee> <caller> <visit to start> <num caps> <T/F stop after>"
34 echo "  To debug call site, give callee caller symbols (ie foo) the analysis visit to start capturing, num captures to take, and whether to halt analysis after capturing"
35 echo "-disjoint-debug-snap-method <method> <visit to start> <num caps> <T/F stop after>"
36 echo "  To take snapshots at statements, give method symbol, the analysis visit to start capturing, num captures to take, and whether to halt analsyis after capturing"
37 echo "-disjoint-dvisit-stack use stack strat to visit descriptors (tasks or methods)"
38 echo -disjoint-dvisit-stack-callees-on-top alternate stack strat
39 echo -disjoint-dvisit-pqueue use prio. q strat to visit descriptors
40 echo -disjoint-desire-determinism set above interproc for determinism
41 echo -disjoint-debug-scheduling debug when methods are scheduled for analysis
42 echo 
43 echo "-mlp <num cores> <max sese age> build mlp code"
44 echo -mlpdebug if mlp, report progress and interim results
45 echo
46 echo DSM options
47 echo -dsm distributed shared memory
48 echo -abortreaders abort readers immediately
49 echo -trueprob double - probabiltiy of true branch
50 echo -dsmcaching -enable caching in dsm runtime
51 echo
52 echo BAMBOO Multicore options
53 echo -scheduling do task scheduling
54 echo -multicore generate multi-core version binary
55 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
56 echo "-cacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
57 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
58 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
59 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
60 echo -printscheduling print out scheduling graphs
61 echo -printschedulesim print out scheduling simulator result graphs
62 echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
63 echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
64 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
65 echo "-raw generate raw version binary (should be used together with -multicore)"
66 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
67 echo -multicoregc generate multi-core binary with garbage collection
68 echo "-numcore4gc set the number of cores for gc (should be used together with -multicoregc), defaultly set as 0"
69 echo "-gcmem_local set the gc shared memory allocation strategy as local (should be used together with -multicoregc)"
70 echo "-gcmem_fixed set the gc shared memory allocation strategy as fixed (should be used together with -multicoregc)"
71 echo "-gcmem_mixed set the gc shared memory allocation strategy as mixed (should be used together with -multicoregc)"
72 echo "-gcmem_global set the gc shared memory allocation strategy as global (should be used together with -multicoregc)"
73 echo "-gccache_local set the gc shared memory cache strategy as local (should be used together with -multicoregc)"
74 echo "-gccache_ran set the gc shared memory cache strategy as random (should be used together with -multicoregc)"
75 echo "-gccontroller_near set the gc shared memory to use the nearest controller for each core (should be used together with -multicoregc)"
76 echo "-gccontroller_remote set the gc shared memory to use a remote controller for each core (should be used together with -multicoregc)"
77 echo "-gcsmallpagesize(2) set the gc shared memory to use small page size (should be used together with -multicoregc)"
78 echo "-gclargepagesize set the gc shared memory to use large page size (should be used together with -multicoregc)"
79 echo "-gclargesharedheap(2) set the gc shared memory as large (should be used together with -multicoregc)"
80 echo -gcprofile build with gcprofile options
81 echo "-tilera_memprof build the memprof version (should be used together with -tilera_xx) "
82 echo -accurateprofile build with accurate profile information including pre/post task processing info
83 echo -profile_interrupt build with profile information of interrupts
84 echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
85 echo
86 echo Other options
87 echo -abcclose turnoff array boundary checks
88 echo -builddir setup different build directory
89 echo -robustroot set up the ROBUSTROOT to directory other than default one
90 echo -readset turn on readset
91 echo -mac distributed shared memory mac support
92 echo -check generate check code
93 echo -dmalloc link in dmalloc
94 echo -64bit compile for 64 bit machine
95 echo -32bit compile for 32 bit machine
96 echo -joptimize java compiler optimizations
97 echo -noloop turnoff loop optimizations
98 echo -recover compile task code
99 echo -fastcheck fast checkpointing for Bristlecone
100 echo -specdir directory
101 echo -printflat print out flat representation
102 echo -selfloop task - this task cannot self loop forever
103 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
104 echo -taskstate do task state analysis
105 echo -tagstate do tag state analysis
106 echo -optional enable optional
107 echo -debug generate debug symbols
108 echo -prefetch do prefetch analysis
109 echo -heapsize-mb NUM  set initial heap size in MB, default is 256
110 echo -garbagestats Print garbage collection statistics
111 echo -webinterface enable web interface
112 echo -runtimedebug printout runtime debug messages
113 echo "-thread use support for multiple threads"
114 echo "-optimize call gcc with -O9 (optimize)"
115 echo "-nooptimize call gcc with -O0 (do not optimize)"
116 echo -curdir directory 
117 echo -mainclass class with main method
118 echo -o binary
119 echo -nojava do not run bristlecone compiler
120 echo -instructionfailures inject code for instructionfailures
121 echo -profile build with profile options
122 echo "-enable-assertions execute assert statements during compilation"
123 echo -justanalyze exit after compiler analyses complete
124 echo "-distributioninfo  execute to collect distribution info for simulated annealing in multi-core version"
125 echo "-disall  execute to collect whole distribution"
126 echo "-disstart specify the start number of distribution information collection"
127 echo -assembly generate assembly
128 echo -recovery compile recovery code
129 echo -dsmtask support work and task class library
130 echo -recoverystats print out recovery record 
131 echo -help help
132 }
133
134 tmpbuilddirectory="tmpbuilddirectory"
135 COREPROF=false;
136 NUMA=false;
137 SANDBOX=false;
138 ABORTREADERS=false;
139 ROBUSTROOT=~/research/Robust/src
140 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
141 STMRUNTIME=$ROBUSTROOT/Runtime/STM/
142 DSMRECOVERYRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface_recovery/
143 REPAIRROOT=~/research/Repair/RepairCompiler/
144 CURDIR=`pwd`
145 DSMFLAG=false
146 DSMRECOVERY=false
147 FASTMEMCPY=false
148 STMARRAY=false
149 DUALVIEW=false
150 STM=false
151 EVENTMONITOR=false
152 NOJAVA=false
153 CHECKFLAG=false
154 RECOVERFLAG=false
155 MLP_ON=false
156 RCR=false
157 MLPDEBUG=false
158 MULTICOREFLAG=false
159 RAWFLAG=false
160 TILERAFLAG=false
161 TILERABMEFLAG=false
162 TILERAZLINUXFLAG=false
163 TILERAMEMPROFFLAG=false
164 TILERACONFIG=''
165 CACHEFLUSHFLAG=false
166 RAWCONFIG=''
167 DEBUGFLAG=false
168 RAWPATHFLAG=false
169 PROFILEFLAG=false
170 GCPROFILEFLAG=false
171 GCPROFILESFLAG=false
172 ACCURATEPROFILEFLAG=false
173 PROFILEINTERRUPTFLAG=false
174 USEIOFLAG=false
175 INTERRUPTFLAG=false
176 THREADSIMULATEFLAG=false;
177 MULTICOREGCFLAG=false;
178 GCMEMLOCALFLAG=false;
179 GCMEMFIXEDFLAG=false;
180 GCMEMMIXEDFLAG=false;
181 GCMEMGLOBALFLAG=false;
182 GCCACHELOCALFLAG=false;
183 GCCACHERANFLAG=false;
184 GCCONTROLLERNEARFLAG=false;
185 GCCONTROLLERREMOTEFLAG=false;
186 GCSMALLPAGESIZEFLAG=false;
187 GCLARGEPAGESIZEFLAG=false;
188 GCLARGESHAREDHEAPFLAG=false;
189 GCSMALLPAGESIZEFLAG2=false;
190 GCLARGESHAREDHEAPFLAG2=false;
191 USEDMALLOC=false
192 THREADFLAG=false
193 FASTCHECK=false
194 SPECDIR=`pwd`
195 SRCFILES=''
196 EXTRAOPTIONS=''
197 MAINFILE='a'
198 JAVAFORWARDOPTS=''
199 JAVAOPTS=''
200 OPTIONALFLAG=false
201 EXITAFTERANALYSIS=false
202 ASSEMBLY=false
203 GCCORES=''
204 GC1COREFLAG=false
205 TILERAN1COREFLAG=false
206 TILERA56COREFLAG=false
207
208 if [[ -z $1 ]]
209 then
210 printhelp
211 exit
212 fi
213
214 while [[ -n $1 ]]
215 do
216 if [[ $1 = '-help' ]]
217 then
218 printhelp
219 exit
220 elif [[ $1 = '-justanalyze' ]]
221 then
222 EXITAFTERANALYSIS=true
223 elif [[ $1 = '-assembly' ]]
224 then
225 ASSEMBLY=true
226 elif [[ $1 = '-abortreaders' ]]
227 then
228 ABORTREADERS=true
229 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
230 JAVAOPTS="$JAVAOPTS -abortreaders"
231 elif [[ $1 = '-sandbox' ]]
232 then
233 SANDBOX=true
234 EXTRAOPTIONS="$EXTRAOPTIONS -DSANDBOX"
235 JAVAOPTS="$JAVAOPTS -sandbox"
236 elif [[ $1 = '-numa' ]]
237 then
238 EXTRAOPTIONS="$EXTRAOPTIONS -DAFFINITY -D_GNU_SOURCE"
239 NUMA=true
240 elif [[ $1 = '-robustroot' ]]
241 then
242 ROBUSTROOT="$2"
243 shift
244 elif [[ $1 = '-builddir' ]]
245 then
246 tmpbuilddirectory="$2"
247 shift
248 elif [[ $1 = '-nojava' ]]
249 then
250 NOJAVA=true
251 elif [[ $1 = '-eventmonitor' ]]
252 then
253 JAVAOPTS="$JAVAOPTS -eventmonitor"
254 EVENTMONITOR=true
255 EXTRAOPTIONS="$EXTRAOPTIONS -DEVENTMONITOR"
256 elif [[ $1 = '-garbagestats' ]]
257 then
258 EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
259 elif [[ $1 = '-64bit' ]]
260 then
261 EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64 -m64"
262 elif [[ $1 = '-32bit' ]]
263 then
264 EXTRAOPTIONS="$EXTRAOPTIONS -m32"
265 elif [[ $1 = '-fastcheck' ]]
266 then
267 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
268 JAVAOPTS="$JAVAOPTS -fastcheck"
269 FASTCHECK=true
270 elif [[ $1 = '-o' ]]
271 then
272 MAINFILE="$2"
273 shift
274 elif [[ $1 = '-mainclass' ]]
275 then
276 JAVAOPTS="$JAVAOPTS -mainclass $2"
277 shift
278 elif [[ $1 = '-selfloop' ]]
279 then
280 JAVAOPTS="$JAVAOPTS -selfloop $2"
281 shift
282 elif [[ $1 = '-excprefetch' ]]
283 then
284 JAVAOPTS="$JAVAOPTS -excprefetch $2"
285 shift
286 elif [[ $1 = '-arraypad' ]]
287 then
288 JAVAOPTS="$JAVAOPTS -arraypad"
289 elif [[ $1 = '-dsm' ]]
290 then
291 JAVAOPTS="$JAVAOPTS -dsm"
292 DSMFLAG=true
293 elif [[ $1 = '-fastmemcpy' ]]
294 then
295 FASTMEMCPY=true
296 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTMEMCPY"
297 elif [[ $1 = '-singleTM' ]]
298 then
299 JAVAOPTS="$JAVAOPTS -singleTM"
300 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
301 STM=true
302 elif [[ $1 = '-stmarray' ]]
303 then
304 JAVAOPTS="$JAVAOPTS -stmarray"
305 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMARRAY"
306 STMARRAY=true
307 elif [[ $1 = '-dualview' ]]
308 then
309 JAVAOPTS="$JAVAOPTS -dualview"
310 EXTRAOPTIONS="$EXTRAOPTIONS -DDUALVIEW"
311 DUALVIEW=true
312 elif [[ $1 = '-readset' ]]
313 then
314 JAVAOPTS="$JAVAOPTS -readset"
315 EXTRAOPTIONS="$EXTRAOPTIONS -DREADSET"
316 elif [[ $1 = '-stmdebug' ]]
317 then
318 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
319 elif [[ $1 = '-stmstats' ]]
320 then
321 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
322 elif [[ $1 = '-stmlog' ]]
323 then
324 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMLOG"
325 elif [[ $1 = '-prefetch' ]]
326 then
327 JAVAOPTS="$JAVAOPTS -prefetch"
328 elif [[ $1 = '-transstats' ]]
329 then
330 EXTRAOPTIONS="$EXTRAOPTIONS -DTRANSSTATS"
331 elif [[ $1 = '-printflat' ]]
332 then
333 JAVAOPTS="$JAVAOPTS -printflat"
334 elif [[ $1 = '-trueprob' ]]
335 then
336 JAVAOPTS="$JAVAOPTS -trueprob $2"
337 shift
338 elif [[ $1 = '-inlineatomic' ]]
339 then
340 JAVAOPTS="$JAVAOPTS -inlineatomic $2"
341 shift
342 elif [[ $1 = '-mac' ]]
343 then
344 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
345 elif [[ $1 = '-profile' ]]
346 then
347 PROFILEFLAG=true
348 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
349 elif [[ $1 = '-gcprofile' ]]
350 then
351 GCPROFILEFLAG=true
352 elif [[ $1 = '-gcprofile_s' ]]
353 then
354 GCPROFILESFLAG=true
355 elif [[ $1 = '-accurateprofile' ]]
356 then
357 ACCURATEPROFILEFLAG=true
358 elif [[ $1 = '-profile_interrupt' ]]
359 then
360 PROFILEINTERRUPTFLAG=true
361 elif [[ $1 = '-useio' ]]
362 then
363 USEIOFLAG=true
364 elif [[ $1 = '-taskstate' ]]
365 then
366 JAVAOPTS="$JAVAOPTS -taskstate"
367 elif [[ $1 = '-tagstate' ]]
368 then
369 JAVAOPTS="$JAVAOPTS -tagstate"
370 elif [[ $1 = '-scheduling' ]]
371 then
372 JAVAOPTS="$JAVAOPTS -scheduling"
373 elif [[ $1 = '-multicore' ]]
374 then
375 MULTICOREFLAG=true
376 JAVAOPTS="$JAVAOPTS -multicore"
377 elif [[ $1 = '-numcore' ]]
378 then
379 JAVAOPTS="$JAVAOPTS -numcore $2"
380 if [[ "$2" -gt "1" ]]
381 then
382 TILERAN1COREFLAG=true
383 if [[ "$2" -eq "56" ]]
384 then
385 TILERA56COREFLAG=true
386 fi
387 fi
388 shift
389 elif [[ $1 = '-numcore4gc' ]]
390 then
391 JAVAOPTS="$JAVAOPTS -numcore4gc $2"
392 GCCORES="GC_$2"
393 if [[ "$2" -eq "1" ]]
394 then
395 GC1COREFLAG=true
396 fi
397 shift
398 elif [[ $1 = '-raw' ]]
399 then
400 RAWFLAG=true
401 JAVAOPTS="$JAVAOPTS -raw"
402 elif [[ $1 = '-tilera_bme' ]]
403 then
404 TILERAFLAG=true
405 TILERABMEFLAG=true
406 elif [[ $1 = '-tilera_zlinux' ]]
407 then
408 TILERAFLAG=true
409 TILERAZLINUXFLAG=true
410 elif [[ $1 = '-tilera_memprof' ]]
411 then
412 TILERAMEMPROFFLAG=true
413 elif [[ $1 = '-tileraconfig' ]]
414 then
415 TILERACONFIG="$2"
416 shift
417 elif [[ $1 = '-cacheflush' ]]
418 then
419 CACHEFLUSHFLAG=true
420 elif [[ $1 = '-rawconfig' ]]
421 then
422 RAWCONFIG="$2"
423 shift
424 elif [[ $1 = '-interrupt' ]]
425 then
426 INTERRUPTFLAG=true
427 elif [[ $1 = '-abcclose' ]]
428 then
429 JAVAOPTS="$JAVAOPTS -abcclose"
430 elif [[ $1 = '-optional' ]]
431 then
432 JAVAOPTS="$JAVAOPTS -optional"
433 OPTIONALFLAG=true
434 elif [[ $1 = '-multicoregc' ]]
435 then
436 MULTICOREGCFLAG=true
437 JAVAOPTS="$JAVAOPTS -multicoregc"
438 elif [[ $1 = '-gcmem_local' ]]
439 then
440 GCMEMLOCALFLAG=true
441 elif [[ $1 = '-gcmem_fixed' ]]
442 then
443 GCMEMFIXEDFLAG=true
444 elif [[ $1 = '-gcmem_mixed' ]]
445 then
446 GCMEMMIXEDFLAG=true
447 elif [[ $1 = '-gcmem_global' ]]
448 then
449 GCMEMGLOBALFLAG=true
450 elif [[ $1 = '-gccache_local' ]]
451 then
452 GCCACHELOCALFLAG=true
453 elif [[ $1 = '-gccache_ran' ]]
454 then
455 GCCACHERANFLAG=true
456 elif [[ $1 = '-gccontroller_near' ]]
457 then
458 GCCONTROLLERNEARFLAG=true
459 elif [[ $1 = '-gccontroller_remote' ]]
460 then
461 GCCONTROLLERREMOTEFLAG=true
462 elif [[ $1 = '-gcsmallpagesize' ]]
463 then
464 GCSMALLPAGESIZEFLAG=true
465 elif [[ $1 = '-gcsmallpagesize2' ]]
466 then
467 GCSMALLPAGESIZEFLAG2=true
468 elif [[ $1 = '-gclargepagesize' ]]
469 then
470 GCLARGEPAGESIZEFLAG=true
471 elif [[ $1 = '-gclargesharedheap' ]]
472 then
473 GCLARGESHAREDHEAPFLAG=true
474 elif [[ $1 = '-gclargesharedheap2' ]]
475 then
476 GCLARGESHAREDHEAPFLAG2=true
477 elif [[ $1 = '-dmalloc' ]]
478 then
479 USEDMALLOC=true
480 elif [[ $1 = '-recover' ]]
481 then
482 RECOVERFLAG=true
483 JAVAOPTS="$JAVAOPTS -task"
484 elif [[ $1 = '-useprofile' ]]
485 then
486 JAVAOPTS="$JAVAOPTS -useprofile $2"
487 shift
488 elif [[ $1 = '-webinterface' ]]
489 then
490 JAVAOPTS="$JAVAOPTS -webinterface"
491 elif [[ $1 = '-instructionfailures' ]]
492 then
493 JAVAOPTS="$JAVAOPTS -instructionfailures"
494 elif [[ $1 = '-joptimize' ]]
495 then
496 JAVAOPTS="$JAVAOPTS -optimize"
497 elif [[ $1 = '-noloop' ]]
498 then
499 JAVAOPTS="$JAVAOPTS -noloop"
500 elif [[ $1 = '-dcopts' ]]
501 then
502 JAVAOPTS="$JAVAOPTS -dcopts"
503 elif [[ $1 = '-delaycomp' ]]
504 then
505 JAVAOPTS="$JAVAOPTS -delaycomp"
506 EXTRAOPTIONS="$EXTRAOPTIONS -DDELAYCOMP"
507 elif [[ $1 = '-hybrid' ]]
508 then
509 JAVAOPTS="$JAVAOPTS -hybrid"
510 EXTRAOPTIONS="$EXTRAOPTIONS -DHYBRID"
511 elif [[ $1 = '-minimize' ]]
512 then
513 JAVAOPTS="$JAVAOPTS -minimize"
514
515 elif [[ $1 = '-ooojava' ]]
516 then
517 MLP_ON=true
518 JAVAOPTS="$JAVAOPTS -ooojava $2 $3"
519 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
520 shift
521 shift
522
523 elif [[ $1 = '-heapsize-mb' ]]
524 then
525 EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
526 shift
527
528 elif [[ $1 = '-rcr' ]]
529 then
530 JAVAOPTS="$JAVAOPTS -rcr"
531 RCR=true
532 EXTRAOPTIONS="$EXTRAOPTIONS -I$ROBUSTROOT/Runtime/oooJava"
533
534
535 elif [[ $1 = '-coreprof' ]]
536 then
537 COREPROF=true
538 JAVAOPTS="$JAVAOPTS -coreprof"
539 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF -I$ROBUSTROOT/Runtime/coreprof"
540
541 elif [[ $1 = '-coreprof-checkoverflow' ]]
542 then
543 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF_CHECKOVERFLOW"
544
545 elif [[ $1 = '-mlp' ]]
546 then
547 MLP_ON=true
548 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
549 JAVAOPTS="$JAVAOPTS -mlp $2 $3"
550 shift
551 shift
552
553 elif [[ $1 = '-mlpdebug' ]]
554 then
555 JAVAOPTS="$JAVAOPTS -mlpdebug"
556
557 elif [[ $1 = '-check' ]]
558 then
559 CHECKFLAG=true
560 JAVAOPTS="$JAVAOPTS -conscheck"
561 elif [[ $1 = '-enable-assertions' ]]
562 then
563 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
564 elif [[ $1 = '-specdir' ]]
565 then
566 cd $2
567 SPECDIR=`pwd`
568 cd $CURDIR
569 shift
570 elif [[ $1 = '-debug' ]]
571 then
572 DEBUGFLAG=true
573 EXTRAOPTIONS="$EXTRAOPTIONS -g -rdynamic"
574 elif [[ $1 = '-rawpath' ]]
575 then
576 RAWPATHFLAG=true
577 elif [[ $1 = '-runtimedebug' ]]
578 then
579 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
580 elif [[ $1 = '-dsmcaching' ]]
581 then
582 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
583 elif [[ $1 = '-rangeprefetch' ]]
584 then
585 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
586 elif [[ $1 = '-nooptimize' ]]
587 then
588 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
589 elif [[ $1 = '-optimize' ]]
590 then
591 EXTRAOPTIONS="$EXTRAOPTIONS -O3"
592 elif [[ $1 = '-thread' ]]
593 then
594 JAVAOPTS="$JAVAOPTS -thread"
595 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
596 THREADFLAG=true
597 elif [[ $1 = '-recovery' ]]
598 then
599 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERY"
600 DSMRECOVERY=true
601 elif [[ $1 = '-recoverystats' ]]
602 then
603 JAVAOPTS="$JAVAOPTS -recoverystats"
604 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERYSTATS"
605 elif [[ $1 = '-distributioninfo' ]]
606 then
607 JAVAOPTS="$JAVAOPTS -distributioninfo"
608 elif [[ $1 = '-disall' ]]
609 then
610 JAVAOPTS="$JAVAOPTS -disall"
611 elif [[ $1 = '-disstart' ]]
612 then
613 JAVAOPTS="$JAVAOPTS -disstart $2"
614 shift
615 elif [[ $1 = '-noc' ]]
616 then
617 CCOMPILEFLAG=false
618 elif [[ $1 = '-curdir' ]]
619 then
620 CURDIR=$2
621 shift
622 elif [[ $1 = '-outputdir' ]]
623 then
624 JAVAOPTS="$JAVAOPTS -outputdir $2"
625 shift
626 else
627 SRCFILES="$SRCFILES $1"
628 fi
629 shift
630 done
631
632 BUILDDIR="$CURDIR/$tmpbuilddirectory"
633
634 cd $1
635 cd $CURDIR
636 shift
637
638 mkdir $BUILDDIR
639
640 if $CHECKFLAG #Generate structure files for repair tool
641 then
642 JAVAOPTS="$JAVAOPTS -struct structfile"
643 fi
644
645 # Setup class path
646
647 if $RECOVERFLAG
648 then
649 if $FASTCHECK
650 then
651 #fast transactions
652 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
653 else
654 #base bristlecone files
655 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
656 fi
657 else
658 if $DSMFLAG
659 then
660 #dsm stuff
661 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
662 elif $STM
663 then
664 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
665 elif $THREADFLAG
666 then
667 #threading java stuff
668 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
669 fi
670 #base java stuff
671 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
672 fi
673
674 # Build bristlecone/java sources
675
676 if $MULTICOREFLAG
677 then
678 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
679 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
680 -dir $BUILDDIR $JAVAOPTS $SRCFILES
681 then exit $?
682 fi
683 else
684 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
685 if ! $NOJAVA
686 then
687 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
688 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
689 $JAVAOPTS $SRCFILES
690 then exit $?
691 fi
692 fi
693 fi
694
695 if $EXITAFTERANALYSIS
696 then
697 exit
698 fi
699
700 # Build all of the consistency specs
701
702 if $CHECKFLAG # CHECKFLAG
703 then
704 cd $SPECDIR
705 mkdir $BUILDDIR/specdir
706 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
707
708 echo > $BUILDDIR/specs
709
710 # compile specs into C code
711 for i in * # iterate over all directories
712 do
713 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
714 then
715 cd $SPECDIR/$i
716 cat $BUILDDIR/structfile.struct $i.label > $i.struct
717 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
718 cp size.[c,h] $BUILDDIR/specdir
719 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
720 echo $i >> $BUILDDIR/specs
721 fi # CVSDIR CHECK
722 done # iterate over all directories
723
724 #compile C code
725
726 cd $BUILDDIR/specdir
727 ./buildrobust
728 echo > $BUILDDIR/checkers.h
729 for i in `cat $BUILDDIR/specs`
730 do
731 gcc -O0 -g -fbounds-check -c $i\_aux.c
732 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
733 done
734 fi # CHECKFLAG
735
736 #build and link everything
737
738 if $RAWFLAG
739 then # RAWFLAG
740 RAWDIR="$CURDIR/raw"
741 MAKEFILE="Makefile.raw"
742 mkdir $RAWDIR
743 cd $RAWDIR
744 make clean
745 rm ./*
746
747 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
748
749 if $CACHEFLUSHFLAG
750 then # print path
751 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
752 fi
753
754 if $RAWPATHFLAG
755 then # print path
756 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
757 fi
758
759 if $DEBUGFLAG
760 then #debug version
761 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DDEBUG"
762 fi
763
764 if $PROFILEFLAG
765 then # profile version
766 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
767 fi
768
769 if $ACCURATEPROFILEFLAG
770 then # accurateprofile version
771 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DACCURATEPROFILE"
772 fi
773
774 if $USEIOFLAG
775 then # useio version
776 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
777 fi
778
779 if $INTERRUPTFLAG
780 then #INTERRUPT version
781 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
782 fi #INTERRUPT version
783
784 if $USEIOFLAG
785 then # useio version
786 MAKEFILE="$MAKEFILE.io"
787 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
788 else
789 MAKEFILE="$MAKEFILE.$RAWCONFIG"
790 fi #useio version
791
792 cp $ROBUSTROOT/Runtime/RAW/$MAKEFILE ./Makefile
793 cp ../Runtime/*.c ./
794 cp ../Runtime/*.h ./
795 cp ../Runtime/*.S ./
796 cp ../Runtime/*.s ./
797 cp ../Runtime/RAW/*.c ./
798 cp ../Runtime/RAW/*.h ./
799 cp ../Runtime/RAW/*.S ./
800 cp ../Runtime/RAW/*.s ./
801 cp ../$tmpbuilddirectory/*.c ./
802 cp ../$tmpbuilddirectory/*.h ./
803
804 make
805
806 elif $TILERAFLAG
807 then # TILERAFLAG
808 TILERADIR="$CURDIR/tilera"
809 if $TILERABMEFLAG
810 then # TILERABMEFLAG
811 TILERA_INDIR="BME"
812 MAKEFILE="Makefile.tilera.$TILERACONFIG"
813 SIMHVC="sim.hvc.$TILERACONFIG"
814 PCIHVC="pci.hvc.$TILERACONFIG"
815 if $GC1COREFLAG 
816 then # 1-core gc
817   if $TILERAN1COREFLAG
818   then # not only with 1 core
819         PCIHVC="$PCIHVC.1gc"
820   fi
821 fi
822 if $TILERA56COREFLAG
823 then
824   PCIHVC="$PCIHVC.56"
825 fi
826 elif $TILERAZLINUXFLAG
827 then # TILERAZLINUXFLAG
828 TILERA_INDIR="ZLinux"
829 MAKEFILE="Makefile.tilera.$TILERACONFIG"
830 fi
831
832 mkdir $TILERADIR
833 cd $TILERADIR
834 make clean
835 rm ./*
836
837 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
838
839 if $TILERAMEMPROFFLAG
840 then # not only with 1 core
841   PCIHVC="$PCIHVC.memprof"
842   TILERACFLAGS="${TILERACFLAGS} -DBAMBOO_MEMPROF"
843 fi
844
845 if $TILERABMEFLAG
846 then # TILERABMEFLAG
847 TILERACFLAGS="${TILERACFLAGS} -DTILERA_BME"
848 elif $TILERAZLINUXFLAG
849 then # TILERAZLINUXFLAG
850 TILERACFLAGS="${TILERACFLAGS} -DTILERA_ZLINUX"
851 fi
852
853 if $CACHEFLUSHFLAG
854 then # print path
855 TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
856 fi
857
858 if $RAWPATHFLAG
859 then # print path
860 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
861 fi
862
863 if $DEBUGFLAG
864 then #debug version
865 TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
866 fi
867
868 if $PROFILEFLAG
869 then # profile version
870 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
871 fi
872
873 if $ACCURATEPROFILEFLAG
874 then # accurateprofile version
875 TILERACFLAGS="${TILERACFLAGS} -DACCURATEPROFILE"
876 fi
877
878 if $PROFILEINTERRUPTFLAG
879 then # profile_interrupt version
880 TILERACFLAGS="${TILERACFLAGS} -DPROFILE_INTERRUPT"
881 fi
882
883 if $USEIOFLAG
884 then # useio version
885 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
886 fi
887
888 if $INTERRUPTFLAG
889 then #INTERRUPT version
890 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
891 fi #INTERRUPT version
892
893 if $MULTICOREGCFLAG
894 then #MULTICOREGC version
895 TILERACFLAGS="${TILERACFLAGS} -DMULTICORE_GC -D${GCCORES}"
896 fi
897
898 if $GCPROFILEFLAG
899 then # GC_PROFILE version
900 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
901 fi
902
903 if $GCPROFILESFLAG
904 then # GC_PROFILE_S version
905 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE_S"
906 fi
907
908 if $GCMEMLOCALFLAG
909 then # SMEMLOCAL version
910 TILERACFLAGS="${TILERACFLAGS} -DSMEML"
911 fi
912
913 if $GCMEMFIXEDFLAG
914 then # SMEMFIXED version
915 TILERACFLAGS="${TILERACFLAGS} -DSMEMF"
916 fi
917
918 if $GCMEMMIXEDFLAG
919 then # SMEMMIXED version
920 TILERACFLAGS="${TILERACFLAGS} -DSMEMM"
921 fi
922
923 if $GCMEMGLOBALFLAG
924 then # SMEMGLOBAL version
925 TILERACFLAGS="${TILERACFLAGS} -DSMEMG"
926 fi
927
928 if $GCCACHELOCALFLAG
929 then # CACHE_LOCAL version
930 TILERACFLAGS="${TILERACFLAGS} -DCACHE_LOCAL"
931 fi
932
933 if $GCCACHERANFLAG
934 then # CACHE_RAN version
935 TILERACFLAGS="${TILERACFLAGS} -DCACHE_RAN"
936 fi
937
938 if $GCCONTROLLERNEARFLAG
939 then # CONTROLLER_NEAR version
940 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_NEAR"
941 fi
942
943 if $GCCONTROLLERREMOTEFLAG
944 then # CONTROLLER_REMOTE version
945 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_REMOTE"
946 fi
947
948 if $GCSMALLPAGESIZEFLAG
949 then # GC_SMALLPAGESIZE version
950 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE"
951 fi
952
953 if $GCLARGEPAGESIZEFLAG
954 then # GC_LARGEPAGESIZE version
955 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE"
956 fi
957
958 if $GCLARGESHAREDHEAPFLAG
959 then # GC_LARGESHAREDHEAP version
960 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP"
961 fi
962
963 if $GCSMALLPAGESIZEFLAG2
964 then # GC_SMALLPAGESIZE2 version
965 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE2"
966 fi
967
968 if $GCLARGESHAREDHEAPFLAG2
969 then # GC_LARGESHAREDHEAP2 version
970 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP2"
971 fi
972
973
974 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
975 if $TILERABMEFLAG
976 then # TILERABMEFLAG
977 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
978 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
979 if $TILERA56COREFLAG
980 then
981 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc.56 ./bamboo-vmlinux-pci.hvc.56
982 else
983 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
984 fi
985 fi
986 cp ../Runtime/multicoretask.c ./
987 cp ../Runtime/multicoreruntime.c ./
988 cp ../Runtime/Queue.c ./
989 cp ../Runtime/file.c ./
990 cp ../Runtime/math.c ./
991 cp ../Runtime/object.c ./
992 cp ../Runtime/GenericHashtable.c ./
993 cp ../Runtime/SimpleHash.c ./
994 cp ../Runtime/GCSharedHash.c ./
995 cp ../Runtime/ObjectHash.c ./
996 cp ../Runtime/socket.c ./
997 cp ../Runtime/mem.c ./
998 cp ../Runtime/multicoregarbage.c ./
999 cp ../Runtime/MGCHash.c ./
1000 cp ../Runtime/GenericHashtable.h ./
1001 cp ../Runtime/mem.h ./
1002 cp ../Runtime/multicoreruntime.h ./
1003 cp ../Runtime/object.h ./
1004 cp ../Runtime/ObjectHash.h ./
1005 cp ../Runtime/Queue.h ./
1006 cp ../Runtime/runtime.h ./
1007 cp ../Runtime/SimpleHash.h ./
1008 cp ../Runtime/GCSharedHash.h ./
1009 cp ../Runtime/multicoregc.h ./
1010 cp ../Runtime/multicoregarbage.h ./
1011 cp ../Runtime/multicorehelper.h ./
1012 cp ../Runtime/MGCHash.h ./
1013 cp ../Tilera/Runtime/*.c ./
1014 cp ../Tilera/Runtime/*.h ./
1015 cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
1016 cp ../Tilera/Runtime/$TILERA_INDIR/*.h ./
1017 if $TILERAZLINUXFLAG
1018 then # TILERAZLINUXFLAG
1019 cp ../Tilera/Runtime/$TILERA_INDIR/*.S ./
1020 fi
1021 #if $TILERAMEMPROFFLAG
1022 #then # TILERAMEMPROFFLAG
1023 cp ../Tilera/Runtime/$TILERA_INDIR/linux_client.c ./
1024 #fi
1025 cp ../Tilera/lib/* ./
1026 cp ../$tmpbuilddirectory/*.c ./
1027 cp ../$tmpbuilddirectory/*.h ./
1028
1029 make
1030
1031 else #!RAWFLAG && !TILERABMEFLAG  && ! TILERAZLINUXFLAG
1032 cd $CURDIR 
1033
1034 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
1035 -I$BUILDDIR"
1036
1037 if $MULTICOREFLAG
1038 then
1039 RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
1040 else
1041 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
1042 fi
1043
1044 FILES="$RUNTIMEFILE \
1045 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
1046 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
1047 $ROBUSTROOT/Runtime/ObjectHash.c \
1048 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
1049 $ROBUSTROOT/Runtime/math.c \
1050 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
1051
1052 if $NUMA
1053 then
1054 FILES="$FILES $ROBUSTROOT/Runtime/affinity.c"
1055 fi
1056
1057 if $EVENTMONITOR
1058 then
1059 FILES="$FILES $ROBUSTROOT/Runtime/STM/monitor.c"
1060 fi
1061
1062 if $FASTMEMCPY
1063 then
1064 FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
1065 fi
1066
1067 if $DSMFLAG
1068 then
1069 if $DSMRECOVERY
1070 then
1071 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRECOVERYRUNTIME"
1072 FILES="$FILES $DSMRECOVERYRUNTIME/trans.c $DSMRECOVERYRUNTIME/mcpileq.c $DSMRECOVERYRUNTIME/objstr.c $DSMRECOVERYRUNTIME/dstm.c $DSMRECOVERYRUNTIME/altmlookup.c $DSMRECOVERYRUNTIME/clookup.c $DSMRECOVERYRUNTIME/llookup.c $DSMRECOVERYRUNTIME/tlookup.c $DSMRECOVERYRUNTIME/threadnotify.c $DSMRECOVERYRUNTIME/dstmserver.c $DSMRECOVERYRUNTIME/plookup.c $DSMRECOVERYRUNTIME/ip.c $DSMRECOVERYRUNTIME/queue.c $DSMRECOVERYRUNTIME/altprelookup.c $DSMRECOVERYRUNTIME/machinepile.c $ROBUSTROOT/Runtime/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRECOVERYRUNTIME/sockpool.c $DSMRECOVERYRUNTIME/addUdpEnhance.c $DSMRECOVERYRUNTIME/signal.c $DSMRECOVERYRUNTIME/gCollect.c $DSMRECOVERYRUNTIME/addPrefetchEnhance.c $DSMRECOVERYRUNTIME/dsmlock.c $DSMRECOVERYRUNTIME/translist.c $DSMRECOVERYRUNTIME/paxos.c"
1073 else
1074 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
1075 FILES="$FILES $DSMRUNTIME/trans.c $DSMRUNTIME/mcpileq.c $DSMRUNTIME/objstr.c $DSMRUNTIME/dstm.c $DSMRUNTIME/clookup.c $DSMRUNTIME/llookup.c $DSMRUNTIME/threadnotify.c $DSMRUNTIME/dstmserver.c $DSMRUNTIME/plookup.c $DSMRUNTIME/ip.c $DSMRUNTIME/queue.c $DSMRUNTIME/altprelookup.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 $DSMRUNTIME/altmlookup.c"
1076 fi
1077 fi
1078
1079 if $STM
1080 then
1081 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$STMRUNTIME"
1082 FILES="$FILES $STMRUNTIME/stmlock.c $STMRUNTIME/stm.c $STMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c $STMRUNTIME/stats.c $STMRUNTIME/commit.c $STMRUNTIME/objstr.c"
1083 fi
1084
1085 if $SANDBOX
1086 then
1087 if $DSMFLAG
1088 then
1089 FILES="$FILES $DSMRUNTIME/sandbox.c"
1090 else
1091 FILES="$FILES $STMRUNTIME/sandbox.c"
1092 fi
1093 fi
1094
1095 if $ABORTREADERS
1096 then
1097 FILES="$FILES $DSMRUNTIME/abortreaders.c"
1098 fi
1099
1100 if $FASTCHECK
1101 then
1102 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
1103 fi
1104
1105 if $COREPROF
1106 then
1107 FILES="$FILES $ROBUSTROOT/Runtime/coreprof/coreprof.c"
1108 fi
1109
1110 if $RCR
1111 then
1112 FILES="$FILES $tmpbuilddirectory/RuntimeConflictResolver.c $ROBUSTROOT/Runtime/oooJava/hashRCR.c $ROBUSTROOT/Runtime/oooJava/Queue_RCR.c" 
1113 fi
1114
1115 if $MLP_ON
1116 then
1117 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
1118 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
1119 FILES="$FILES $ROBUSTROOT/Runtime/workschedule.c"
1120 fi
1121
1122 if $RECOVERFLAG
1123 then
1124 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
1125 if $MULTICOREFLAG
1126 then
1127 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
1128 fi
1129 FILES="$FILES $tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
1130 if $RAWFLAG
1131 then
1132 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
1133 fi
1134 if $THREADSIMULATEFLAG
1135 then
1136 # -lpthread for pthread functions, -lrt for message queue functions
1137 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
1138 fi
1139 fi
1140
1141 if $OPTIONALFLAG
1142 then
1143 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
1144 FILES="$FILES $tmpbuilddirectory/optionalarrays.c"
1145 fi
1146
1147 if $THREADFLAG
1148 then
1149 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
1150 fi
1151
1152 if $CHECKFLAG
1153 then
1154 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
1155 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
1156 fi
1157
1158 if $USEDMALLOC
1159 then
1160 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
1161 fi
1162
1163 if $ASSEMBLY
1164 then
1165 gcc -S $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
1166 -c $tmpbuilddirectory/methods.c -lm
1167 fi
1168
1169 if $MULTICOREFLAG
1170 then
1171 gcc $INCLUDES $EXTRAOPTIONS \
1172 $tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
1173 else
1174 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
1175 $tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
1176 fi
1177
1178 fi #!RAWFLAG
1179
1180
1181 exit
1182