天天看點

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      

繼續閱讀