#!/bin/bash
printhelp() {
+echo -dsm distributed shared memory
echo -check generate check code
echo -dmalloc link in dmalloc
echo -recover compile task code
echo -specdir directory
+echo -taskstate do task state analysis
+echo -optional enable optional
echo -debug generate debug symbols
+echo -webinterface enable web interface
echo -runtimedebug printout runtime debug messages
echo "-thread use support for multiple threads"
echo "-optimize call gcc with -O9 (optimize)"
CHECKFLAG=false
RECOVERFLAG=false
USEDMALLOC=false
+THREADFLAG=false
SPECDIR=`pwd`
SRCFILES=''
EXTRAOPTIONS=''
MAINFILE='a'
JAVAOPTS=''
+OPTIONALFLAG=false
if [[ -z $1 ]]
then
then
JAVAOPTS="$JAVAOPTS -mainclass $2"
shift
+elif [[ $1 = '-dsm' ]]
+then
+JAVAOPTS="$JAVAOPTS -dsm"
+elif [[ $1 = '-taskstate' ]]
+then
+JAVAOPTS="$JAVAOPTS -taskstate"
+elif [[ $1 = '-optional' ]]
+then
+JAVAOPTS="$JAVAOPTS -optional"
+OPTIONALFLAG=true
elif [[ $1 = '-dmalloc' ]]
then
USEDMALLOC=true
then
RECOVERFLAG=true
JAVAOPTS="$JAVAOPTS -task"
+elif [[ $1 = '-webinterface' ]]
+then
+JAVAOPTS="$JAVAOPTS -webinterface"
elif [[ $1 = '-instructionfailures' ]]
then
JAVAOPTS="$JAVAOPTS -instructionfailures"
elif [[ $1 = '-thread' ]]
then
JAVAOPTS="$JAVAOPTS -thread"
-EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS"
+EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
+THREADFLAG=true
elif [[ $1 = '-curdir' ]]
then
CURDIR=$2
INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
-I$BUILDDIR"
-FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/file.c \
-$ROBUSTROOT/Runtime/Queue.c $ROBUSTROOT/Runtime/SimpleHash.c \
-$ROBUSTROOT/Runtime/option.c $ROBUSTROOT/Runtime/garbage.c \
-$ROBUSTROOT/Runtime/socket.c $ROBUSTROOT/Runtime/GenericHashtable.c \
-$ROBUSTROOT/Runtime/object.c"
+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/garbage.c $ROBUSTROOT/Runtime/socket.c \
+$ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
if $RECOVERFLAG
then
EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
-else
+fi
+
+if $OPTIONALFLAG
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
+FILES="$FILES tmpbuilddirectory/optionalarrays.c"
+fi
+
+if $THREADFLAG
+then
FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
fi
gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
tmpbuilddirectory/methods.c $FILES -o $MAINFILE.bin
-exit
\ No newline at end of file
+exit
+