# Get it
cd
test -f installed/boost_1_76_0.tar.bz2 &&
mv installed/boost_1_76_0.tar.bz2 .
test ! -f boost_1_76_0.tar.bz2 &&
wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/\
boost_1_76_0.tar.bz2
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "boost_*" -exec rm -r {} \;
tar xjvf ~/boost_1_76_0.tar.bz2
cd boost_1_76_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_76_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.*