rebuild-dune.sh 1.25 KB
Newer Older
Felix Tobias Schindler's avatar
Felix Tobias Schindler committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/bash

set -e

if [ "X${OPTS}" == "X" ]; then
    echo You have to define OPTS, i.e. export OPTS=gcc-relwithdebinfo
    exit
fi

# define environment in case we are not in one of our dockers
# determines which one to use below environments/
if [ "X${DXT_ENVIRONMENT}" == "X" ]; then
    export DXT_ENVIRONMENT=debian-full
fi

# check existence of the virtualenv
if [ "X$e/${DXT_ENVIRONMENT}/venv/dune-${OPTS}" == "X" ]; then
    echo Missing virtualenv, did you call setup.sh?
    exit
fi

# load the variables of this environment, sources the virtualenv
source e/${DXT_ENVIRONMENT}/PATH.sh

# build dune
NPROC=$(($(nproc) - 1))
./dune-common/bin/dunecontrol --opts=config.opts/$OPTS --builddir=$INSTALL_PREFIX/build-$OPTS configure
./dune-common/bin/dunecontrol --opts=config.opts/$OPTS --builddir=$INSTALL_PREFIX/build-$OPTS bexec 'make -j$NPROC all'
29
./dune-common/bin/dunecontrol --opts=config.opts/$OPTS --builddir=$INSTALL_PREFIX/build-$OPTS bexec 'make -j$NPROC bindings_no_ext || echo no bindings'
Felix Tobias Schindler's avatar
Felix Tobias Schindler committed
30 31 32 33 34 35 36
./dune-common/bin/dunecontrol --opts=config.opts/$OPTS --builddir=$INSTALL_PREFIX/build-$OPTS bexec 'make install_python'

echo
echo "All done! From now on run"
echo "  export OPTS=$OPTS"
echo "  source e/${DXT_ENVIRONMENT}/PATH.sh"
echo "to activate the virtualenv!"