yum install boostyum install boost-develyum install boost-doc
二.安装包安装 1、去官网boost下载你想要的安装包
2、安装boost依赖包:yum -y install gcc gcc-c++ python python-devel libicu libicu-devel zlib zlib-devel bzip2 bzip2-devel
3、拷贝到系统
tar -zxvf boost_1_78_0.tar.gzcd boost_1_78_0# 默认安装sudo ./bootstrap.sh # 也可以指定安装目录,例如sudo ./bootstrap.sh --prefix=/usr/local/include/boost# 安装boostsudo ./b2 install
4、安装boost.build
cd /boost/tools/buildsudo ./bootstrap.shsudo ./b2 install --prefix=/usr/local/include/boostldconfig
三、验证 1、程序thread.cpp#include
[root@hackett boost]# g++ thread.cpp -o thread -lboost_thread[root@hackett boost]# ./threadThread 7f520774c700: 0Thread 7f5206f4b700: 0Thread 7f5206f4b700: 1Thread 7f520774c700: 1Thread 7f5206f4b700: 2Thread 7f520774c700: 2Thread 7f520774c700: 3Thread 7f5206f4b700: 3Thread 7f5206f4b700: 4Thread 7f520774c700: 4