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