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