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