Linux HOWTOs

About | Home | Search


HOWTO: boost
Description: c++ libraries, see the site for more info
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# Boost 1.67.0
# ============
# Slackware 13.37: boost 1.45.0
# Slackware 14.0: boost 1.49.0
# Slackware 14.1: boost 1.54.0
# Slackware 14.2: boost 1.59.0
#
# Always check 'patches' too in case of upgrades

# If you want to uninstall Boost or remove files from a previous version
# before installing the new one, skip down to the bottom

# I include 1.67.0, the latest, and 1.59.0, the version required by
# MySQL 5.7.x

# Prerequisites:
# Python
# zlib
# bzip2
# iconv or libiconv
# icu

# Release notes for 1.67.0 are here:
# http://www.boost.org/users/download/version_1_67_0

# If you have trouble with the download URL below, try here instead:
# https://sourceforge.net/projects/boost/files/boost/

# Get it
cd
test -f installed/boost_1_67_0.tar.bz2 &&
 mv installed/boost_1_67_0.tar.bz2 .
test ! -f boost_1_67_0.tar.bz2 &&
 wget 
 wget https://dl.bintray.com/boostorg/release/1.67.0/source/\
boost_1_67_0.tar.bz2

# Verify tarball w/ sha256sum:
# (this works too: openssl sha256 boost_1_67_0.tar.bz2)
echo "2684c972994ee57fc5632e03bf044746f6eb45d4920c343937a465fd67a5adb\
a  boost_1_67_0.tar.bz2" | sha256sum -c

# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "boost_*" -exec rm -r {} \;
tar xjvf ~/boost_1_67_0.tar.bz2
cd boost_1_67_0
test $UID = 0 && chown -R root:root .

# If you want everything to go in to /usr/local, leave off --prefix below
# Below we match the location of the Slackware package

# Configure it - 64-bit
test $(uname -m) = 'x86_64' &&
./bootstrap.sh --prefix=/usr --libdir=/usr/lib64

# Configure it - anything else
test $(uname -m) != 'x86_64' &&
./bootstrap.sh --prefix=/usr

# Build it
./b2

# Become root to build and install it
su

# Older versions of this howto (e.g. boost 1.31.0) also installed these
# binaries, remove them if they're there:
( cd /usr/local/bin ; rm -f jam mkjambase yyacc )

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg boost

# Remove files from previously installed versions:
find /usr/include -maxdepth 1 -type d -name "boost-*"\
 -exec rm -r {} \;
test -d /usr/include/boost && rm -r /usr/include/boost
rm -f /usr/lib*/libboost_*

# Install it
./b2 install
ldconfig

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/boost_*.tar.*
mv boost_1_67_0.tar.bz2 installed/


# If you ever want to uninstall Boost, this should do it:
cd
su
for pfx in /usr /usr/local;
do
  find ${pfx}/include -maxdepth 1 -type d -name "boost-*"\
   -exec rm -r {} \;
  test -d ${pfx}/include/boost && rm -r ${pfx}/include/boost
  rm -f ${pfx}/lib*/libboost_*
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "boost_*" -exec rm -r {} \;
rm -f ~/installed/boost_*.tar.*

Back to the list


Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>