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