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