community: [boost_system/1.66.0] Can't cross compile for qnx

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: boost_system/1.66.0@bincrafters/stable
  • Operating System+version: Linux Ubuntu 18.04
  • Compiler+version: qcc-5.4
  • Conan version: conan 1.20.4
  • Python version: Python 3.6.8

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os_build=Linux
arch_build=x86_64
os=Neutrino
os.version=7.0
arch=armv8
compiler=qcc
compiler.version=5.4
compiler.libcxx=cxx
build_type=Debug
[options]
*:shared=False
[build_requires]
[env]
CONAN_CMAKE_TOOLCHAIN_FILE=/home/ali/repos/ali/cmake/qnx-toolchain.cmake
CONAN_CMAKE_FIND_ROOT_PATH=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/aarch64-buildroot-nto-qnx/sysroot/
CHOST=aarch64-unknown-nto
AR=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ar
ASM=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-as
AS=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-as
RANLIB=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ranlib
QCC=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc
qcc=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc
Q++=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-g++
STRIP=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-strip

Steps to reproduce (Include if Applicable)

I am trying to install boost_system/1.66.0@bincrafters/stable for my QNX target, using the above profile like so

conan install boost_system/1.66.0@bincrafters/stable --profile=../conan/qnx-aarch64-debug --build=missing

but the conan installation fails when conan is preparing to build

Traceback (most recent call last):
  File "/home/ali/.conan/data/boost_generator/1.66.0/bincrafters/stable/export/conanfile.py", line 57, in content
    .replace("{{{toolset}}}", self.b2_toolset) \
  File "/home/ali/.conan/data/boost_generator/1.66.0/bincrafters/stable/export/conanfile.py", line 203, in b2_toolset
    return b2_toolsets[str(self.settings.compiler)]
KeyError: 'qcc'
boost_system/1.66.0@bincrafters/stable: ERROR: Generator boost(file:None) failed
'qcc'
ERROR: 'qcc'

Logs (Include/Attach if Applicable)

Installing package: boost_system/1.66.0@bincrafters/stable
Requirements
    boost_assert/1.66.0@bincrafters/stable from 'bincrafters' - Cache
    boost_config/1.66.0@bincrafters/stable from 'bincrafters' - Cache
    boost_core/1.66.0@bincrafters/stable from 'bincrafters' - Cache
    boost_package_tools/1.66.0@bincrafters/stable from 'bincrafters' - Cache
    boost_predef/1.66.0@bincrafters/stable from 'bincrafters' - Cache
    boost_system/1.66.0@bincrafters/stable from 'bincrafters' - Cache
    boost_winapi/1.66.0@bincrafters/stable from 'bincrafters' - Cache
Packages
    boost_assert/1.66.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    boost_config/1.66.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    boost_core/1.66.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    boost_package_tools/1.66.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    boost_predef/1.66.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    boost_system/1.66.0@bincrafters/stable:47d0ae200929a8c0d15cb0426f2f107c37355999 - Build
    boost_winapi/1.66.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
Build requirements
    boost_build/1.66.0@bincrafters/stable from 'bincrafters' - Cache
    boost_generator/1.66.0@bincrafters/stable from 'bincrafters' - Cache
Build requirements packages
    boost_build/1.66.0@bincrafters/stable:44fcf6b9a7fb86b2586303e3db40189d3b511830 - Cache
    boost_generator/1.66.0@bincrafters/stable:6ec6439c54a97da1cfddff786d1ea15988300369 - Cache

Cross-build from 'Linux:x86_64' to 'Neutrino:armv8'
boost_build/1.66.0@bincrafters/stable: Already installed!
boost_package_tools/1.66.0@bincrafters/stable: Already installed!
boost_config/1.66.0@bincrafters/stable: Already installed!
boost_generator/1.66.0@bincrafters/stable: Already installed!
boost_predef/1.66.0@bincrafters/stable: Already installed!
boost_assert/1.66.0@bincrafters/stable: Already installed!
boost_winapi/1.66.0@bincrafters/stable: Already installed!
boost_core/1.66.0@bincrafters/stable: Already installed!
boost_system/1.66.0@bincrafters/stable: Applying build-requirement: boost_generator/1.66.0@bincrafters/stable
boost_system/1.66.0@bincrafters/stable: Applying build-requirement: boost_build/1.66.0@bincrafters/stable
boost_system/1.66.0@bincrafters/stable: WARN: Build folder is dirty, removing it: /home/ali/.conan/data/boost_system/1.66.0/bincrafters/stable/build/47d0ae200929a8c0d15cb0426f2f107c37355999
boost_system/1.66.0@bincrafters/stable: Copying sources to build folder
boost_system/1.66.0@bincrafters/stable: Building your package in /home/ali/.conan/data/boost_system/1.66.0/bincrafters/stable/build/47d0ae200929a8c0d15cb0426f2f107c37355999
Traceback (most recent call last):
  File "/home/ali/.conan/data/boost_generator/1.66.0/bincrafters/stable/export/conanfile.py", line 57, in content
    .replace("{{{toolset}}}", self.b2_toolset) \
  File "/home/ali/.conan/data/boost_generator/1.66.0/bincrafters/stable/export/conanfile.py", line 203, in b2_toolset
    return b2_toolsets[str(self.settings.compiler)]
KeyError: 'qcc'
boost_system/1.66.0@bincrafters/stable: ERROR: Generator boost(file:None) failed
'qcc'
ERROR: 'qcc'

About this issue

Most upvoted comments

Hi, I have compiled some files which includes everything you need to build Boost from scratch. These files are based on my changes for Boost 1.70.0. I took the current Boost recipe from conan-index and added those changes to support QNX 7.0. As I do not have a QNX compiler at hand at the moment I am not able to test it until next year.

It should work.

If you use CMake for your main project (not for Boost) all necessary modifications are incorporated too if you invoke the build by Conan’s create command. Otherwise you have to specify the provided toolchain filepath yourself (see Profiles section).

Profiles

First you use a conan profile for your projects which need Boost. I have added a profiles folder that you can copy to your home folder (see here) to be able to use a profile specifically for QNX 7.0 (aarch64le, cxx). This folder includes a CMake toolchain file (profile/toolchains) for this QNX target. This supports creating packages by using conan create without modifications of Conan recipes which use CMake.

Boost recipe

To support compilation of Boost’s source with the QNX 7.0 compiler I had to extend the recipe with some flags. To use this recipe instead of the official one from Conan-Index you have to export it into your local Conan repository:

Execute this in the boost-recipe folder: Replace the original reference: conan export . boost/1.71.0@conan/stable Use a custom reference : conan export . boost/1.71.0@my_user/my_channel

Your project

After that you can build_requires the exported Boost reference in your conanfile.[txt/py] and everything should run fine.

E.g. in your project folder with your conanfile.py: conan create . my_package/0.0.0@my_user/my_channel -pr=aarch64le-qnx-neutrino-7.0-cxx_qcc-5.4 -s build_type=Release

Download

Everything can be found in the attached archive: conan_boost_qnx-7.0.zip

Note

This shows my current state of changes to support building Boost through Conan at the moment. I am sure there could be made changes to Conan and Boost recipe to minimize the changes. I am working on that.

The changes to the Boost recipe can be used for QNX 6.x too. No further modifications to build Boost for QNX 6.x are required. Only the provided files in the profiles path are QNX 7.0 aarch64le/cxx specific.