非ROOT用户安装BOOST 1.70 | Ubuntu

鉴于不是root用户,为了安装boost.python真的废了老命了,特此记录安装过程

一、下载解压以及准备

下载boost压缩包:boost_1_70_0.tar.gz,并解压

tar -xvf boost_1_70_0.tar.gz

 为了安装boost.python,需要要include“pyconfig.h”,所以一定要在你的python下找到这个文件所在位置,并添加到环境变量里

export CPLUS_INCLUDE_PATH=/your-path/envs/r0.3.0/include/python3.6m:$CPLUS_INCLUDE_PATH

不然会报错: fatal error: pyconfig.h: 没有那个文件或目录

二、安装

因为我不能保存在 /user/local下,所以我要自己设置一个安装bosst的目录,--prefix=/your/boost/path

我用的是环境里安的python,所以先进入环境(Anaconda)后进入解压目录:

cd boost_1_70_0

然后输入:

./bootstrap.sh --with-python=/your_path/envs/r0.3.0/bin/python3.6 --with-python-root=/your_path/envs/r0.3.0/lib/python3.6 --prefix=/your/boost/path

显示如下成功:(我不需要mpi++)

Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version... 3.6
Unicode/ICU support for Boost.Regex?... /usr
Generating Boost.Build configuration in project-config.jam for gcc...

Bootstrapping is done. To build, run:

    ./b2
    
To generate header files, run:

    ./b2 headers

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help
     
   - Getting started guide: 
     http://www.boost.org/more/getting_started/unix-variants.html
     
   - Boost.Build documentation:
     http://www.boost.org/build/

 然后输入:

./b2 install -a --with=all

--with=all是安装boost所有库,过了很久以后显示:

...updated 16664 targets...

就安装好了!(没有failed,之前装了好几次都有failed)

 

 

参考链接:https://www.cnblogs.com/xuyuan77/p/8716003.html

https://blog.csdn.net/qq_31720329/article/details/78184262

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值