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