Closed ujos closed 8 months ago
@ujos Hello and thank you for your detailed report! I can reproduce your error in fact.
What happens here is an incompatibility between the linux distribution used to build b2 package and distribute over Conan Center, and your environment.
The GCC7 used by ConanCenterIndex CI is based on Ubuntu 18.04, which uses glibc 2.27:
docker run --rm --platform=linux/amd64 ubuntu:18.04 ldd --version 09:33:22
ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27
Copyright (C) 2018 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.
Written by Roland McGrath and Ulrich Drepper.
However, CentOS 7 uses an older version:
docker run --rm --platform=linux/amd64 centos:centos7.9.2009 ldd --version 09:33:10
ldd (GNU libc) 2.17
Copyright (C) 2012 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.
Written by Roland McGrath and Ulrich Drepper.
This mismatch is causing your error, your system can not provide a glibc with those new symbols.
To solve your error, you should build b2
and all other packages from source:
conan install --build --profile:host=dev --profile:build=dev ../conanfile.txt
To store and distribute your packages in your company (for instance), you can use an instance of Artifactory, there is a free standalone edition available to download here: https://conan.io/downloads
Still, if you are afraid about mixing packages from Conan Center with those built in your company, you could customize your settings.yml
and add distro
entry, so any package installed should have it identified:
https://docs.conan.io/2/reference/config_files/settings.html#adding-new-settings
Regards!
@uilianries It seems the problem actually is not a glibc version, but how C++ runtime for g++7 is built. In my case it is built without C++11 ABI support. Please see above, I used the --disable-libstdcxx-dual-abi
key to build the g++. By default C++ runtime contains both ABIs. Once I've recompiled the g++ without that key, I was able to run the original b2 binary downloaded from the Conan Centre.
So the ticket may be closed.
Meanwhile, usually on RHEL developers use devtools. They do not build GCC from sources. I'm not quite sure the C++ runtime shipped with devtools contains both ABIs. Theoretically in case if you rebuild b2 with the disabled C++11 ABI (-D_GLIBCXX_USE_CXX11_ABI=0
), then it may run on RHEL7 out of the box.
@ujos Thank you for sharing it! Your feedback your help the community in the future! Regards!
@uilianries Actually based on Conan profile, the b2 binary has to be provided without C++11 ABI.
compiler.libcxx=libstdc++
Description
When I try to build
boost 1.81.0
with the gcc 7.3 on RHEL7, I get the following error:It seems you use more recent version of the compiler to build the binary for the Conan repo. Would be great if you could use the lowest possible version of the gcc so
b2
can be used on more Linux distributions.Package and Environment Details
Conan profile
[settings] os=Linux os_build=Linux arch=x86_64 arch_build=x86_64 compiler=gcc compiler.version=7.3 compiler.libcxx=libstdc++
[options]
[build_requires]
[buildenv] CC=/home/dev/bin/GCC-7.3-noabi/bin/gcc CXX=/home/dev//bin/GCC-7.3-noabi/bin/g++
Steps to reproduce
Download and compile GCC 7.3:
Run conan
Logs
Click to expand log
``` Configuration (profile_host): [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++ compiler.version=7.3 os=Linux os_build=Linux [options] [build_requires] [env] [buildenv] CC=/home/dev/bin/GCC-7.3-noabi/bin/gcc CXX=/home/dev/bin/GCC-7.3-noabi/bin/g++ Configuration (profile_build): [settings] arch=x86_64 arch_build=x86_64 compiler=gcc compiler.libcxx=libstdc++ compiler.version=7.3 os=Linux os_build=Linux [options] [build_requires] [env] [buildenv] CC=/home/dev/bin/GCC-7.3-noabi/bin/gcc CXX=/home/dev/bin/GCC-7.3-noabi/bin/g++ boost/1.81.0: WARN: Package binary is corrupted, removing: 8438a4aad5972a9b6a587e21db6b066a43751a4b Version ranges solved Version range '>=1.2.11 <2' required by 'boost/1.81.0' resolved to 'zlib/1.3.1' in local cache conanfile.txt: Installing package Requirements boost/1.81.0 from 'conancenter' - Cache bzip2/1.0.8 from 'conancenter' - Cache libbacktrace/cci.20210118 from 'conancenter' - Cache zlib/1.3.1 from 'conancenter' - Cache Packages boost/1.81.0:8438a4aad5972a9b6a587e21db6b066a43751a4b - Build bzip2/1.0.8:5c39baad2a4c92b4e96092a25e4899075a701d92 - Cache libbacktrace/cci.20210118:b09bec465fef58dc59f15f359cb57c2007336987 - Cache zlib/1.3.1:b09bec465fef58dc59f15f359cb57c2007336987 - Cache Build requirements b2/4.10.1 from 'conancenter' - Cache Build requirements packages b2/4.10.1:4db1be536558d833e52e862fd84d64d75c2b3656 - Cache Installing (downloading, building) binaries... b2/4.10.1: Already installed! bzip2/1.0.8: Already installed! libbacktrace/cci.20210118: Already installed! zlib/1.3.1: Already installed! boost/1.81.0: Applying build-requirement: b2/4.10.1 boost/1.81.0: WARN: Build folder is dirty, removing it: /home/dev/.conan/data/boost/1.81.0/_/_/build/8438a4aad5972a9b6a587e21db6b066a43751a4b boost/1.81.0: Building your package in /home/dev/.conan/data/boost/1.81.0/_/_/build/8438a4aad5972a9b6a587e21db6b066a43751a4b boost/1.81.0: Generator txt created conanbuildinfo.txt boost/1.81.0: Calling generate() boost/1.81.0: Aggregating env generators boost/1.81.0: Calling build() boost/1.81.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/home/dev/.conan/data/boost/1.81.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file. boost/1.81.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/home/dev/.conan/data/boost/1.81.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file. boost/1.81.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/home/dev/.conan/data/boost/1.81.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.81.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/home/dev/.conan/data/boost/1.81.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.81.0: WARN: replace_in_file didn't find pattern '