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