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