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