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