0

我正在尝试按照指南https://www.boost.org/doc/libs/1_76_0/more/getting_started/unix-variants.html在运行 Ubuntu 18 的虚拟机中构建 boost-python

当我尝试运行引导命令时

rlane@rlane-VirtualBox:/usr/local/lib/boost_1_76_0$ ./bootstrap.sh --with-python=$(which python3)

我得到错误,

cpp: fatal error: too many input files
compilation terminated.
> cp b2 bjam
cp: cannot stat 'b2': No such file or directory

我知道我没有 b2,但我不知道为什么或应该从哪里来。到目前为止,我所做的只是打开包装

tar --bzip2 -xfj /usr/local/lib/boost_1_76_0.tar.bz2

所以我不明白我哪里出错了。


完整回溯

Building B2 engine..

###
###
### Using 'cxx' toolset.
###
###

cpp (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


###
###

> cpp -DNDEBUG builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp execunix.cpp filesys.cpp filent.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam_strings.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp object.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp startup.cpp subst.cpp sysinfo.cpp timestamp.cpp variable.cpp w32_getreg.cpp modules/order.cpp modules/path.cpp modules/property-set.cpp modules/regex.cpp modules/sequence.cpp modules/set.cpp -o b2
cpp: fatal error: too many input files
compilation terminated.
> cp b2 bjam
cp: cannot stat 'b2': No such file or directory

Failed to build B2 build engine
4

1 回答 1

0

这是我的情况:我尝试在centOS 6(没有python)上安装boost,并遇到了与您提到的相同的问题。以这种方式找到并且它有效:

1. wget https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo -O /etc/yum.repos.d/devtoolset-3.repo
2. sudo yum -y install devtoolset-3-gcc devtoolset-3-gcc-c++ devtoolset-3-binutils
3. sudo scl enable devtoolset-3 bash

执行这些命令行后,请再次尝试“./bootstrap.sh”。希望这种方式可以帮到你!

来源:简要升级gcc的版本

于 2021-12-07T03:53:17.077 回答