Skip to content

Instantly share code, notes, and snippets.

@1duo
Last active April 4, 2024 18:39
Show Gist options
  • Save 1duo/2d1d851f76f8297be264b52c1f31a2ab to your computer and use it in GitHub Desktop.
Save 1duo/2d1d851f76f8297be264b52c1f31a2ab to your computer and use it in GitHub Desktop.
Install Boost library from source on CentOS 7.

Download Boost Library: http://www.boost.org (Choose the expected version)

wget https://cfhcable.dl.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
wget https://phoenixnap.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz

Unzip, Bootstrap and Install

tar -xzf boost_1_*
cd boost_1_*
./bootstrap.sh --prefix=/opt/boost
./b2 install --prefix=/opt/boost --with=all
@unknownzerx
Copy link

b2 accepts -jN like make.

@arunhep
Copy link

arunhep commented Jul 4, 2019

Where is boost installed after these commands?

@1duo
Copy link
Author

1duo commented Jul 5, 2019

Where is boost installed after these commands?

You can use the command line flag --prefix to manage installed location. In my example, it will be installed at /opt/boost/.

@srimaln91
Copy link

Thank you. :)

@Levi-Hope
Copy link

Good instruction. Great thx.

@theShmoo
Copy link

Some notes:
This needs to be run as root for installing it to /opt/boost
I needed to add a / to the the cd command.

tar -xzf boost_1_*
cd boost_1_*/
./bootstrap.sh --prefix=/opt/boost
sudo ./b2 install --prefix=/opt/boost --with=all

@djassie
Copy link

djassie commented Mar 3, 2023

sudo ./bootstrap.sh
sudo ./b2 install --with=all

@sweihub
Copy link

sweihub commented Jul 28, 2023

sudo ./bootstrap.sh
sudo ./b2 install --with=all

sudo works! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment