#!/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"
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
SRCFILES=''
EXTRAOPTIONS=''
MAINFILE='a'
+JAVAFORWARDOPTS=''
JAVAOPTS=''
+OPTIONALFLAG=false
if [[ -z $1 ]]
then
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
then
CHECKFLAG=true
JAVAOPTS="$JAVAOPTS -conscheck"
+elif [[ $1 = '-enable-assertions' ]]
+then
+JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
elif [[ $1 = '-specdir' ]]
then
cd $2
# 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
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"