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