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