boost安装
摘要
最近有项目要使用boost, 就下载安装boost, 并记下安装的问题.
下载
截止2018-08-19, boost最新版本为1.68.0
boost管网: https://www.boost.org/
软件包下载:https://www.boost.org/users/history/version_1_68_0.html
解压
tar -xzf boost安装包
安装
安装会花费较长时间
cd boost_1_68_0/
./bootstrap.sh
sudo ./b2 install
sudo ldconfig
问题
编译过程中,发现报找不到 pyconfig.h
解决:
sudo find / -name pyconfig.h
找到文件在 /usr/include/python2.7 下
在 ~/.bashrc的末尾添加
export CPLUS_INCLUDE_PATH=/usr/include/python2.7/
重新加载.bashrc
. .bashrc #注意两点中间空格
boost目录下重新运行安装命令:
sudo ./b2 install
运行 ldconfig
sudo ldconfig
其他
安装时可以自定义安装位置
sudo ./b2 –prefix=yourpath install
否则默认是安装在 /usr/local 下
其他配置可运行以下命令进行查看
./b2 –help
参考文章&&致谢
https://blog.csdn.net/wangkun1340378/article/details/77949130
https://stackoverflow.com/questions/16914383/boost-python-cant-find-pyconfig-h-where-does-it-need-to-go