I tried to build Boost 1.71.0:
sudo ./bootstrap.sh --prefix=/opt/boost -with-toolset=gcc
And it gave:
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
$ cat bootstrap.log
B2_TOOLSET is gcc, but the 'gcc' command cannot be executed.
Make sure 'gcc' is in PATH, or use a different toolset.
However, gcc is indeed in PATH
:
$ which gcc
/opt/rh/devtoolset-8/root/usr/bin/gcc
$ echo $PATH
/opt/rh/devtoolset-8/root/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/hc/.local/bin:/home/hc/bin
I wonder what goes wrong.
Thanks.
./bootstrap.sh is going to build the boost.build tool called b2, and install it at your prefix
Software collections work on a per user basis, so it might not work correctly with sudo. You can try to elevate to root with sudo -i
, turn on devtoolset-8 with scl enable devtoolset-8 bash
then attempt to build b2 and the rest of boost from there.
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.