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