bincrafters / community

Central repository for issues and recipes
http://bincrafters.readthedocs.io/en/latest/
MIT License
217 stars 36 forks source link

[boost_system/1.66.0] Can't cross compile for qnx #1041

Open AliAskari opened 4 years ago

AliAskari commented 4 years ago

Package and Environment Details (include every applicable attribute)

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'
AliAskari commented 4 years ago

I've updated the conan recipe for boost_generator locally to support qnx os and toolset but now I am getting the following error:

boost_system/1.69.0@bincrafters/testing: Calling build()
boost_system/1.69.0@bincrafters/testing: /home/ali/.conan/data/boost_system/1.69.0/bincrafters/testing/build/1c524fb9b807aedf3d9bb296ad48e3694a1a03f5: b2 -j4 -d+1 -a --hash=yes --debug-configuration --layout=system    system-build
notice: found boost-build.jam at /home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/boost-build.jam
notice: loading Boost.Build from /home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel
/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/util/os.jam:50: Unescaped special character in argument ([^.]*)$
/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/util/os.jam:204: Unescaped special character in argument os:
/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/util/os.jam:205: Unescaped special character in argument os:
notice: Searching '/etc' '/home/ali' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/util' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/build' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/tools' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/contrib' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/.' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in '/etc' '/home/ali' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/util' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/build' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/tools' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/contrib' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/.'.
notice: Searching '/home/ali' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/util' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/build' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/tools' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/contrib' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/.' for user-config configuration file 'user-config.jam'.
notice: Configuration file 'user-config.jam' not found in '/home/ali' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/kernel' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/util' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/build' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/tools' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/contrib' '/home/ali/.conan/data/boost_build/1.69.0/bincrafters/testing/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/share/boost-build/src/.'.
notice: Searching '.' for project-config configuration file 'project-config.jam'.
notice: Loading project-config configuration file 'project-config.jam' from '.'.
notice: will use '/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-g++' for qcc, condition <toolset>qcc
===============MPI Auto-configuration===============
warning: toolset mpi initialization: can not find tool mpic++
warning: initialized from project-config.jam:58
MPI auto-detection failed: unknown wrapper compiler mpic++
Please report this error to the Boost mailing list: http://www.boost.org
You will need to manually configure MPI support.
warning: toolset mpi initialization: can not find tool mpirun
warning: initialized from project-config.jam:58
MPI launcher: mpirun -np
====================================================
...found 113 targets...
...updating 12 targets...
common.copy system/lib/jamroot.jam
qcc.compile.c++ bin/system/build/782d134be99bb91348c7dd49e1c1ce59/error_code.o
aarch64-unknown-nto-qnx7.0.0-g++: error: unrecognized command line option '-Wc,-ftemplate-depth-128'
aarch64-unknown-nto-qnx7.0.0-g++: error: unrecognized command line option '-Wc,-fno-inline'

    "/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-g++" -Wc,-ftemplate-depth-128 -std=c++11 -gstabs+ -O0 -Wc,-fno-inline -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -I"/home/ali/.conan/data/boost_config/1.69.0/bincrafters/testing/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/config/include" -I"/home/ali/.conan/data/boost_predef/1.69.0/bincrafters/testing/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/predef/include" -I"/home/ali/.conan/data/boost_winapi/1.69.0/bincrafters/testing/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/winapi/include" -I"system/include" -c -o "bin/system/build/782d134be99bb91348c7dd49e1c1ce59/error_code.o" "system/src/error_code.cpp"

...failed qcc.compile.c++ bin/system/build/782d134be99bb91348c7dd49e1c1ce59/error_code.o...
...skipped <pbin/system/build/782d134be99bb91348c7dd49e1c1ce59>libboost_system.a for lack of <pbin/system/build/782d134be99bb91348c7dd49e1c1ce59>error_code.o...
...skipped <psystem/lib>libboost_system.a for lack of <pbin/system/build/782d134be99bb91348c7dd49e1c1ce59>libboost_system.a...
...failed updating 1 target...
...skipped 2 targets...
...updated 9 targets...
boost_system/1.69.0@bincrafters/testing: 
boost_system/1.69.0@bincrafters/testing: ERROR: Package '1c524fb9b807aedf3d9bb296ad48e3694a1a03f5' build failed
boost_system/1.69.0@bincrafters/testing: WARN: Build folder /home/ali/.conan/data/boost_system/1.69.0/bincrafters/testing/build/1c524fb9b807aedf3d9bb296ad48e3694a1a03f5
ERROR: boost_system/1.69.0@bincrafters/testing: Error in build() method, line 147
    self._build_common()
while calling '_build_common', line 170
    self.run(" ".join(b2_command))
    ConanException: Error 1 while executing b2 -j4 -d+1 -a --hash=yes --debug-configuration --layout=system    system-build
Johnnyxy commented 4 years ago

Hi there,

QNX general

QNX uses a GCC variant for their systems. One should not invoke the GCC directly. It is recommended to call the binary qcc for C and q++ for C++. qcc / q++ in turn calls the GCC. It uses the commandline parameter -V to determine the appropriate and replicablable settings for the GCC call. See the -Y parameter here. This means you should not use the aarch64-unknown-nto-qnx7.0.0-gcc, aarch64-unknown-nto-qnx7.0.0-g++, ... directly. Do not get me wrong. It CAN be used but it is not recommended.

Boost and QNX

Boost supports QNX theoretically out-of-the-box. But I think it is more of an feature by request as I got the impression that it is not specifically tested. Thus there are some problems with QNX in general (e.g. see here, here, here) and specifically with QNX 7 (e.g. see here). I recommend to use the latest Boost versions 1.70.0 or 1.71.0 as those have some fixes for QNX included (but some are still missing).

Conan and QNX

Conan started a preliminary support for QNX with Conan version 1.60.0. But there are still some tasks which have to be done. As Conan cannot deduce the correct settings for the target architecture etc. This is something that can do only someone who is actively using QNX, its compiler and Conan as it involves quite some testing (like always with QNX). I already did some work in this regard but did not have the time to generalize the code to merge it into the Conan code base. It is a pending task on my list but as I already can work with Conan it does not have the highest priority. But this is no real problem as everything to support QNX in Conan is available as settings.yml (see here) and Conan recipes.

Boost recipe

To start with Conan, Boost and QNX you have to specify the correct settings for the QNX compiler in the Boost recipe. You can try the recipe I have uploaded here. Be aware this is an old one. I have already integrated the current Boost recipes for versions Boost 1.70.0 and 1.71.0 to support QNX and it works. I build Boost for several targets (QNX 6.5, QNX 7: x86_64, armv7, aarch64, etc.). I am using Conan to build around 50 targets (e.g. Windows and Visual Studio 2010-2017, some Linux targets, some QNX targets, ... with multiple build types like Release and Debug). At the moment I cannot share them because of time constraints. I will try to backport the local settings to a standalone recipe and share it next year (just one month left :) ).

Anyway, in the meantime I can help you if you have problems with compiling for QNX in general.

CMake and QNX

I did not deeply look into all your posted output here, but I think your CMake configuration is not quite appropriate for the QCC. I will investigate it further and will get back at you.

AliAskari commented 4 years ago

thanks for the detailed reply @Johnnyxy, very informative. My current goal is to build a minimal version of boost and use it in a proof of concept project.

I did use the recipe and conan/cmake profiles and toolchain files you have provided but it only builds zlib and doesn't build boost itself, which is very odd.

However when I use your conan profile and cmake cross toolchain file and run

conan install boost/1.70.0@conan/stable --profile=../res/conan/aarch64le-qnx-neutrino_7.0_qcc_5.4_gpp --build=missing

it tries to build boost but fails with hundreds of compile errors and all errors seem to show there's a problem finding the compiler,

    "QCC" -Wc,-ftemplate-depth-128 -fvisibility-inlines-hidden -fPIC -O3 -Wc,-finline-functions -Wc,-Wno-inline -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "/home/ali/.conan/data/boost/1.70.0/conan/stable/build/28b84964141618f76e9bfbde23013f1873ce1533/boost/bin.v2/libs/type_erasure/build/qcc-5.4/rls/lnk-sttc/thrdp-pthrd/thrd-mlt/vsblt-hdn/dynamic_binding.o" "libs/type_erasure/src/dynamic_binding.cpp"

/bin/sh: 2: QCC: not found

I was expecting conan to use to QCC environmet variable but it is not. Below is the effective profile that conan uses:

[settings]
arch=aarch64le
compiler=qcc
compiler.libcxx=gpp
compiler.version=5.4
os=Neutrino
os.version=7.0
[options]
[build_requires]
[env]
CONAN_CMAKE_GENERATOR=Unix Makefiles
CONAN_CMAKE_TOOLCHAIN_FILE=/home/ali/Downloads/conan_qnx/res/conan/../cmake/toolchain_aarch64le-qnx-neutrino-7.0_gcc_ntoaarch64le_gpp-qcc-5.4.0.cmake
QCC=/home/ali/repos/cross_toolchain/qnx_7/host/linux/x86_64/usr/bin/qcc
AliAskari commented 4 years ago

@Johnnyxy if you could give me some tips on how I can get the environment to find the path to QCC I would really appreciate it.

Johnnyxy commented 4 years ago

I have to prepare some files to give you a full example. But as hint: In the QNX 7.0 installation folder is a ".bat" (or ".sh" for Linux) file that sets the corresponding path for you. It is the easiest to use that.

  1. Open a console.
  2. cd /home/ali/repos/cross_toolchain/qnx_7/
  3. execute source qnxsdp-env.sh

Now any subsequent call of qcc or q++ will successfully be found by the system. E.g. q++ -Vgcc_ntox86_64 your-CPP-file.cpp

This includes Boost's "B2" that calls qcc or q++.

AliAskari commented 4 years ago

I can't believe I missed that. So after sourcing the bash file it actually starts to compile but it fails to compile 4 files:

libs/locale/src/posix/numeric.cpp:26:22: fatal error: monetary.h: No such file or directory
libs/locale/src/posix/converter.cpp: In function 'std::__1::locale boost::locale::impl_posix::create_convert(const std::__1::locale&, boost::shared_ptr<const char*>, boost::locale::character_facet_type)':
libs/locale/src/posix/converter.cpp:145:65: error: 'nl_langinfo_l' was not declared in this scope
                 std::string encoding = nl_langinfo_l(CODESET,*lc);
libs/locale/src/posix/posix_backend.cpp: In member function 'virtual std::__1::locale boost::locale::impl_posix::posix_localization_backend::install(const std::__1::locale&, boost::locale::locale_category_type, boost::locale::character_facet_type)':
libs/locale/src/posix/posix_backend.cpp:123:70: error: 'nl_langinfo_l' was not declared in this scope
                 return create_codecvt(base,nl_langinfo_l(CODESET,*lc_),type);
                                                                      ^
In file included from ./boost/asio/detail/executor_op.hpp:20:0,
                 from ./boost/asio/impl/system_executor.hpp:18,
                 from ./boost/asio/system_executor.hpp:129,
                 from ./boost/asio/associated_executor.hpp:21,
                 from ./boost/asio/detail/bind_handler.hpp:20,
                 from ./boost/asio/detail/wrapped_handler.hpp:18,
                 from ./boost/asio/io_context.hpp:24,
                 from libs/log/src/syslog_backend.cpp:31:
./boost/asio/detail/handler_alloc_helpers.hpp:230:9: error: 'struct std::__1::allocator_traits<boost::asio::detail::recycling_allocator<void, boost::asio::detail::thread_info_base::default_tag> >::rebind_alloc<boost::asio::detail::executor_op<boost::asio::executor::function, std::__1::allocator<void>, boost::asio::detail::scheduler_operation> >' has no member named 'deallocate'
         a1.deallocate(static_cast<op*>(v), 1); \
         ^

I wish there was an option to disable asio/locale libraries. These are the errors that I get while installing the boost/1.71.0@conan/stable package. Do you have any ideas what might be going wrong? It seems the monetary.h file does not even exist on my qnx toolchain.

Johnnyxy commented 4 years ago

This problem is related to Boost in combination with the QNX 7.0 and its changes to the original GCC variant. Have a look here: https://github.com/boostorg/asio/issues/248

For a workaround you can take a look here: https://github.com/boostorg/config/issues/288

When I finally provide a all-in-one-solution with Conan this issue will be solved too. Hopefully I can do it until X-Mas. But until then you have to go with a solution by yourself from the links I provided.

Johnnyxy commented 4 years ago

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.

AliAskari commented 4 years ago

@Johnnyxy thanks for the detailed reply. Things seem to work but I had to modify the boost recipe:

  1. Had to specify the full name of the boost requirements:

    if self.options.zlib:
    self.requires("zlib/1.2.11@conan/stable")
    if self.options.bzip2:
    self.requires("bzip2/1.0.8@conan/stable")
  2. Had to comment the bugfix section in the package method:

    # copy compile bugfixes
    #self.copy("*", dst=self._bugfixes_path, src=self._bugfixes_path)

The boost package seems to have been compiled and packaged properly. Will try to actually use it and report back if anything doesn't work.

Thanks!

Johnnyxy commented 4 years ago

Hi, that are good news. The first change with the references zlib/1.2.11@conan/stable depends on the availability of the recipe/packages in your local repository/remote repositories. The second change is a mistake by me. I will fix that. As the files have to be copied in order to fully work with QNX 7.0 compiler.

Johnnyxy commented 4 years ago

I have updated the ZIP file in my previous post. Could you try that recipe to test it?

derived-coder commented 4 years ago

@Johnnyxy When will you upload your patches? A shared build is not working:

/lhome/user/.conan/data2/boost/1.71.0/company/stable/build/899e88d2f02061eab23dc6212cef566642e903b0/boost/bin.v2/libs/test/build/qcc-5.4/rls/trgt-os-qnxnt/vsblt-hdn/execution_monitor.o: file not recognized: File format not recognized

However the static build is working, only the test_package fails to configure.

Johnnyxy commented 4 years ago

Hi @derived-coder , at the moment I am not able to do some work on the Conan base to help the developers to fully support Neutrino from QNX. But in my previous post (https://github.com/bincrafters/community/issues/1041#issuecomment-569460055) I provided everything one needs to build Boost explained how to do that. The static as well as the shared builds should work.

derived-coder commented 4 years ago

@Johnnyxy Here attached are my build logs: Here the build itself is failing. I added -q in order to make sure the build stops when it fails: boost_1.71_shared_build_logs.txt

Here the static build works, but I fail the test_package to configure: boost_1.71_static_build_logs.txt

In the meantime I will try out your suggestion with the relative paths and the setup file. I dont think that is the problem, because other conan recipes are working. But we will see.

Johnnyxy commented 4 years ago

The problem with your Boost build is that Boost's "B2" does not call the q++ compiler with your chosen architecture. Have a look at line 450 in your log.

You will see the appropriate settings for target selection (like -Y) is missing. The Boost recipe does not support the target selection for QNX. For this reason I had modified the boost recipe to do that.

Use the recipe provided in my ZIP file. It has the necessary changes and provides Boost with the correct parameters. Additionally my modified recipe works around some Boost bug/problems with QNX 7.0.

derived-coder commented 4 years ago

@Johnnyxy Of course I am using your recipe. but not your profile. btw. you recipe does not work out of the box:

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/lhome/user/sources/conan/conan-packages/conan-boost/conanfile.py", line 26, in <module>
    class BoostConan(ConanFile):
  File "/lhome/user/sources/conan/conan-packages/conan-boost/conanfile.py", line 86, in BoostConan
    exports_sources = ['patches/*', os.path.join(_bugfixes_path, '*')]
NameError: name '_bugfixes_path' is not defined

I modified:

 exports_sources = ['patches/*', os.path.join(_bugfixes_path, '*')]

to

exports_sources = ['patches/*', os.path.join("bugfixes", '*')]

besides that the only other modifications were: flags.append("-q") and adjusting the package version of the other conan required recipes.

Here are the logs of the working static build, just a few lines, this compile went through: boost_1.71_static_build_logs_compile_start.txt

I compile from linux to qnx and you from windows to qnx right? Maybe that is the issue here....

Johnnyxy commented 4 years ago

Yes, normally I am cross compiling Boost from Windows for QNX. But this should not make any difference as there is no difference to the execution of the qcc and q++.

That the modified recipe had one bug is known and documented here. I have fixed it (again) and reuploaded the recipe.

Regarding your build log. I am not sure the build will work. Have a look at line 489 in your log there you can see that the wrong archiver (ar) gets executed /lhome/user/tools/qnx/qnx700/host/linux/x86_64/usr/bin/i586-pc-nto-qnx7.0.0-ar. I do not have a QNX compiler at hand right now (weekend :)) so I cannot test it here to see why the wrong AR gets executed.

Can you elaborate what the -q flag should achieve? The docs do not document such flag (docs).

derived-coder commented 4 years ago

The -q flag is for the build tool of boost to stop compiling immediately when an error occurs. I mean how did you otherwise tested your compile? Thanks for the update, I will try it out again

Johnnyxy commented 4 years ago

Testing was actual using from other software. But to see if everything compiled fine I was looking fir the built targets report at the end when compiling boost.

derived-coder commented 4 years ago

Hi @Johnnyxy

here is the report of a "shared=True" build with boost 1.71.0 boost_1.71_shared_build_17.05.logs.txt

The error pops up again. However this time no python changes regarding the _bugfixes_path are necessary.

PS: Are you also contactable in the conan slack channel? PPS: I would also like to ping your attention to this issue here: https://github.com/conan-io/conan/issues/7027 Any idea?

Johnnyxy commented 4 years ago

I answered you on slack regarding the config inclusion. But I cannot help you with the pkconfig as I am not using this.

Besides the attached log is 1 byte in size :).

derived-coder commented 4 years ago

I uploaded the log again. Sorry for that.

Johnnyxy commented 4 years ago

The error file not recognized: File format not recognized comes from the invocation of the wrong linker. See at line 447. I am not sure why he is doing that. I would have to investigate this myself.