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