get rid of the stream parsing that occurs in the Layer III decoder. BitStream.readFra...
[IRC.git] / Robust / src / buildscript
index 334cd15d03cf2e59833116d839985d70319b323d..5e4ca12f7c6bb0bf1def994e382d8bacf698884e 100755 (executable)
@@ -17,12 +17,22 @@ echo "-numa numa aware"
 echo "-eventmonitor turn on transaction event trace recording"
 echo
 echo OOOJava options
-echo -coreprof turn on profiling API
-echo -coreprof-eventwords NUM  space in words/thread for coreprof events
-echo -coreprof-checkoverflow ONLY use for debugging event overflow
+echo -coreprof, turn on profiling API
+echo -coreprof-eventwords NUM, space in words/thread for coreprof events
+echo -coreprof-checkoverflow, ONLY use for debugging event overflow
+echo -coreprof-enable EVENTNAME, only enable desired events to reduce overhead
+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 
 echo "-ooojava <numberofcores> <maxseseage>"
 echo -ooodebug general OOOJava debugging messages
+echo -ooodebug-disable-task-mem-pool this is a tricky module, disable for simpler runtime
+echo -mempool-detect-misuse turn on to find code misusing pool-allocated records
 echo -rcr turn on runtime conflict resolver
+echo -rcr_debug Shows weakly connected heaproots and which allocation sites were considered for traversal
+echo -rcr_debug_verbose in addition to above, also prints out effects passed in, internal representation of effects, and internal representation of reach graph
+echo -squeue use single queue
+echo -corepin use core pinning
+echo -nostalltr turn off RCR traversers that only handle conflicts between task and stallsite
+echo -nolock turn off synchronization lock
 echo
 echo Disjoint Reachability Analysis options
 echo -disjoint enable analysis
@@ -40,6 +50,8 @@ echo -disjoint-dvisit-stack-callees-on-top alternate stack strat
 echo -disjoint-dvisit-pqueue use prio. q strat to visit descriptors
 echo -disjoint-desire-determinism set above interproc for determinism
 echo -disjoint-debug-scheduling debug when methods are scheduled for analysis
+echo
+echo -pointsto-check-v-runtime check allocation site of pointer targets at runtime to help verify heap analysis results
 echo 
 echo "-mlp <num cores> <max sese age> build mlp code"
 echo -mlpdebug if mlp, report progress and interim results
@@ -52,20 +64,33 @@ echo -dsmcaching -enable caching in dsm runtime
 echo
 echo BAMBOO Multicore options
 echo -scheduling do task scheduling
+echo "-distributioninfo  execute to collect distribution info for simulated annealing in multi-core version"
+echo "-disall  execute to collect whole distribution"
+echo "-disstart specify the start number of distribution information collection"
 echo -multicore generate multi-core version binary
 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
-echo "-cacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
 echo -printscheduling print out scheduling graphs
 echo -printschedulesim print out scheduling simulator result graphs
+echo "-tilera_output_dir specify the output directory for the generated TILERA code"
 echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
 echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
 echo "-raw generate raw version binary (should be used together with -multicore)"
 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
+echo "-tilera_memprof build the memprof version (should be used together with -tilera_xx) "
+echo -accurateprofile build with accurate profile information including pre/post task processing info
+echo -profile_interrupt build with profile information of interrupts
+echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
+echo -gccachecoherent turns on the cache coherence during gc
+echo
+echo Multicore GC options
+echo -perfcount performance counters
+echo -memperfcount Memory performance counters
 echo -multicoregc generate multi-core binary with garbage collection
+echo -pmc parallel collector
 echo "-numcore4gc set the number of cores for gc (should be used together with -multicoregc), defaultly set as 0"
 echo "-gcmem_local set the gc shared memory allocation strategy as local (should be used together with -multicoregc)"
 echo "-gcmem_fixed set the gc shared memory allocation strategy as fixed (should be used together with -multicoregc)"
@@ -78,14 +103,22 @@ echo "-gccontroller_remote set the gc shared memory to use a remote controller f
 echo "-gcsmallpagesize(2) set the gc shared memory to use small page size (should be used together with -multicoregc)"
 echo "-gclargepagesize set the gc shared memory to use large page size (should be used together with -multicoregc)"
 echo "-gclargesharedheap(2) set the gc shared memory as large (should be used together with -multicoregc)"
+echo "-tilera_page_size set the page size in multicore code"
+echo "-tilera_page_size_bits set the page size bits in multicore code"
+echo "-tilera_num_blocks set the total number of blocks in multicore code"
+echo "-tilera_num_pages_per_block set the number of pages per block in multicore code"
 echo "-gccacheadapt setup as cacheadaptable mode (should be used together with -multicoregc)"
 echo -gcprofile build with gcprofile options
-echo "-tilera_memprof build the memprof version (should be used together with -tilera_xx) "
-echo -accurateprofile build with accurate profile information including pre/post task processing info
-echo -profile_interrupt build with profile information of interrupts
-echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
+echo -mgc generate Multicore GC binary without task stuff
+echo -objectlockdebug generate OBJECT_LOCK_DEBUG code
+echo -gctbldebug generate GC_TBL_DEBUG code
+echo
+echo SSJava options
+echo -ssjava enables SSJava
+echo -ssjavadebug reports interim results
 echo
 echo Other options
+echo -jni enable jni
 echo -abcclose turnoff array boundary checks
 echo -builddir setup different build directory
 echo -robustroot set up the ROBUSTROOT to directory other than default one
@@ -123,17 +156,20 @@ echo -instructionfailures inject code for instructionfailures
 echo -profile build with profile options
 echo "-enable-assertions execute assert statements during compilation"
 echo -justanalyze exit after compiler analyses complete
-echo "-distributioninfo  execute to collect distribution info for simulated annealing in multi-core version"
-echo "-disall  execute to collect whole distribution"
-echo "-disstart specify the start number of distribution information collection"
 echo -assembly generate assembly
 echo -recovery compile recovery code
 echo -dsmtask support work and task class library
 echo -recoverystats print out recovery record 
+echo -src-after-pp prints source code after preprocessor to tmp.c
+echo -capture-null-dereferences generates code to warn before derefencing null
+echo -printlinenum print out line numbers in generated C codes
 echo -help help
 }
 
 tmpbuilddirectory="tmpbuilddirectory"
+JNI=false
+SSJAVA=false
+SRCAFTERPP=false;
 COREPROF=false;
 NUMA=false;
 SANDBOX=false;
@@ -144,6 +180,7 @@ STMRUNTIME=$ROBUSTROOT/Runtime/STM/
 DSMRECOVERYRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface_recovery/
 REPAIRROOT=~/research/Repair/RepairCompiler/
 CURDIR=`pwd`
+SQUEUE=false
 DSMFLAG=false
 DSMRECOVERY=false
 FASTMEMCPY=false
@@ -156,6 +193,8 @@ CHECKFLAG=false
 RECOVERFLAG=false
 MLP_ON=false
 RCR=false
+RCR_DEBUG=false
+RCR_DEBUG_VERBOSE=false
 MLPDEBUG=false
 MULTICOREFLAG=false
 RAWFLAG=false
@@ -164,7 +203,7 @@ TILERABMEFLAG=false
 TILERAZLINUXFLAG=false
 TILERAMEMPROFFLAG=false
 TILERACONFIG=''
-CACHEFLUSHFLAG=false
+TILERACORES=''
 RAWCONFIG=''
 DEBUGFLAG=false
 RAWPATHFLAG=false
@@ -177,6 +216,9 @@ USEIOFLAG=false
 INTERRUPTFLAG=false
 THREADSIMULATEFLAG=false;
 MULTICOREGCFLAG=false;
+PERFCOUNT=false;
+MEMPERFCOUNT=false;
+PMCFLAG=false;
 GCMEMLOCALFLAG=false;
 GCMEMFIXEDFLAG=false;
 GCMEMMIXEDFLAG=false;
@@ -187,10 +229,18 @@ GCCONTROLLERNEARFLAG=false;
 GCCONTROLLERREMOTEFLAG=false;
 GCSMALLPAGESIZEFLAG=false;
 GCLARGEPAGESIZEFLAG=false;
+GCLARGEPAGESIZE2FLAG=false;
 GCLARGESHAREDHEAPFLAG=false;
 GCSMALLPAGESIZEFLAG2=false;
 GCLARGESHAREDHEAPFLAG2=false;
 GCCACHEADAPTFLAG=false
+GCCACHEADAPTPOLICYFLAG=false
+GCCACHEADAPTPOLICY=''
+GCCACHESAMPLINGFLAG=false
+MGCFLAG=false
+MGCINTELFLAG=false
+OBJECTLOCKDEBUGFLAG=false
+GCTBLDEBUGFLAG=false
 USEDMALLOC=false
 THREADFLAG=false
 FASTCHECK=false
@@ -206,6 +256,12 @@ ASSEMBLY=false
 GCCORES=''
 TILERAN1COREFLAG=false
 TILERA56COREFLAG=false
+TILERAOUTPUTDIR="tilera"
+TILERA_PAGE_SIZE="0x10000"
+TILERA_PAGE_SIZE_BITS="16"
+TILERA_NUM_BLOCKS="20"
+TILERA_NUM_PAGES_PER_BLOCK="16"
+GCCACHECOHERENTFLAG=false
 
 if [[ -z $1 ]]
 then
@@ -219,9 +275,21 @@ if [[ $1 = '-help' ]]
 then
 printhelp
 exit
+elif [[ $1 = '-jni' ]]
+then
+JNI=true
+JAVAOPTS="$JAVAOPTS -jni"
+EXTRAOPTIONS="$EXTRAOPTIONS -DJNI -I$ROBUSTROOT/Runtime/jni"
 elif [[ $1 = '-justanalyze' ]]
 then
 EXITAFTERANALYSIS=true
+elif [[ $1 = '-capture-null-dereferences' ]]
+then
+JAVAOPTS="$JAVAOPTS -capture-null-dereferences"
+EXTRAOPTIONS="$EXTRAOPTIONS -DCAPTURE_NULL_DEREFERENCES"
+elif [[ $1 = '-src-after-pp' ]]
+then
+SRCAFTERPP=true
 elif [[ $1 = '-assembly' ]]
 then
 ASSEMBLY=true
@@ -344,6 +412,13 @@ shift
 elif [[ $1 = '-mac' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
+elif [[ $1 = '-squeue' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DSQUEUE"
+elif [[ $1 = '-corepin' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPIN"
+SQUEUE=true
 elif [[ $1 = '-profile' ]]
 then
 PROFILEFLAG=true
@@ -363,6 +438,9 @@ PROFILEINTERRUPTFLAG=true
 elif [[ $1 = '-useio' ]]
 then
 USEIOFLAG=true
+elif [[ $1 = '-gccachecoherent' ]]
+then
+GCCACHECOHERENTFLAG=true
 elif [[ $1 = '-taskstate' ]]
 then
 JAVAOPTS="$JAVAOPTS -taskstate"
@@ -379,6 +457,7 @@ JAVAOPTS="$JAVAOPTS -multicore"
 elif [[ $1 = '-numcore' ]]
 then
 JAVAOPTS="$JAVAOPTS -numcore $2"
+TILERACORES="$2"
 if [[ "$2" -gt "1" ]]
 then
 TILERAN1COREFLAG=true
@@ -397,6 +476,26 @@ elif [[ $1 = '-raw' ]]
 then
 RAWFLAG=true
 JAVAOPTS="$JAVAOPTS -raw"
+elif [[ $1 = '-tilera_output_dir' ]]
+then
+TILERAOUTPUTDIR="$2"
+shift
+elif [[ $1 = '-tilera_page_size' ]]
+then
+TILERA_PAGE_SIZE="$2"
+shift
+elif [[ $1 = '-tilera_page_size_bits' ]]
+then
+TILERA_PAGE_SIZE_BITS="$2"
+shift
+elif [[ $1 = '-tilera_num_blocks' ]]
+then
+TILERA_NUM_BLOCKS="$2"
+shift
+elif [[ $1 = '-tilera_num_pages_per_block' ]]
+then
+TILERA_NUM_PAGES_PER_BLOCK="$2"
+shift
 elif [[ $1 = '-tilera_bme' ]]
 then
 TILERAFLAG=true
@@ -412,9 +511,6 @@ elif [[ $1 = '-tileraconfig' ]]
 then
 TILERACONFIG="$2"
 shift
-elif [[ $1 = '-cacheflush' ]]
-then
-CACHEFLUSHFLAG=true
 elif [[ $1 = '-rawconfig' ]]
 then
 RAWCONFIG="$2"
@@ -433,6 +529,16 @@ elif [[ $1 = '-multicoregc' ]]
 then
 MULTICOREGCFLAG=true
 JAVAOPTS="$JAVAOPTS -multicoregc"
+elif [[ $1 = '-pmc' ]]
+then
+PMCFLAG=true
+JAVAOPTS="$JAVAOPTS -pmc"
+elif [[ $1 = '-perfcount' ]]
+then
+PERFCOUNT=true
+elif [[ $1 = '-memperfcount' ]]
+then
+MEMPERFCOUNT=true
 elif [[ $1 = '-gcmem_local' ]]
 then
 GCMEMLOCALFLAG=true
@@ -466,6 +572,9 @@ GCSMALLPAGESIZEFLAG2=true
 elif [[ $1 = '-gclargepagesize' ]]
 then
 GCLARGEPAGESIZEFLAG=true
+elif [[ $1 = '-gclargepagesize2' ]]
+then
+GCLARGEPAGESIZE2FLAG=true
 elif [[ $1 = '-gclargesharedheap' ]]
 then
 GCLARGESHAREDHEAPFLAG=true
@@ -475,6 +584,28 @@ GCLARGESHAREDHEAPFLAG2=true
 elif [[ $1 = '-gccacheadapt' ]]
 then
 GCCACHEADAPTFLAG=true
+elif [[ $1 = '-gccacheadaptpolicy' ]]
+then
+GCCACHEADAPTPOLICYFLAG=true
+GCCACHEADAPTPOLICY="$2"
+shift
+elif [[ $1 = '-gccachesampling' ]]
+then
+GCCACHESAMPLINGFLAG=true
+elif [[ $1 = '-mgc' ]]
+then
+MGCFLAG=true
+JAVAOPTS="$JAVAOPTS -mgc"
+elif [[ $1 = '-mgcintel' ]]
+then
+MGCINTELFLAG=true
+elif [[ $1 = '-objectlockdebug' ]]
+then
+OBJECTLOCKDEBUGFLAG=true
+JAVAOPTS="$JAVAOPTS -objectlockdebug"
+elif [[ $1 = '-gctbldebug' ]]
+then
+GCTBLDEBUGFLAG=true
 elif [[ $1 = '-dmalloc' ]]
 then
 USEDMALLOC=true
@@ -521,17 +652,59 @@ EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
 shift
 shift
 
+elif [[ $1 = '-ooodebug-disable-task-mem-pool' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DOOO_DISABLE_TASKMEMPOOL"
+
+elif [[ $1 = '-ssjava' ]]
+then
+SSJAVA=true
+JAVAOPTS="$JAVAOPTS -ssjava"
+
+elif [[ $1 = '-ssjavadebug' ]]
+then
+JAVAOPTS="$JAVAOPTS -ssjavadebug"
+
+elif [[ $1 = '-mempool-detect-misuse' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DMEMPOOL_DETECT_MISUSE"
+
 elif [[ $1 = '-heapsize-mb' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
 shift
 
+elif [[ $1 = '-nostalltr' ]]
+then
+JAVAOPTS="$JAVAOPTS -nostalltr"
+
+elif [[ $1 = '-printlinenum' ]]
+then
+JAVAOPTS="$JAVAOPTS -printlinenum"
+
 elif [[ $1 = '-rcr' ]]
 then
 JAVAOPTS="$JAVAOPTS -rcr"
 RCR=true
-EXTRAOPTIONS="$EXTRAOPTIONS -I$ROBUSTROOT/Runtime/oooJava"
+EXTRAOPTIONS="$EXTRAOPTIONS -DRCR -I$ROBUSTROOT/Runtime/oooJava"
+
+elif [[ $1 = '-rcr_debug' ]]
+then
+JAVAOPTS="$JAVAOPTS -rcr_debug"
+RCR_DEBUG=true
+
+elif [[ $1 = '-rcr_debug_verbose' ]]
+then
+JAVAOPTS="$JAVAOPTS -rcr_debug_verbose"
+RCR_DEBUG_VERBOSE=true
 
+elif [[ $1 = '-debug-deque' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG_DEQUE"
+
+elif [[ $1 = '-nolock' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DNOLOCK"
 
 elif [[ $1 = '-coreprof' ]]
 then
@@ -548,6 +721,11 @@ elif [[ $1 = '-coreprof-checkoverflow' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF_CHECKOVERFLOW"
 
+elif [[ $1 = '-coreprof-enable' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -D$2"
+shift
+
 elif [[ $1 = '-mlp' ]]
 then
 MLP_ON=true
@@ -650,54 +828,100 @@ then
 JAVAOPTS="$JAVAOPTS -struct structfile"
 fi
 
+# for tilera code, generate multicorememsize.h
+./generate_memsize.sh ${TILERA_PAGE_SIZE} ${TILERA_PAGE_SIZE_BITS} ${TILERA_NUM_BLOCKS} ${TILERA_NUM_PAGES_PER_BLOCK} ${BUILDDIR}
+
+
+#########################
 # Setup class path
+#########################
+if $JNI
+  then
+  JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/classpath/ -classlibrary $ROBUSTROOT/classpath/vm/reference"
+
+elif $MGCINTELFLAG
+  then
+  JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/MGC/ -classlibrary $ROBUSTROOT/ClassLibrary/MGC/gnu/"
+
+elif $MGCFLAG
+  then
+  #base multicore gc files
+  JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/MGC/ -classlibrary $ROBUSTROOT/ClassLibrary/MGC/gnu/"
+
+elif $SSJAVA
+  then
+  JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/SSJava"  
 
-if $RECOVERFLAG
-then
-if $FASTCHECK
-then
-#fast transactions
-JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
-else
-#base bristlecone files
-JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
-fi
 else
-if $DSMFLAG
-then
-#dsm stuff
-JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
-elif $STM
-then
-JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
-elif $THREADFLAG
-then
-#threading java stuff
-JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
+  if $RECOVERFLAG
+    then
+    if $FASTCHECK
+      then
+      #fast transactions
+      JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
+    else
+      #base bristlecone files
+      JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
+    fi
+
+  elif $DSMFLAG
+    then
+    #dsm stuff
+    JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
+
+  elif $STM
+    then
+    JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
+
+  elif $THREADFLAG
+    then
+    #threading java stuff
+    JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
+
+  else 
+    #base java stuff
+    JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
+  fi
 fi
-#base java stuff
-JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
+
+# everyone gets this except ssjava!
+if ! $SSJAVA
+  then
+  JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/"
 fi
+#########################
+# end classpath
+#########################
+
+
 
 # Build bristlecone/java sources
 
 if $MULTICOREFLAG
-then
-if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
-$ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
--dir $BUILDDIR $JAVAOPTS $SRCFILES
-then exit $?
-fi
+  then
+  if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main \
+       -dir $BUILDDIR $JAVAOPTS $SRCFILES
+    then exit $?
+  fi
+
 else
-#if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
-if ! $NOJAVA
-then
-if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
-$ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
-$JAVAOPTS $SRCFILES
-then exit $?
-fi
-fi
+
+  if $MGCINTELFLAG
+    then
+    if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main $JAVAOPTS \
+         -dir $BUILDDIR -precise $SRCFILES
+      then exit $?
+    fi
+
+  else
+    if ! $NOJAVA
+      then
+      if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main \
+          -dir $BUILDDIR -precise $JAVAOPTS $SRCFILES
+        then exit $?
+      fi
+    fi
+  fi
 fi
 
 if $EXITAFTERANALYSIS
@@ -754,11 +978,6 @@ rm ./*
 
 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
 
-if $CACHEFLUSHFLAG
-then # print path
-RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
-fi
-
 if $RAWPATHFLAG
 then # print path
 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
@@ -802,6 +1021,8 @@ cp ../Runtime/*.c ./
 cp ../Runtime/*.h ./
 cp ../Runtime/*.S ./
 cp ../Runtime/*.s ./
+cp $BAMBOORUNTIME/*.c ./
+cp $BAMBOORUNTIME/*.h ./
 cp $BAMBOORUNTIME/RAW/*.c ./
 cp $BAMBOORUNTIME/RAW/*.h ./
 cp $BAMBOORUNTIME/RAW/*.S ./
@@ -813,13 +1034,13 @@ make
 
 elif $TILERAFLAG
 then # TILERAFLAG
-TILERADIR="$CURDIR/tilera"
+TILERADIR="$CURDIR/${TILERAOUTPUTDIR}"
 if $TILERABMEFLAG
 then # TILERABMEFLAG
 TILERA_INDIR="BME"
-MAKEFILE="Makefile.tilera.$TILERACONFIG"
-SIMHVC="sim.hvc.$TILERACONFIG"
-PCIHVC="pci.hvc.$TILERACONFIG"
+MAKEFILE="Makefile.tilera.$TILERACORES"
+#SIMHVC="sim.hvc.$TILERACONFIG"
+PCIHVC="pci.hvc.$TILERACORES"
 if $TILERA56COREFLAG
 then
   PCIHVC="$PCIHVC.56"
@@ -835,7 +1056,22 @@ cd $TILERADIR
 make clean
 rm ./*
 
+if $MGCFLAG
+then
+export TILERACFLAGS="-DMULTICORE -DCLOSE_PRINT -DTILERA"
+else
 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
+fi
+
+if $GCTBLDEBUGFLAG
+then
+TILERACFLAGS="${TILERACFLAGS} -DGC_TBL_DEBUG"
+fi
+
+if $OBJECTLOCKDEBUGFLAG
+then
+TILERACFLAGS="${TILERACFLAGS} -DOBJECT_LOCK_DEBUG"
+fi
 
 if $TILERAMEMPROFFLAG
 then # not only with 1 core
@@ -851,11 +1087,6 @@ then # TILERAZLINUXFLAG
 TILERACFLAGS="${TILERACFLAGS} -DTILERA_ZLINUX"
 fi
 
-if $CACHEFLUSHFLAG
-then # print path
-TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
-fi
-
 if $RAWPATHFLAG
 then # print path
 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
@@ -891,11 +1122,31 @@ then #INTERRUPT version
 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
 fi #INTERRUPT version
 
+if $MGCFLAG
+then #MGCFLAG
+TILERACFLAGS="${TILERACFLAGS} -DMGC -DMGC_SPEC"
+fi
+
 if $MULTICOREGCFLAG
 then #MULTICOREGC version
 TILERACFLAGS="${TILERACFLAGS} -DMULTICORE_GC -D${GCCORES}"
 fi
 
+if $PMCFLAG
+then #MULTICOREGC version
+TILERACFLAGS="${TILERACFLAGS} -DPMC_GC -D${GCCORES}"
+fi
+
+if $PERFCOUNT
+then #MULTICOREGC version
+TILERACFLAGS="${TILERACFLAGS} -DPERFCOUNT"
+fi
+
+if $MEMPERFCOUNT
+then #MULTICOREGC version
+TILERACFLAGS="${TILERACFLAGS} -DMEMPERFCOUNT"
+fi
+
 if $GCPROFILEFLAG
 then # GC_PROFILE version
 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
@@ -956,6 +1207,11 @@ then # GC_LARGEPAGESIZE version
 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE"
 fi
 
+if $GCLARGEPAGESIZE2FLAG
+then # GC_LARGEPAGESIZE2 version
+TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE2"
+fi
+
 if $GCLARGESHAREDHEAPFLAG
 then # GC_LARGESHAREDHEAP version
 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP"
@@ -976,10 +1232,33 @@ then # GC_CACHE_ADAPT version
 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT"
 fi
 
+if $GCCACHEADAPTPOLICYFLAG
+then # GC_CACHE_ADAPT version
+TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT_POLICY${GCCACHEADAPTPOLICY}"
+fi
+
+if $GCCACHESAMPLINGFLAG
+then # GC_CACHE_ADAPT version
+TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_SAMPLING"
+fi
+
+if $GCCACHECOHERENTFLAG
+then # gc cache coherent version
+TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_COHERENT_ON"
+fi
+
+if $PMCFLAG
+then
+cp $ROBUSTROOT/Tilera/Runtime/PMC/$MAKEFILE ./Makefile
+elif $MGCFLAG
+then
+cp $ROBUSTROOT/Tilera/Runtime/MGC/$MAKEFILE ./Makefile
+else
 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
+fi
 if $TILERABMEFLAG
 then # TILERABMEFLAG
-cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
+#cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
 if $TILERA56COREFLAG
 then
@@ -991,7 +1270,10 @@ fi
 cp ../Runtime/Queue.c ./
 cp ../Runtime/file.c ./
 cp ../Runtime/math.c ./
+if [ !$MGCFLAG ]
+then
 cp ../Runtime/object.c ./
+fi
 cp ../Runtime/GenericHashtable.c ./
 cp ../Runtime/SimpleHash.c ./
 cp ../Runtime/ObjectHash.c ./
@@ -999,23 +1281,17 @@ cp ../Runtime/socket.c ./
 cp ../Runtime/mem.c ./
 cp ../Runtime/GenericHashtable.h ./
 cp ../Runtime/mem.h ./
+if [ !$MGCFLAG ]
+then
 cp ../Runtime/object.h ./
+fi
 cp ../Runtime/ObjectHash.h ./
 cp ../Runtime/Queue.h ./
 cp ../Runtime/runtime.h ./
 cp ../Runtime/SimpleHash.h ./
-cp $BAMBOORUNTIME/multicoretask.c ./
-cp $BAMBOORUNTIME/multicoreruntime.c ./
-cp $BAMBOORUNTIME/GCSharedHash.c ./
-cp $BAMBOORUNTIME/multicoregarbage.c ./
-cp $BAMBOORUNTIME/MGCHash.c ./
-cp $BAMBOORUNTIME/multicoreruntime.h ./
-cp $BAMBOORUNTIME/GCSharedHash.h ./
-cp $BAMBOORUNTIME/multicoregc.h ./
-cp $BAMBOORUNTIME/multicoregarbage.h ./
-cp $BAMBOORUNTIME/multicorehelper.h ./
-cp $BAMBOORUNTIME/MGCHash.h ./
-cp $BAMBOORUNTIME/multicorecache.h ./
+cp ../Runtime/objtypes.h ./
+cp $BAMBOORUNTIME/*.c ./
+cp $BAMBOORUNTIME/*.h ./
 cp ../Tilera/Runtime/*.c ./
 cp ../Tilera/Runtime/*.h ./
 cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
@@ -1028,10 +1304,17 @@ fi
 #then # TILERAMEMPROFFLAG
 cp ../Tilera/Runtime/$TILERA_INDIR/linux_client.c ./
 #fi
+if $MGCFLAG
+then
+cp ../Tilera/Runtime/MGC/*.c ./
+cp ../Tilera/Runtime/MGC/*.h ./
+fi
 cp ../Tilera/lib/* ./
 cp ../$tmpbuilddirectory/*.c ./
 cp ../$tmpbuilddirectory/*.h ./
 
+echo $TILERACFLAGS > ./tileracflags.txt
+
 make
 
 else #!RAWFLAG && !TILERABMEFLAG  && ! TILERAZLINUXFLAG
@@ -1053,9 +1336,15 @@ $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
 $ROBUSTROOT/Runtime/ObjectHash.c \
 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
+$ROBUSTROOT/Runtime/taskgarbage.c $ROBUSTROOT/Runtime/oojgarbage.c \
 $ROBUSTROOT/Runtime/math.c \
 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
 
+if $JNI
+then
+FILES="$FILES $ROBUSTROOT/Runtime/jni/jni.c $ROBUSTROOT/Runtime/jni/jni-stuff.c"
+fi
+
 if $NUMA
 then
 FILES="$FILES $ROBUSTROOT/Runtime/affinity.c"
@@ -1116,7 +1405,7 @@ fi
 
 if $RCR
 then
-FILES="$FILES $tmpbuilddirectory/RuntimeConflictResolver.c $ROBUSTROOT/Runtime/oooJava/hashRCR.c $ROBUSTROOT/Runtime/oooJava/Queue_RCR.c
+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"
 fi
 
 if $MLP_ON
@@ -1124,6 +1413,10 @@ then
 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
 FILES="$FILES $ROBUSTROOT/Runtime/workschedule.c"
+if ! $SQUEUE
+then
+FILES="$FILES $ROBUSTROOT/Runtime/deque.c"
+fi
 fi
 
 if $RECOVERFLAG
@@ -1167,6 +1460,9 @@ then
 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
 fi
 
+echo Compiling C...
+echo EXTRAOPTIONS=$EXTRAOPTIONS
+
 if $ASSEMBLY
 then
 gcc -S $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
@@ -1175,13 +1471,21 @@ fi
 
 if $MULTICOREFLAG
 then
-gcc $INCLUDES $EXTRAOPTIONS \
-$tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
+NONMULTICOREOPTS=
 else
-gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
-$tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
+NONMULTICOREOPTS=-DPRECISE_GC
 fi
 
+if $SRCAFTERPP
+then
+gcc -E $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
+$tmpbuilddirectory/methods.c $FILES > tmp.c
+fi
+
+gcc $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
+$tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
+
+
 fi #!RAWFLAG