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