Introduced ZEROORMORE arity, something appears to be broken so another change is...
[IRC.git] / Robust / src / buildscript
index 6042f0bb5b5bd8e4183fe7c41c16c87d3f8244bf..1c449c9d63b9d264a3f18100e20a8821700cd578 100755 (executable)
@@ -4,6 +4,7 @@ printhelp() {
 echo -robustroot set up the ROBUSTROOT to directory other than default one
 echo -dsm distributed shared memory
 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
@@ -18,6 +19,9 @@ 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"
 echo "-raw generate raw version binary (should be used together with -multicore)"
+echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
+echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
+echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
 echo -threadsimulate generate multi-thread simulate version binary
 echo -optional enable optional
 echo -debug generate debug symbols
@@ -49,6 +53,10 @@ RECOVERFLAG=false
 MULTICOREFLAG=false
 TRANSSTATSFLAG=false
 RAWFLAG=false
+RAWCONFIG=''
+RAWDEBUGFLAG=false
+RAWPATHFLAG=false
+INTERRUPTFLAG=false
 THREADSIMULATEFLAG=false;
 USEDMALLOC=false
 THREADFLAG=false
@@ -138,7 +146,14 @@ shift
 elif [[ $1 = '-raw' ]]
 then
 RAWFLAG=true
-#JAVAOPTS="$JAVAOPTS -raw"
+JAVAOPTS="$JAVAOPTS -raw"
+elif [[ $1 = '-rawconfig' ]]
+then
+RAWCONFIG="$2"
+shift
+elif [[ $1 = '-interrupt' ]]
+then
+INTERRUPTFLAG=true
 elif [[ $1 = '-threadsimulate' ]]
 then
 THREADSIMULATEFLAG=true
@@ -174,10 +189,17 @@ cd $CURDIR
 shift
 elif [[ $1 = '-debug' ]]
 then
+RAWDEBUGFLAG=true
 EXTRAOPTIONS="$EXTRAOPTIONS -g"
+elif [[ $1 = '-rawpath' ]]
+then
+RAWPATHFLAG=true
 elif [[ $1 = '-runtimedebug' ]]
 then
-EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
+EXTRAOPTIONS="$EXTRAOPTIONS -DCHECKTA"
+elif [[ $1 = '-dsmcaching' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
 elif [[ $1 = '-nooptimize' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
@@ -225,7 +247,7 @@ else
 #if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
 if ! $NOJAVA
 then
-if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
+if ! java -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
 $JAVAOPTS $SRCFILES
 then exit $?
@@ -271,6 +293,46 @@ fi # CHECKFLAG
 
 #build and link everything
 
+if $RAWFLAG
+then # RAWFLAG
+RAWDIR="$CURDIR/raw"
+MAKEFILE="../Makefile.raw"
+mkdir $RAWDIR
+cd $RAWDIR
+make clean
+rm ./*
+
+export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
+
+if $RAWPATHFLAG
+then # print path
+RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
+fi
+
+if $RAWDEBUGFLAG
+then #debug version
+RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWDEBUG"
+fi
+
+if $INTERRUPTFLAG
+then #INTERRUPT version
+MAKEFILE="$MAKEFILE.i"
+RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
+fi #INTERRUPT version
+
+MAKEFILE="$MAKEFILE.$RAWCONFIG"
+
+cp $MAKEFILE ./Makefile
+cp ../Runtime/*.c ./
+cp ../Runtime/*.h ./
+cp ../Runtime/*.S ./
+cp ../Runtime/*.s ./
+cp ../tmpbuilddirectory/*.c ./
+cp ../tmpbuilddirectory/*.h ./
+
+make
+
+else #!RAWFLAG
 cd $CURDIR 
 
 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
@@ -289,7 +351,6 @@ $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
 $ROBUSTROOT/Runtime/ObjectHash.c \
 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
 $ROBUSTROOT/Runtime/math.c \
-$ROBUSTROOT/Runtime/signal.c \
 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
 
 if $DSMFLAG
@@ -299,7 +360,7 @@ if $TRANSSTATSFLAG
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DTRANSSTATS -DCOMPILER -DDSTM -I$DSMRUNTIME"
 fi
-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 $DSMRUNTIME/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRUNTIME/sockpool.c $DSMRUNTIME/addUdpEnhance.c"
+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 $DSMRUNTIME/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRUNTIME/sockpool.c $DSMRUNTIME/addUdpEnhance.c $DSMRUNTIME/signal.c $DSMRUNTIME/gCollect.c $DSMRUNTIME/addPrefetchEnhance.c $DSMRUNTIME/dsmlock.c"
 fi
 
 if $RECOVERFLAG
@@ -309,7 +370,7 @@ if $MULTICOREFLAG
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
 fi
-FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
+FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
 if $RAWFLAG
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
@@ -352,5 +413,7 @@ gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
 tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin
 fi
 
+fi #!RAWFLAG
+
 exit