0

I am using latest Conan 1.* version to handle dependencies on an old CentOS distro. Everything works fine, except Boost, which apparently is using something called B2:

b2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by b2)
b2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by b2)

The actual correct version of libstdc++.so can be found in /opt/rh/devtoolset-12/root/lib/gcc/x86_64-redhat-linux/12, but B2 is not able to see this.

I think I set everything correctly on my Conan Profile though:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=12.2
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
PATH=/opt/rh/devtoolset-12/root/bin:/opt/rh/devtoolset-12/root/lib/gcc/x86_64-redhat-linux/12:/opt/rh/devtoolset-12/root/lib64

I am executing the usual command:

conan install ../../conanfile.txt --build missing

Everything used to work before Conan 2.0

I am not even sure what does Boost need to do, since afaik it is a header only library and my expectations were that it would have been the easiest to handle

My Conanfile.txt is the following:

[requires]
benchmark/1.7.0
boost/1.83.0
gtest/1.10.0

[generators]
cmake

[layout]
cmake_layout

I tried also to downgrade Boost but the same error always shows up

thebugger
  • 123
  • 6
  • try `conan install ../../conanfile.txt --build missing --build b2` – Alan Birtles Aug 29 '23 at 16:43
  • `b2` is the build system for boost, and the precompiled binary is not compatible with your machine (it might happen that other packages aren't compatible either, and will crash later, you might need to ``--build="*"`` to build all from source. – drodri Aug 29 '23 at 17:07
  • It is also recommended to drop the ``cmake`` generator and use ``CMakeDeps`` and ``CMakeToolchain``. The ``cmake`` legacy generator doesn't work with ``cmake_layout`` and is being abandoned (it was already removed in Conan 2.0) – drodri Aug 29 '23 at 17:07
  • I am trying everything that was suggested. B2 seems to be unable to compile. The only meaningful error seems to be this one: `/usr/bin/env: sh: No such file or directory` – thebugger Aug 30 '23 at 08:47
  • How old is your version of centos? Looks like `/usr/bin/env sh` doesn't work? Or maybe https://stackoverflow.com/questions/18172405/getting-error-usr-bin-env-sh-no-such-file-or-directory-when-running-command-p – Alan Birtles Aug 30 '23 at 17:19
  • @AlanBirtles my version is 7.9.2009 and unfortunately I am not allowed to update it – thebugger Aug 31 '23 at 08:54
  • ah, could it be that you've removed all the default entries from `PATH`? you'll need to add them back, probably why `env` can't find `sh`. I just tried building `b2` on a docker image of centos 7 and it worked correctly – Alan Birtles Aug 31 '23 at 11:50

1 Answers1

1

You need to build b2 rather than using the version from conan center which requires a newer os. You can do this by running:

conan install ../../conanfile.txt --build missing

Your PATH in your profile doesn't include the standard directories, this will mean that standard programs like sh can't be found. Add the following directories to the end of your list:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Alan Birtles
  • 32,622
  • 4
  • 31
  • 60