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