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