Statically ping memory from the nearest memory controller on the cores
[IRC.git] / Robust / src / buildscript
index b071eca29e4a299eb42901d794e2945beee93403..fb03f76a6aba9dfb01cd684df1fa166cd7e17dc7 100755 (executable)
@@ -1,29 +1,28 @@
 #!/bin/bash
 
 printhelp() {
-echo -robustroot set up the ROBUSTROOT to directory other than default one
-echo -dsm distributed shared memory
+echo STM Options
 echo -singleTM single machine committing transactions
 echo -stmdebug STM debug
 echo "-stmstats prints single machine commit (stm) statistics for the benchmark"
 echo -fastmemcpy use fast memcpy
+echo -sandbox sandbox transactions
+echo -dcopts conflict optimizations for transactional memory
+echo -transstats generates transaction stats on commits and aborts
+echo -inlineatomic depth inline methods inside of transactions to specified depth
+echo "-stmarray partial array treatment"
+echo "-dualview dual view of arrays"
+echo "-hybrid use fission only when it looks like a good choice"
+echo "-numa numa aware"
+echo "-eventmonitor turn on transaction event trace recording"
+echo
+echo DSM options
+echo -dsm distributed shared memory
 echo -abortreaders abort readers immediately
 echo -trueprob double - probabiltiy of true branch
 echo -dsmcaching -enable caching in dsm runtime
-echo -mac distributed shared memory mac support
-echo -check generate check code
-echo -dmalloc link in dmalloc
-echo -64bit compile for 64 bit machine
-echo -joptimize java compiler optimizations
-echo -dcopts conflict optimizations for transactional memory
-echo -recover compile task code
-echo -fastcheck fast checkpointing for Bristlecone
-echo -specdir directory
-echo -printflat print out flat representation
-echo -selfloop task - this task cannot self loop forever
-echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
-echo -taskstate do task state analysis
-echo -tagstate do tag state analysis
+echo
+echo BAMBOO Multicore options
 echo -scheduling do task scheduling
 echo -multicore generate multi-core version binary
 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
@@ -34,19 +33,41 @@ echo "-useprofile use profiling data for scheduling (should be used together wit
 echo -printscheduling print out scheduling graphs
 echo -printschedulesim print out scheduling simulator result graphs
 echo -abcclose close the array boundary check
-echo "-tilera generate tilera version binary (should be used together with -multicore"
+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 -threadsimulate generate multi-thread simulate version binary
+echo -multicoregc generate multi-core binary with garbage collection
+echo "-numcore4gc set the number of cores for gc (should be used together with -multicoregc), defaultly set as 0"
+echo -gcprofile build with gcprofile options
+echo -accurateprofile build with accurate profile information including pre/post task processing info
+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
+echo Other options
+echo -builddir setup different build directory
+echo -robustroot set up the ROBUSTROOT to directory other than default one
+echo -readset turn on readset
+echo -mac distributed shared memory mac support
+echo -check generate check code
+echo -dmalloc link in dmalloc
+echo -64bit compile for 64 bit machine
+echo -32bit compile for 32 bit machine
+echo -joptimize java compiler optimizations
+echo -recover compile task code
+echo -fastcheck fast checkpointing for Bristlecone
+echo -specdir directory
+echo -printflat print out flat representation
+echo -selfloop task - this task cannot self loop forever
+echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
+echo -taskstate do task state analysis
+echo -tagstate do tag state analysis
 echo -optional enable optional
 echo -debug generate debug symbols
 echo -prefetch do prefetch analysis
-echo -transstats generates transaction stats on commits and aborts
 echo -garbagestats Print garbage collection statistics
 echo -webinterface enable web interface
 echo -runtimedebug printout runtime debug messages
-echo -inlineatomic depth inline methods inside of transactions to specified depth
 echo "-thread use support for multiple threads"
 echo "-optimize call gcc with -O9 (optimize)"
 echo "-nooptimize call gcc with -O0 (do not optimize)"
@@ -56,37 +77,57 @@ echo -o binary
 echo -nojava do not run bristlecone compiler
 echo -instructionfailures inject code for instructionfailures
 echo -profile build with profile options
-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 "-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 -help help
 }
 
+tmpbuilddirectory="tmpbuilddirectory"
+NUMA=false;
+SANDBOX=false;
 ABORTREADERS=false;
 ROBUSTROOT=~/research/Robust/src
 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
+STMRUNTIME=$ROBUSTROOT/Runtime/STM/
+DSMRECOVERYRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface_recovery/
 REPAIRROOT=~/research/Repair/RepairCompiler/
 CURDIR=`pwd`
 DSMFLAG=false
+DSMRECOVERY=false
 FASTMEMCPY=false
-SINGLETM=false
+STMARRAY=false
+DUALVIEW=false
+STM=false
+EVENTMONITOR=false
 NOJAVA=false
 CHECKFLAG=false
 RECOVERFLAG=false
-MLPFLAG=false
+MLP_ON=false
 MLPDEBUG=false
 MULTICOREFLAG=false
 RAWFLAG=false
 TILERAFLAG=false
+TILERABMEFLAG=false
+TILERAZLINUXFLAG=false
 TILERACONFIG=''
 CACHEFLUSHFLAG=false
 RAWCONFIG=''
 DEBUGFLAG=false
 RAWPATHFLAG=false
 PROFILEFLAG=false
+GCPROFILEFLAG=false
+ACCURATEPROFILEFLAG=false
 USEIOFLAG=false
 INTERRUPTFLAG=false
 THREADSIMULATEFLAG=false;
+MULTICOREGCFLAG=false;
 USEDMALLOC=false
 THREADFLAG=false
 FASTCHECK=false
@@ -98,6 +139,8 @@ JAVAFORWARDOPTS=''
 JAVAOPTS=''
 OPTIONALFLAG=false
 EXITAFTERANALYSIS=false
+ASSEMBLY=false
+GCCORES=''
 
 if [[ -z $1 ]]
 then
@@ -114,24 +157,48 @@ exit
 elif [[ $1 = '-justanalyze' ]]
 then
 EXITAFTERANALYSIS=true
+elif [[ $1 = '-assembly' ]]
+then
+ASSEMBLY=true
 elif [[ $1 = '-abortreaders' ]]
 then
 ABORTREADERS=true
 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
 JAVAOPTS="$JAVAOPTS -abortreaders"
+elif [[ $1 = '-sandbox' ]]
+then
+SANDBOX=true
+EXTRAOPTIONS="$EXTRAOPTIONS -DSANDBOX"
+JAVAOPTS="$JAVAOPTS -sandbox"
+elif [[ $1 = '-numa' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DAFFINITY -D_GNU_SOURCE"
+NUMA=true
 elif [[ $1 = '-robustroot' ]]
 then
 ROBUSTROOT="$2"
 shift
+elif [[ $1 = '-builddir' ]]
+then
+tmpbuilddirectory="$2"
+shift
 elif [[ $1 = '-nojava' ]]
 then
 NOJAVA=true
+elif [[ $1 = '-eventmonitor' ]]
+then
+JAVAOPTS="$JAVAOPTS -eventmonitor"
+EVENTMONITOR=true
+EXTRAOPTIONS="$EXTRAOPTIONS -DEVENTMONITOR"
 elif [[ $1 = '-garbagestats' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
 elif [[ $1 = '-64bit' ]]
 then
-EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64"
+EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64 -m64"
+elif [[ $1 = '-32bit' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -m32"
 elif [[ $1 = '-fastcheck' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
@@ -153,6 +220,9 @@ elif [[ $1 = '-excprefetch' ]]
 then
 JAVAOPTS="$JAVAOPTS -excprefetch $2"
 shift
+elif [[ $1 = '-arraypad' ]]
+then
+JAVAOPTS="$JAVAOPTS -arraypad"
 elif [[ $1 = '-dsm' ]]
 then
 JAVAOPTS="$JAVAOPTS -dsm"
@@ -165,13 +235,30 @@ elif [[ $1 = '-singleTM' ]]
 then
 JAVAOPTS="$JAVAOPTS -singleTM"
 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
-SINGLETM=true
+STM=true
+elif [[ $1 = '-stmarray' ]]
+then
+JAVAOPTS="$JAVAOPTS -stmarray"
+EXTRAOPTIONS="$EXTRAOPTIONS -DSTMARRAY"
+STMARRAY=true
+elif [[ $1 = '-dualview' ]]
+then
+JAVAOPTS="$JAVAOPTS -dualview"
+EXTRAOPTIONS="$EXTRAOPTIONS -DDUALVIEW"
+DUALVIEW=true
+elif [[ $1 = '-readset' ]]
+then
+JAVAOPTS="$JAVAOPTS -readset"
+EXTRAOPTIONS="$EXTRAOPTIONS -DREADSET"
 elif [[ $1 = '-stmdebug' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
 elif [[ $1 = '-stmstats' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
+elif [[ $1 = '-stmlog' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DSTMLOG"
 elif [[ $1 = '-prefetch' ]]
 then
 JAVAOPTS="$JAVAOPTS -prefetch"
@@ -196,6 +283,12 @@ elif [[ $1 = '-profile' ]]
 then
 PROFILEFLAG=true
 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
+elif [[ $1 = '-gcprofile' ]]
+then
+GCPROFILEFLAG=true
+elif [[ $1 = '-accurateprofile' ]]
+then
+ACCURATEPROFILEFLAG=true
 elif [[ $1 = '-useio' ]]
 then
 USEIOFLAG=true
@@ -216,13 +309,23 @@ elif [[ $1 = '-numcore' ]]
 then
 JAVAOPTS="$JAVAOPTS -numcore $2"
 shift
+elif [[ $1 = '-numcore4gc' ]]
+then
+JAVAOPTS="$JAVAOPTS -numcore4gc $2"
+GCCORES="GC_$2"
+shift
 elif [[ $1 = '-raw' ]]
 then
 RAWFLAG=true
 JAVAOPTS="$JAVAOPTS -raw"
-elif [[ $1 = '-tilera' ]]
+elif [[ $1 = '-tilera_bme' ]]
 then
 TILERAFLAG=true
+TILERABMEFLAG=true
+elif [[ $1 = '-tilera_zlinux' ]]
+then
+TILERAFLAG=true
+TILERAZLINUXFLAG=true
 elif [[ $1 = '-tileraconfig' ]]
 then
 TILERACONFIG="$2"
@@ -237,9 +340,6 @@ shift
 elif [[ $1 = '-interrupt' ]]
 then
 INTERRUPTFLAG=true
-elif [[ $1 = '-threadsimulate' ]]
-then
-THREADSIMULATEFLAG=true
 elif [[ $1 = '-abcclose' ]]
 then
 JAVAOPTS="$JAVAOPTS -abcclose"
@@ -247,6 +347,10 @@ elif [[ $1 = '-optional' ]]
 then
 JAVAOPTS="$JAVAOPTS -optional"
 OPTIONALFLAG=true
+elif [[ $1 = '-multicoregc' ]]
+then
+MULTICOREGCFLAG=true
+JAVAOPTS="$JAVAOPTS -multicoregc"
 elif [[ $1 = '-dmalloc' ]]
 then
 USEDMALLOC=true
@@ -256,7 +360,8 @@ RECOVERFLAG=true
 JAVAOPTS="$JAVAOPTS -task"
 elif [[ $1 = '-useprofile' ]]
 then
-JAVAOPTS="$JAVAOPTS -useprofile"
+JAVAOPTS="$JAVAOPTS -useprofile $2"
+shift
 elif [[ $1 = '-webinterface' ]]
 then
 JAVAOPTS="$JAVAOPTS -webinterface"
@@ -273,14 +378,26 @@ elif [[ $1 = '-delaycomp' ]]
 then
 JAVAOPTS="$JAVAOPTS -delaycomp"
 EXTRAOPTIONS="$EXTRAOPTIONS -DDELAYCOMP"
+elif [[ $1 = '-hybrid' ]]
+then
+JAVAOPTS="$JAVAOPTS -hybrid"
+EXTRAOPTIONS="$EXTRAOPTIONS -DHYBRID"
+elif [[ $1 = '-minimize' ]]
+then
+JAVAOPTS="$JAVAOPTS -minimize"
+
 elif [[ $1 = '-mlp' ]]
 then
-JAVAOPTS="$JAVAOPTS -mlp"
-EXTRAOPTIONS="$EXTRAOPTIONS -lpthread"
+MLP_ON=true
+EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
+JAVAOPTS="$JAVAOPTS -mlp $2 $3"
+shift
+shift
+
 elif [[ $1 = '-mlpdebug' ]]
 then
 JAVAOPTS="$JAVAOPTS -mlpdebug"
-EXTRAOPTIONS="$EXTRAOPTIONS -lpthread"
+
 elif [[ $1 = '-check' ]]
 then
 CHECKFLAG=true
@@ -315,15 +432,33 @@ then
 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
 elif [[ $1 = '-optimize' ]]
 then
-EXTRAOPTIONS="$EXTRAOPTIONS -O9"
+EXTRAOPTIONS="$EXTRAOPTIONS -O3"
 elif [[ $1 = '-thread' ]]
 then
 JAVAOPTS="$JAVAOPTS -thread"
 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
 THREADFLAG=true
+elif [[ $1 = '-recovery' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERY"
+DSMRECOVERY=true
+elif [[ $1 = '-recoverystats' ]]
+then
+JAVAOPTS="$JAVAOPTS -recoverystats"
+EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERYSTATS"
 elif [[ $1 = '-distributioninfo' ]]
 then
 JAVAOPTS="$JAVAOPTS -distributioninfo"
+elif [[ $1 = '-disall' ]]
+then
+JAVAOPTS="$JAVAOPTS -disall"
+elif [[ $1 = '-disstart' ]]
+then
+JAVAOPTS="$JAVAOPTS -disstart $2"
+shift
+elif [[ $1 = '-noc' ]]
+then
+CCOMPILEFLAG=false
 elif [[ $1 = '-curdir' ]]
 then
 CURDIR=$2
@@ -338,7 +473,7 @@ fi
 shift
 done
 
-BUILDDIR="$CURDIR/tmpbuilddirectory"
+BUILDDIR="$CURDIR/$tmpbuilddirectory"
 
 cd $1
 cd $CURDIR
@@ -368,7 +503,7 @@ if $DSMFLAG
 then
 #dsm stuff
 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
-elif $SINGLETM
+elif $STM
 then
 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
 elif $THREADFLAG
@@ -384,7 +519,7 @@ fi
 
 if $MULTICOREFLAG
 then
-if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
+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 $?
@@ -393,7 +528,7 @@ else
 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
 if ! $NOJAVA
 then
-if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
+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 $?
@@ -475,6 +610,11 @@ then # profile version
 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
 fi
 
+if $ACCURATEPROFILEFLAG
+then # accurateprofile version
+RAWRGCCFLAGS="${RAWRGCCFLAGS} -DACCURATEPROFILE"
+fi
+
 if $USEIOFLAG
 then # useio version
 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
@@ -502,23 +642,39 @@ cp ../Runtime/RAW/*.c ./
 cp ../Runtime/RAW/*.h ./
 cp ../Runtime/RAW/*.S ./
 cp ../Runtime/RAW/*.s ./
-cp ../tmpbuilddirectory/*.c ./
-cp ../tmpbuilddirectory/*.h ./
+cp ../$tmpbuilddirectory/*.c ./
+cp ../$tmpbuilddirectory/*.h ./
 
 make
 
 elif $TILERAFLAG
 then # TILERAFLAG
 TILERADIR="$CURDIR/tilera"
+if $TILERABMEFLAG
+then # TILERABMEFLAG
+TILERA_INDIR="BME"
 MAKEFILE="Makefile.tilera.$TILERACONFIG"
 SIMHVC="sim.hvc.$TILERACONFIG"
 PCIHVC="pci.hvc.$TILERACONFIG"
+elif $TILERAZLINUXFLAG
+then # TILERAZLINUXFLAG
+TILERA_INDIR="ZLinux"
+MAKEFILE="Makefile.tilera.$TILERACONFIG"
+fi
 mkdir $TILERADIR
 cd $TILERADIR
 make clean
 rm ./*
 
-export TILERACFLAGS="-DTASK -DMULTICORE"
+export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
+
+if $TILERABMEFLAG
+then # TILERABMEFLAG
+TILERACFLAGS="${TILERACFLAGS} -DTILERA_BME"
+elif $TILERAZLINUXFLAG
+then # TILERAZLINUXFLAG
+TILERACFLAGS="${TILERACFLAGS} -DTILERA_ZLINUX"
+fi
 
 if $CACHEFLUSHFLAG
 then # print path
@@ -540,6 +696,11 @@ then # profile version
 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
 fi
 
+if $ACCURATEPROFILEFLAG
+then # accurateprofile version
+TILERACFLAGS="${TILERACFLAGS} -DACCURATEPROFILE"
+fi
+
 if $USEIOFLAG
 then # useio version
 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
@@ -550,10 +711,23 @@ then #INTERRUPT version
 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
 fi #INTERRUPT version
 
-cp $ROBUSTROOT/Tilera/Runtime/$MAKEFILE ./Makefile
-cp $ROBUSTROOT/Tilera/Runtime/$SIMHVC ./sim.hvc
-cp $ROBUSTROOT/Tilera/Runtime/$PCIHVC ./pci.hvc
-cp $ROBUSTROOT/Tilera/Runtime/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
+if $MULTICOREGCFLAG
+then #MULTICOREGC version
+TILERACFLAGS="${TILERACFLAGS} -DMULTICORE_GC -D${GCCORES}"
+fi
+
+if $GCPROFILEFLAG
+then # GC_PROFILE version
+TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
+fi
+
+cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
+if $TILERABMEFLAG
+then # TILERABMEFLAG
+cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
+cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
+cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
+fi
 cp ../Runtime/multicoretask.c ./
 cp ../Runtime/multicoreruntime.c ./
 cp ../Runtime/Queue.c ./
@@ -562,9 +736,12 @@ cp ../Runtime/math.c ./
 cp ../Runtime/object.c ./
 cp ../Runtime/GenericHashtable.c ./
 cp ../Runtime/SimpleHash.c ./
+cp ../Runtime/GCSharedHash.c ./
 cp ../Runtime/ObjectHash.c ./
 cp ../Runtime/socket.c ./
 cp ../Runtime/mem.c ./
+cp ../Runtime/multicoregarbage.c ./
+cp ../Runtime/MGCHash.c ./
 cp ../Runtime/GenericHashtable.h ./
 cp ../Runtime/mem.h ./
 cp ../Runtime/multicoreruntime.h ./
@@ -573,13 +750,26 @@ cp ../Runtime/ObjectHash.h ./
 cp ../Runtime/Queue.h ./
 cp ../Runtime/runtime.h ./
 cp ../Runtime/SimpleHash.h ./
+cp ../Runtime/GCSharedHash.h ./
+cp ../Runtime/multicoregc.h ./
+cp ../Runtime/multicoregarbage.h ./
+cp ../Runtime/multicorehelper.h ./
+cp ../Runtime/MGCHash.h ./
 cp ../Tilera/Runtime/*.c ./
 cp ../Tilera/Runtime/*.h ./
+cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
+cp ../Tilera/Runtime/$TILERA_INDIR/*.h ./
+if $TILERAZLINUXFLAG
+then # TILERAZLINUXFLAG
+cp ../Tilera/Runtime/$TILERA_INDIR/*.S ./
+fi
 cp ../Tilera/lib/* ./
-cp ../tmpbuilddirectory/*.c ./
-cp ../tmpbuilddirectory/*.h ./
+cp ../$tmpbuilddirectory/*.c ./
+cp ../$tmpbuilddirectory/*.h ./
+
+make
 
-else #!RAWFLAG && !TILERAFLAG
+else #!RAWFLAG && !TILERABMEFLAG  && ! TILERAZLINUXFLAG
 cd $CURDIR 
 
 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
@@ -600,6 +790,16 @@ $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
 $ROBUSTROOT/Runtime/math.c \
 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
 
+if $NUMA
+then
+FILES="$FILES $ROBUSTROOT/Runtime/affinity.c"
+fi
+
+if $EVENTMONITOR
+then
+FILES="$FILES $ROBUSTROOT/Runtime/STM/monitor.c"
+fi
+
 if $FASTMEMCPY
 then
 FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
@@ -607,14 +807,30 @@ fi
 
 if $DSMFLAG
 then
+if $DSMRECOVERY
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRECOVERYRUNTIME"
+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"
+else
 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
-FILES="$FILES $DSMRUNTIME/trans.c $DSMRUNTIME/mcpileq.c $DSMRUNTIME/objstr.c $DSMRUNTIME/dstm.c $DSMRUNTIME/mlookup.c $DSMRUNTIME/clookup.c $DSMRUNTIME/llookup.c $DSMRUNTIME/threadnotify.c $DSMRUNTIME/dstmserver.c $DSMRUNTIME/plookup.c $DSMRUNTIME/ip.c $DSMRUNTIME/queue.c $DSMRUNTIME/prelookup.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"
+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"
+fi
 fi
 
-if $SINGLETM
+if $STM
 then
-EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME"
-FILES="$FILES $DSMRUNTIME/stmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c"
+EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$STMRUNTIME"
+FILES="$FILES $STMRUNTIME/stmlock.c $STMRUNTIME/stm.c $STMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c $STMRUNTIME/stats.c $STMRUNTIME/commit.c $STMRUNTIME/objstr.c"
+fi
+
+if $SANDBOX
+then
+if $DSMFLAG
+then
+FILES="$FILES $DSMRUNTIME/sandbox.c"
+else
+FILES="$FILES $STMRUNTIME/sandbox.c"
+fi
 fi
 
 if $ABORTREADERS
@@ -627,7 +843,7 @@ then
 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
 fi
 
-if $MLP
+if $MLP_ON
 then
 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
@@ -641,7 +857,7 @@ if $MULTICOREFLAG
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
 fi
-FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
+FILES="$FILES $tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
 if $RAWFLAG
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
@@ -656,7 +872,7 @@ fi
 if $OPTIONALFLAG
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
-FILES="$FILES tmpbuilddirectory/optionalarrays.c"
+FILES="$FILES $tmpbuilddirectory/optionalarrays.c"
 fi
 
 if $THREADFLAG
@@ -675,16 +891,23 @@ then
 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
 fi
 
+if $ASSEMBLY
+then
+gcc -S $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
+-c $tmpbuilddirectory/methods.c -lm
+fi
+
 if $MULTICOREFLAG
 then
 gcc $INCLUDES $EXTRAOPTIONS \
-tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
+$tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
 else
 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
-tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
+$tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
 fi
 
 fi #!RAWFLAG
 
+
 exit