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