Installing boost on RHEL/CentOS (7 or 8)

RHEL8/Centos8

The following is an example of how to to install boost on RHEL8 or CentOS8. The boost version here is 1.75 and the library selection was based on requirements for a Microsoft Casablanca (cpprestsdk) build.

These particular notes assume the “default” RHEL8 build environment using GCC v8.3.

wget https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz
tar xf boost_1_75_0.tar.gz 
cd boost_1_75_0
./bootstrap.sh --libdir=/usr/local/lib64 --with-libraries=system,thread,test,chrono,regex,date_time,filesystem,locale,random,atomic,log,program_options
./b2 -j 8
sudo ./b2 install

RHEL7/Centos7

The following is an example of how to to install boost on RHEL7 or CentOS7. The boost version here is 1.68 and the library selection was based on requirements for a Microsoft Casablanca (cpprestsdk) build.

These particular notes assume GCC 7.2 built from source.

mkdir -p ~/src && cd ~/src
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
tar xf boost_1_68_0.tar.gz
cd boost_1_68_0
./bootstrap.sh --libdir=/usr/local/lib64 --with-libraries=system,thread,test,chrono,regex,date_time,filesystem,locale,random,atomic,log,program_options
echo "using gcc : 7.2 : /usr/local/bin/g++ ; " >> tools/build/src/user-config.jam
./b2 -j 8 cxxflags="-Wno-deprecated-declarations -Wno-unused-function" --toolset=gcc-7.2
sudo ./b2 install

Leave a Comment