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