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