Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] boost/1.74.0+: fails build with newer b2 (4.7.1) #9339

Open
ngrodzitski opened this issue Feb 10, 2022 · 7 comments
Open

[package] boost/1.74.0+: fails build with newer b2 (4.7.1) #9339

ngrodzitski opened this issue Feb 10, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ngrodzitski
Copy link
Contributor

ngrodzitski commented Feb 10, 2022

Since https://github.com/conan-io/conan-center-index/pull/9069/files was introduced
Boost build fails on CentOS with oldet GLIBC.
And when I try to build boost it fails:

boost/1.74.0: Applying build-requirement: b2/4.7.1
Downloading conan_sources.tgz
boost/1.74.0: Configuring sources in /home/builder/.conan/data/boost/1.74.0/_/_/source
boost/1.74.0: Building your package in /home/builder/.conan/data/boost/1.74.0/_/_/build/32ca3112cecfe9c5c4973c7db941dbc0cf164132
boost/1.74.0: Generator txt created conanbuildinfo.txt
boost/1.74.0: Aggregating env generators
boost/1.74.0: Calling build()
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)

Is it possible to override the value b2 for boost package (ultimately: to tune a build requirements for any package referenced in my conanfile). I've tried to set b2 in build requirements of my package but that doesn't affect what boost uses for its own build.

With b2/4.5.0 it builds fine. Is there any workaround?

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: boost/1.74.0+
  • Operating System+version: CentOS 7
  • Compiler+version: GCC 10 (devtoolset)
  • Conan version: conan 1.44.1
  • Python version: Python 3.6
@ngrodzitski ngrodzitski added the bug Something isn't working label Feb 10, 2022
@SSE4
Copy link
Contributor

SSE4 commented Feb 14, 2022

see the discussion: #9069

@ngrodzitski
Copy link
Contributor Author

@SSE4 I've seen the discussion. I understand the reasoning behind a switch to new version. But I don't recognize any workarounds regarding my case (if there is then could you, please, highlight them).

So I would like to know how to keep using boost with conan on centos with older GLIBC.

@ngrodzitski
Copy link
Contributor Author

For those who occasionally got here:
Current workaround is to mirror the package in local registry (build on our internal environment and upload to internal registry)

@jwakely
Copy link

jwakely commented Aug 7, 2023

So I would like to know how to keep using boost with conan on centos with older GLIBC.

This has nothing to do with Glibc. The GLIBCXX_3.4.21 symbol version is from libstdc++.so not from glibc.

The problem is that you're using a newer GCC to compile+link b2 but then not telling ld.so how to find the libstdc++.so from the newer gcc when b2 is being executed later. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic for various solutions.

Another solution would be to build b2 using the system gcc, then build the rest of boost with the newer gcc.

@jwakely
Copy link

jwakely commented Aug 7, 2023

* Compiler+version: **GCC 10** (devtoolset)

Are you sure you're using the devtoolset GCC? If you were using it, you would not have any dependency on GLIBCXX_3.4.20 or GLIBCXX_3.4.21, since that's the point of the devtoolset compiler.

@Molin-L
Copy link

Molin-L commented May 31, 2024

This works for me to avoid GLIBCXX_* missing issue:

conan install . --output-folder=build --build="*"

Here is my Dockerfile for reference:

FROM centos:7
RUN yum -y install epel-release
RUN yum -y install ninja-build

RUN yum -y install centos-release-scl-rh
RUN yum -y install devtoolset-11
RUN yum -y install python3-devel
RUN yum -y install perl-Data-Dumper
RUN pip3 install scikit-build --upgrade
RUN pip3 install conan --upgrade
RUN pip3 install pip --upgrade
RUN pip3 install cmake --upgrade

# For Conan build all
RUN yum groupinstall -y 'Development Tools'
RUN yum install -y perl-Digest-SHA

RUN yum install -y dnf
RUN yum install -y rh-python38

I run this command to setup conan:

conan profile detect --force && \
conan install . --output-folder=build --build=b2 --build=missing && \
cmake -G Ninja --preset conan-release -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/g++

@uilianries
Copy link
Member

@Molin-L @jwakely @ngrodzitski It failed because b2 was built by different Docker images, using different libstdc++ and glibc versions. As workaround, you should build b2 from sources.

As alternative, in case wanting to use b2/4.5.0, you can replace it via profile in Conan 2.x. For instance:

https://docs.conan.io/2/reference/config_files/profiles.html#replace-tool-requires

# ~/.conan2/profiles/boost
...
[platform_tool_requires]
b2/*: b2/4.5.0

@uilianries uilianries self-assigned this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants