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