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