天天看点

CentOS 7 安装Boost 1.67及boost_python

获取boost

boost官网:

https://www.boost.org/
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz      

 安装依赖

yum -y install gcc-c++ python-devel bzip2-devel zlib-devel      

 解压

tar zxvf boost_1_67_0.tar.gz      

  进入解压后的目录boost_1_67_0,执行

cd boost_1_67_0
./bootstrap.sh --prefix=/usr/local/boost --with-python=/usr/anaconda3/bin/python3 --with-python-root=/usr/anaconda3/bin/python3      

安装

./b2      

执行安装这一步,需要注意的是要使用root用户权限来安装,安装执行完后,生成的动态库和静态库,还有需要包含的头文件,会自动复制到 /usr/local/lib 和/usr/local/include 目录下。

./b2 install      

安装Boost.Build

进入boost_1_67_0目录下的tools/build目录,执行

cd tools/build
./bootstrap.sh      
./b2 install --prefix=/usr/local/boost      

继续阅读