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