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