Created
January 19, 2016 17:13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P ) | |
BUILD_PATH=$HOME/build/lgd_build_debug | |
INSTALL_PATH=$HOME/local_install_debug | |
REPO_PATH=$HOME/libgeodecomp | |
HPX_ROOT=$HOME/hpx_install_debug | |
BOOST_PATH=/opt/boost/1.58.0-gcc-5.2-release | |
NUM_BUILDCORES=16 | |
if [ "$1" = "clean" ]; then | |
rm -rf $BUILD_PATH | |
exit 0 | |
fi | |
if [ ! -d "$BUILD_PATH" ]; then | |
mkdir -p "$BUILD_PATH" | |
cd "$BUILD_PATH" | |
############################################ | |
# MODIFY CMAKE FLAGS AS YOU WISH | |
# | |
echo "HPX_ROOT = ${HPX_ROOT}" | |
echo "HPX_DIR = ${HPX_ROOT}/share/hpx/cmake" | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \ | |
-DWITH_HPX=true \ | |
-DWITH_CUDA=false \ | |
-DCMAKE_CXX_COMPILER=/opt/gcc/5.2/bin/g++ \ | |
-DCMAKE_PREFIX_PATH=$HOME/local_install_debug/ \ | |
-DBOOST_ROOT=${BOOST_PATH} \ | |
-DHPX_BUILD_TYPE=Debug \ | |
$REPO_PATH | |
# | |
############################################ | |
# cleanup on failure | |
rc=$? | |
if [[ $rc != 0 ]] ; then | |
cd "$SCRIPTPATH" | |
rm -rf "$BUILD_PATH" | |
exit $rc | |
fi | |
fi | |
# the actual build command | |
cd "$BUILD_PATH" | |
nice make "$@" -k -j$NUM_BUILDCORES || exit 1 | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment