Search code examples
c++boostconan

Fail to deploy arm64 complied boost in Intel based macOS using Conan


While trying to create a cross-platform build system for my project, I encountered the following issue when fetching boost library from Conancenter:

here's the install command + configuration

-- Conan executing: conan install /Users/me/myproj/conan.py --remote conancenter --build missing --settings build_type=Release --settings compiler=apple-clang --settings compiler.version=13.1 --settings compiler.libcxx=libc++
Configuration:
[settings]
arch=armv8
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=13.1
os=Macos
os_build=Macos
[options]
[build_requires]
[env]

And this is the error I've got :

boost/1.79.0: WARN: Boost component 'stacktrace_addr2line' is missing libraries. Try building boost with '-o boost:without_stacktrace_addr2line'. (Option is not guaranteed to exist)
boost/1.79.0: WARN: Boost component 'stacktrace_backtrace' is missing libraries. Try building boost with '-o boost:without_stacktrace_backtrace'. (Option is not guaranteed to exist)
ERROR: boost/1.79.0: Error in package_info() method, line 1664
    raise ConanException("These libraries were expected to be built, but were not built: {}".format(non_built))
    ConanException: These libraries were expected to be built, but were not built: {'boost_stacktrace_backtrace', 'boost_stacktrace_addr2line'}

any idea how to resolve it ?


Solution

  • If you also see errors in the boost build indicating that there are boost libraries that were found but not packaged then your problem may be that the compiler version you specified in your .conan/profile/default does not actually match the version that the compiler reports. What is happening is that the boost conan recipe needs to predict what the filenames of the build libraries will be, and if it is incorrect you'll see errors in the package build where 1) it says that libraries were not built that were supposed to be built and 2) the conan build found libraries files that were not packaged. So check your clang version with: clang --version and make sure that matches.