Skip to content
Snippets Groups Projects
Commit 65ea49e1 authored by Matthias Volk's avatar Matthias Volk
Browse files

Improved build script

parent c689908c
No related branches found
No related tags found
No related merge requests found
......@@ -4,30 +4,47 @@
set -e
# Print usage
if [ "$#" -ne 2 ]; then
echo "# Usage: ./build_storm.sh DIRECTORY GIT_USER_NAME"
if [[ "$#" < 1 || "$#" > 3 ]]; then
echo "# Script for building Storm and its dependencies (Z3, Carl) on the cluster."
echo "#"
echo "# Usage: ./build_storm.sh DIRECTORY [GIT_USER_NAME] [GIT_BRANCH]"
echo "# - DIRECTORY specifies the folder in which all tools are built."
echo "# - GIT_USER_NAME is optional. If present, the internal SCM Git with the given username is used."
echo "# Otherwise, the public Github repo is used."
echo "# - GIT_BRANCH is optional. If present, the given branch is used instead of the default master branch."
echo "# Note that GIT_USER_NAME has to be given in this instance as the internal SCM Git is used."
exit 1
fi
# Variables
DIR=$(readlink -f $1)
USER=$2
BRANCH=${3:-master}
CORES=40
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
# Output given configuration
echo "# Building Storm and its dependencies in directory '$DIR'."
if [ -z "$USER" ]; then
echo "# Using public GitHub repos."
else
echo "# Using SCM Git repos with user '$USER'."
fi
echo "# Using Storm branch '$BRANCH'."
# Create DIR
mkdir -p $DIR
# Prepare cluster environment (gcc, boost, etc.)
echo "# Preparing evironment."
source $SCRIPT_DIR/../prepareEnvironmentGcc.sh
echo "# Building Storm and its dependencies in directory '$DIR'. Git user is '$USER'."
mkdir -p $DIR
# IntelTBB
# Get correct library paths for Intel TBB
TBB_PREFIX=$(tr ':' '\n' <<< "$LD_LIBRARY_PATH" | grep $TBBROOT | tr '\n' ';')
TBB_PREFIX="$TBB_PREFIX$TBBROOT" # we need no ; separator because the tr command already added a trailing one
TBB_PREFIX="$TBB_PREFIX$TBBROOT" # we need no ; separator here because the tr command already added a trailing semicolon
echo "# TBB Prefix: $TBB_PREFIX"
# Z3
......@@ -56,13 +73,22 @@ echo "# Building Z3 finished."
echo "# Building Carl."
cd $DIR
if [ ! -d carl ]; then
# Use correct git repo
if [ -z "$USER" ]; then
git clone https://github.com/smtrat/carl.git -b master14
else
git clone https://$USER@srv-i2.informatik.rwth-aachen.de/scm/git/carl.git -b master14
fi
fi
cd carl
mkdir -p build
cd build
echo "$BOOST_ROOT"
if [ ! -f CMakeCache.txt ]; then
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON
# Carl CMake configure command
cmake .. -DCMAKE_BUILD_TYPE=RELEASE \
-DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON \
-DBOOST_ROOT="$BOOST_ROOT"
fi
make lib_carl -j$CORES
echo "# Building Carl finished."
......@@ -72,17 +98,24 @@ echo "# Building Carl finished."
cd $DIR
echo "# Building Storm."
if [ ! -d storm ]; then
git clone https://$USER@srv-i2.informatik.rwth-aachen.de/scm/git/storm.git
# Use correct git repo
if [ -z "$USER" ]; then
git clone https://github.com/moves-rwth/storm.git -b $BRANCH
else
git clone https://$USER@srv-i2.informatik.rwth-aachen.de/scm/git/storm.git -b $BRANCH
fi
fi
cd storm
mkdir -p build
cd build
if [ ! -f CMakeCache.txt ]; then
# Storm CMake configure command
cmake .. -DCMAKE_BUILD_TYPE=Release -DSTORM_DEVELOPER=OFF -DSTORM_LOG_DISABLE_DEBUG=ON \
-DZ3_ROOT=$DIR/z3 \
-DSTORM_USE_INTELTBB=ON -DTBB_ROOT="$TBB_PREFIX" \
-DSTORM_USE_GUROBI=ON \
-DSTORM_CARL_DIR_HINT=$DIR/carl/build
fi
# Build Storm binaries
make binaries -j$CORES
echo "# Building Storm finished."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment