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