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