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