[package] boost/1.72.0: dependency 'b2' not found when cross compiling
See original GitHub issueSummary
When cross compiling boost
the conan build system does not find the build_requires
dependency b2
. b2
does get built with the correct compiler and works but the boost
recipe can not access the dependency - specifically, the key b2
does not exist in self.deps_cpp_info
and the compilation process aborts with this error message:
ERROR: boost/1.72.0: Error in build() method, line 408
full_command = "%s %s" % (self._b2_exe, b2_flags)
while calling '_b2_exe', line 340
return os.path.join(self.deps_cpp_info["b2"].rootpath, "bin", b2_exe)
KeyError: 'b2'
This has been tested with two different cross toolchains for different target systems.
Package and Environment Details
- Package Name/Version: boost/1.72.0
- Operating System+version: Linux Ubuntu 19.10
- ‘build’ context compiler: gcc 9.2.1
- ‘host’ context compilers: x86_64-w64-mingw32-gcc 9.2-win32 and x86_64-apple-darwin19-clang 9.0.0-2 (from https://github.com/tpoechtrager/osxcross)
- Conan version: conan 1.24.0
- Python version: Python 3.7.5
Conan profiles
Configuration for profile default (the build
profile):
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=9.2
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
Configuration for profile x86_64-w64-mingw32 (one of the tested host
profiles):
[settings]
os=Windows
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=9.2
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
CC=x86_64-w64-mingw32-gcc
CXX=x86_64-w64-mingw32-g++
Configuration for profile x86_64-apple-darwin19 (one of the tested host
profiles):
[settings]
os=Macos
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=clang
compiler.version=9
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]
CC=x86_64-apple-darwin19-clang
CXX=x86_64-apple-darwin19-clang++
SDKROOT=/opt/osxcross/SDK/MacOSX10.15.sdk
Steps to reproduce
-
Install conan-1.24.0 and above profiles.
-
Create a simple conanfile.txt in an otherwise empty directory:
[generators]
cmake
[requires]
boost/1.72.0
- Build and install boost with the following command:
conan install . --profile:host x86_64-w64-mingw32 --profile:build default --build
Logs
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
g++ does not find cross compiled boost headers
# First install some dependencies apt-get install -y libflann-dev:armhf libeigen3-dev:armhf libglu1-mesa-dev:armhf freeglut3-dev:armhf mesa- ...
Read more >Version 1.72.0 - Boost C++ Libraries
Added missing async_initiate to the Windows-specific I/O objects' asynchronous operations. Ensured that the executor type is propagated to newly ...
Read more >Cross-Compilation of Dependencies - Vanetza
This document summarises a few hints for cross-compiling Vanetza's dependencies. Please note, that cross-compiling is not relevant for you if you plan to...
Read more >Compare Packages Between Distributions - DistroWatch.com
A complete package list for further comparison is available. Package, Gentoo Linux unstable, Devuan GNU+Linux unstable ceres. abiword (3.0.5), 3.0 ...
Read more >Details of dev-lang/R - Gentoo Linux Howtos
447396, Server, xmw, UNCONFIRMED, app-admin/bcfg2-1.2.3: missing RDEPEND on ... UNCONFIRMED, sys-devel/llvm fails to cross compile, 2012-11-13 16:20:28.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! It is great to know that someone is experimenting with the new cross building model, receiving feedback about this kind of features in real scenarios is very important for us 🙌
Using the new approach with the host and build profiles, it changes a little bit how things are propagated to consumers. Important bits here (we are interested in the
else
branch):Only requires and build_requires from the
host
context are propagated to thedeps_cpp_info
object (it contains compiler flags, libraries to link,… ) and information from the build_requires (build context) is available only as environment, so you can run these applications, but they are not supposed to be linked.Back to ConanCenter: right now we don’t have a dedicated effort to migrate all the recipes in ConanCenter to the new model because we need feedback about the feature, maybe we have broken something and we don’t know yet… although I’m starting to feel more comfortable about it, it’s been out for a month and a half now and there aren’t issues related to it 😃
The boost recipe in the new model should have just a
and the executable should be in the path. Right now, we can add some if/else to the recipe, or maybe use the
tools.which
to know ifb2
is available in the PATH.Notes.-
b2
is coming from build_requires or it is already installed in the system. Is it important? Can we do it somehow?tools.which()
, should it take arun_environment
argument?The attached
boost-build.log
was missing the stderr output, here a complete version. boost-build.log