简体   繁体   中英

Cannot stat 'b2': No such file or directory

I am trying to build boost-python in a virtual machine running Ubuntu 18, following the guide https://www.boost.org/doc/libs/1_76_0/more/getting_started/unix-variants.html

When I try to run the bootstrap command

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

I get the error,

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

I understand that I don't have b2, but I don't know why or where it is supposed to come from. So far all I've done is unpack the package

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

so I don't understand where I could have gone wrong.


Full traceback

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

This is my case: I tried to install boost on centOS 6 (without python) and got the same issue as you mentioned. Found this way and it works:

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

After implementing these command lines, please try to "./bootstrap.sh" again. Hoping this way can help you!

source by: briefly upgrade the version of gcc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM