install_boost.sh 730 Bytes
Newer Older
1 2 3 4 5 6 7
#! /bin/bash

set -e
set -x

ROOT=${PWD}

8 9 10
BOOST_VERSION="1.62.0"
BOOST_FILENAME="boost_${BOOST_VERSION//[.]/_}.tar.gz"

11 12 13 14 15
INSTALL_PREFIX=${ROOT}/install
mkdir -p ${INSTALL_PREFIX}

BUILD_DIR=/tmp/$USER/boost_build
mkdir -p ${BUILD_DIR}
16

17 18 19 20 21
# install boost
if [ ! -d ${INSTALL_PREFIX}/boost ]; then
  curl -SL "http://netcologne.dl.sourceforge.net/project/boost/boost/${BOOST_VERSION}/${BOOST_FILENAME}" \
    | tar --strip-components=1 -xzC ${BUILD_DIR}
  cd ${BUILD_DIR}
22
  ./bootstrap.sh --prefix=${INSTALL_PREFIX}/boost \
23
                 --with-libraries=system,iostreams,filesystem,program_options,date_time,test
24 25
  ./b2 -s NO_BZIP2=1 cxxflags="-std=c++11" --build-type=minimal variant=release -j 4 install
  rm -rf ${BUILD_DIR}
26
fi