0

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.

HCSF
  • 2,387
  • 1
  • 14
  • 40

1 Answers1

0

./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.

CJ Smith
  • 11
  • 3
  • Thanks for your suggestion. I tried to run `./bootstrap.sh --prefix=/opt/boost -with-toolset=gcc` as root. Same issue. devtoolset-8 has been enabled. Any idea? – HCSF Dec 01 '19 at 02:29
  • Since that didn't work, I suspect that the script `./bootstrap.sh` is looking for gcc in the normal places, despite the PATH variable being set correctly. Another thing you could try is to add the line `source scl_source enable devtoolset-8` to the top of the `bootstrap.sh`. I've had some success with that in the past. [This article has some good information as well.](https://access.redhat.com/solutions/527703) – CJ Smith Dec 01 '19 at 19:19