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