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