Math classlibrary
[IRC.git] / Robust / src / buildscript
index 8600fd83ae294d213534426ad6d08b03cb34d4da..fde52d795c08d0099722c9024f987a19950731b9 100755 (executable)
@@ -1,12 +1,17 @@
 #!/bin/bash
 
 printhelp() {
+echo -dsm distributed shared memory
+echo -mac distributed shared memory mac support
 echo -check generate check code
 echo -dmalloc link in dmalloc
 echo -recover compile task code
 echo -specdir directory
+echo -selfloop task - this task cannot self loop forever
 echo -taskstate do task state analysis
+echo -optional enable optional
 echo -debug generate debug symbols
+echo -prefetch prefetch analysis
 echo -webinterface enable web interface
 echo -runtimedebug printout runtime debug messages
 echo "-thread use support for multiple threads"
@@ -16,12 +21,16 @@ echo -curdir directory
 echo -mainclass class with main method
 echo -o binary
 echo -instructionfailures inject code for instructionfailures
+echo -profile build with profile options
+echo "-enable-assertions execute assert statements during compilation"
 echo -help help
 }
 
 ROBUSTROOT=~/research/Robust/src
+DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
 REPAIRROOT=~/research/Repair/RepairCompiler/
 CURDIR=`pwd`
+DSMFLAG=false
 CHECKFLAG=false
 RECOVERFLAG=false
 USEDMALLOC=false
@@ -30,7 +39,9 @@ SPECDIR=`pwd`
 SRCFILES=''
 EXTRAOPTIONS=''
 MAINFILE='a'
+JAVAFORWARDOPTS=''
 JAVAOPTS=''
+OPTIONALFLAG=false
 
 if [[ -z $1 ]]
 then
@@ -52,9 +63,30 @@ elif [[ $1 = '-mainclass' ]]
 then
 JAVAOPTS="$JAVAOPTS -mainclass $2"
 shift
+elif [[ $1 = '-selfloop' ]]
+then
+JAVAOPTS="$JAVAOPTS -selfloop $2"
+shift
+elif [[ $1 = '-dsm' ]]
+then
+JAVAOPTS="$JAVAOPTS -dsm"
+DSMFLAG=true
+elif [[ $1 = '-prefetch' ]]
+then
+JAVAOPTS="$JAVAOPTS -prefetch"
+elif [[ $1 = '-mac' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
+elif [[ $1 = '-profile' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -pg"
 elif [[ $1 = '-taskstate' ]]
 then
 JAVAOPTS="$JAVAOPTS -taskstate"
+elif [[ $1 = '-optional' ]]
+then
+JAVAOPTS="$JAVAOPTS -optional"
+OPTIONALFLAG=true
 elif [[ $1 = '-dmalloc' ]]
 then
 USEDMALLOC=true
@@ -72,6 +104,9 @@ elif [[ $1 = '-check' ]]
 then
 CHECKFLAG=true
 JAVAOPTS="$JAVAOPTS -conscheck"
+elif [[ $1 = '-enable-assertions' ]]
+then
+JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
 elif [[ $1 = '-specdir' ]]
 then
 cd $2
@@ -120,9 +155,11 @@ fi
 
 # Build bristlecone/java sources
 
-java -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
+if ! java $JAVAFORWARDOPTS -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
 $JAVAOPTS $SRCFILES
+then exit $?
+fi
 
 # Build all of the consistency specs
 
@@ -170,15 +207,28 @@ INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c \
 $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/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
 
+if $DSMFLAG
+then
+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/dstmserver.c $DSMRUNTIME/plookup.c $DSMRUNTIME/ip.c $DSMRUNTIME/queue.c $DSMRUNTIME/prelookup.c $DSMRUNTIME/machinepile.c $DSMRUNTIME/localobjects.c $ROBUSTROOT/Runtime/thread.c"
+fi
+
 if $RECOVERFLAG
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
 fi
 
+if $OPTIONALFLAG
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
+FILES="$FILES tmpbuilddirectory/optionalarrays.c"
+fi
+
 if $THREADFLAG
 then
 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"