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