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