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