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