Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] Boost/1.85.0: Cannot compile for Android #24915

Closed
cjserio opened this issue Aug 13, 2024 · 7 comments
Closed

[package] Boost/1.85.0: Cannot compile for Android #24915

cjserio opened this issue Aug 13, 2024 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@cjserio
Copy link

cjserio commented Aug 13, 2024

Description

I'm experiencing two issues. The first is that when I try to compile with the profile included in this report, I get these assembly errors:

libs/context/src/asm/make_arm64_aapcs_elf_gas.S:61:5: error: unknown use of instruction mnemonic without a size suffix
    and x0, x0, ~0xF
    ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:64:17: error: unknown token in expression
    sub x0, x0, #0xb0
                ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:68:16: error: expected ']' in brackets expression
    str x2, [x0, #0xa0]
               ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:72:5: error: invalid instruction mnemonic 'adr'
    adr x1, finish
    ^~~
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:73:16: error: expected ']' in brackets expression
    str x1, [x0, #0x98]
               ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:75:5: error: unknown use of instruction mnemonic without a size suffix
    ret x30
    ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:79:13: error: unknown token in expression
    mov x0, #0
            ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:81:5: error: invalid instruction mnemonic 'bl'
    bl _exit
    ^~

The second issue is that if I disable all of the components (such as context) to get past these error and get boost to compile, when my android app tries to link, I still get these errors:

    ld: error: undefined symbol: boost::archive::detail::basic_oarchive::save_object(void const*, boost::archive::detail::basic_oserializer const&)
    >>> referenced by oserializer.hpp:260 (/Users/me/.conan2/p/b/boostcfd77fc990e6b/p/include/boost/archive/detail/oserializer.hpp:260)

I've made sure the linker log is showing that I'm linking against the serialization library. The library exists in the proper location...it just doesn't seem to accept the library for some reson.

Package and Environment Details

  • Package Name/Version: boost/1.85.0
  • Operating System+version: Mac OS 14.6
  • Compiler+version: clang
  • Conan version: conan 2.60.0
  • Python version: Python 3.12.4

Conan profile

[settings]
arch=armv8
os=Android
os.api_level=24
compiler=clang
compiler.version=14
compiler.libcxx=c++_static
compiler.cppstd=20

[conf]
tools.android:ndk_path={{ os.getenv("ANDROID_NDK_ROOT") }}

Steps to reproduce

conan install --requires=boost/1.85.0 --profile=android_profile --build=missing

Logs

-------- Installing package boost/1.85.0 (6 of 6) --------
boost/1.85.0: Building from source
boost/1.85.0: Package boost/1.85.0:bed8195ab1878e505394e6975abd1a618a24fcdb
boost/1.85.0: Building your package in /root/.conan2/p/b/boost3e586e5e63267/b
boost/1.85.0: Calling generate()
boost/1.85.0: Generators folder: /root/.conan2/p/b/boost3e586e5e63267/b/build/conan
boost/1.85.0: Generating aggregated env files
boost/1.85.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
boost/1.85.0: Calling build()
boost/1.85.0: WARN: replace_in_file didn't find pattern '$(>) > $(<)' in '/root/.conan2/p/boost61c71161686bc/s/src/libs/stacktrace/build/Jamfile.v2' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/root/.conan2/p/boost61c71161686bc/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/root/.conan2/p/boost61c71161686bc/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/root/.conan2/p/boost61c71161686bc/s/src/tools/build/src/tools/gcc.jam' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/root/.conan2/p/boost61c71161686bc/s/src/tools/build/src/tools/gcc.jam' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '    <conditional>@numa' in '/root/.conan2/p/boost61c71161686bc/s/src/libs/fiber/build/Jamfile.v2' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '! [ $(property-set).get <target-os> ] in windows cygwin darwin aix &&' in '/root/.conan2/p/boost61c71161686bc/s/src/boostcpp.jam' file.
boost/1.85.0: WARN: Patching user-config.jam
boost/1.85.0: WARN:
using zlib : 1.3.1 : <include>"/root/.conan2/p/b/zlib481b779c424c7/p/include" <search>"/root/.conan2/p/b/zlib481b779c424c7/p/lib" <name>z ;
using bzip2 : 1.0.8 : <include>"/root/.conan2/p/b/bzip2ad79d402a1755/p/include" <search>"/root/.conan2/p/b/bzip2ad79d402a1755/p/lib" <name>bz2 ;
using "clang-linux" :  :  "/usr/bin/clang++" :
<compileflags>"-I/root/.conan2/p/b/libba5aae25fcfd853/p/include" <linkflags>"-L/root/.conan2/p/b/libba5aae25fcfd853/p/lib"  ;
boost/1.85.0: Cross building, detecting compiler...
boost/1.85.0: Cross building flags: []
boost/1.85.0: WARN: b2 -q numa=on target-os=android architecture=arm address-model=64 binary-format=elf abi=aapcs --layout=system --user-config=/root/.conan2/p/boost61c71161686bc/s/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libiconv threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-cobalt --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=clang-linux cxxstd=2a pch=on -sLIBBACKTRACE_PATH=/root/.conan2/p/b/libba5aae25fcfd853/p define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1 -sICONV_PATH=/root/.conan2/p/b/libic75ac3b4d78a19/p linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/root/.conan2/p/b/boost3e586e5e63267/p -j10 --abbreviate-paths -d0 --debug-configuration --build-dir="/root/.conan2/p/b/boost3e586e5e63267/b/build"
boost/1.85.0: RUN: b2 -q numa=on target-os=android architecture=arm address-model=64 binary-format=elf abi=aapcs --layout=system --user-config=/root/.conan2/p/boost61c71161686bc/s/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libiconv threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-cobalt --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=clang-linux cxxstd=2a pch=on -sLIBBACKTRACE_PATH=/root/.conan2/p/b/libba5aae25fcfd853/p define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1 -sICONV_PATH=/root/.conan2/p/b/libic75ac3b4d78a19/p linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/root/.conan2/p/b/boost3e586e5e63267/p -j10 --abbreviate-paths -d0 --debug-configuration --build-dir="/root/.conan2/p/b/boost3e586e5e63267/b/build"
notice: found boost-build.jam at /root/.conan2/p/boost61c71161686bc/s/src/boost-build.jam
notice: loading B2 from /root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build-system.jam
notice: Searching '/etc' '/root' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/util' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/tools' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/options' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/contrib' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in '/etc' '/root' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/util' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/tools' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/options' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/contrib' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build' '/root/.conan2/p/b20717b8c0763fa/p/bin/.b2'.
notice: Loading explicitly specified user configuration file:
    /root/.conan2/p/boost61c71161686bc/s/src/tools/build/user-config.jam
notice: Searching '/root/.conan2/p/boost61c71161686bc/s/src/tools/build' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from '/root/.conan2/p/boost61c71161686bc/s/src/tools/build'.
notice: [zlib] Using pre-installed library
notice: [zlib] Condition
notice: [bzip2] Using pre-installed library
notice: [bzip2] Condition
notice: will use '/usr/bin/clang++' for clang-linux, condition <toolset>clang-linux-10
warning: toolset clang-linux initialization: can not find tool windres
warning: initialized from /root/.conan2/p/boost61c71161686bc/s/src/tools/build/user-config.jam:5
notice: using rc compiler :: <toolset>clang-linux-10 :: as
notice: [zlib] zlib is already configured
notice: [bzip2] bzip is already configured
notice: iostreams: not using lzma compression
notice: iostreams: not using zstd compression
notice: [python-cfg] Configuring python...
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command 'python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg]   interpreter command: "python"
notice: [python-cfg]   include path: "/usr/include/python3.8"
notice: [python-cfg]   library path: "/usr/lib/python3.8/config" "/usr/lib"
notice: [python-cfg] Checking for NumPy...
notice: [python-cfg] running command 'python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
notice: [python-cfg] NumPy disabled. Reason:
notice: [python-cfg]   python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())" aborted with
notice: [python-cfg]   Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
/root/.conan2/p/boost61c71161686bc/s/src/libs/test/build/../../predef/check/predef.jam:17: in modules.import from module predef
warning: loading predef
warning: circular module loading dependency:
warning: build-system Jamfile</root/.conan2/p/boost61c71161686bc/s/src/libs/test/build> predef ==> predef
/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:1308: in import from module Jamfile</root/.conan2/p/boost61c71161686bc/s/src/libs/test/build>
libs/test/build/Jamfile.v2:11: in modules.load from module Jamfile</root/.conan2/p/boost61c71161686bc/s/src/libs/test/build>
/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:544: in load-jamfile from module project
/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:68: in load from module project
/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:109: in load-used-projects from module project
/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:79: in load from module project
/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:201: in project.find from module project
/root/.conan2/p/b20717b8c0763fa/p/bin/.b2/build-system.jam:618: in module scope from module build-system
Performing configuration checks

    - default address-model    : 64-bit [1]
    - default architecture     : x86 [1]
    - cxx11_static_assert      : yes [2]
    - cxx11_variadic_templates : yes [2]
    - cxx11_decltype           : yes [2]
    - GCC libquadmath and __float128 support : no [2]
    - cxx11_hdr_ratio          : yes [2]
    - cxx11_template_aliases   : yes [2]
    - cxx11_char16_t           : yes [2]
    - cxx11_char32_t           : yes [2]
    - cxx20_hdr_concepts       : no [2]
    - cxx20_hdr_concepts       : no [3]
    - has std::atomic_ref      : no [2]
    - has statx                : yes [2]
    - cxx11_rvalue_references  : yes [2]
    - cxx11_scoped_enums       : yes [2]
    - cxx11_noexcept           : yes [2]
    - cxx11_nullptr            : yes [2]
    - cxx11_defaulted_functions : yes [2]
    - cxx11_defaulted_moves    : yes [2]
    - cxx11_deleted_functions  : yes [2]
    - cxx11_function_template_default_args : yes [2]
    - cxx11_final              : yes [2]
    - cxx11_override           : yes [2]
    - has init_priority attribute : yes [2]
    - has stat::st_blksize     : yes [2]
    - has stat::st_mtim        : yes [2]
    - has stat::st_mtimensec   : no [2]
    - has stat::st_mtimespec   : no [2]
    - has stat::st_birthtim    : no [2]
    - has stat::st_birthtimensec : no [2]
    - has stat::st_birthtimespec : no [2]
    - has fdopendir(O_NOFOLLOW) : yes [2]
    - has dirent::d_type       : yes [2]
    - has POSIX *at APIs       : yes [2]
    - has fallocate            : yes [2]
    - cxx11_auto_declarations  : yes [2]
    - cxx11_constexpr          : yes [2]
    - cxx11_hdr_mutex          : yes [2]
    - cxx11_hdr_tuple          : yes [2]
    - cxx11_lambdas            : yes [2]
    - cxx11_thread_local       : yes [2]
    - has_icu builds           : no [2]
    - zlib                     : yes [2]
    - bzip2                    : no [2]
    - cxx11_basic_alignas      : yes [2]
    - iconv (libc)             : yes [2]
    - cxx11_hdr_functional     : yes [2]
    - cxx11_hdr_type_traits    : yes [2]
    - cxx11_range_based_for    : yes [2]
    - cxx11_smart_ptr          : yes [2]
    - native atomic int32 supported : yes [2]
    - native syslog supported  : yes [2]
    - pthread supports robust mutexes : yes [2]
    - Boost.Regex is header-only : yes [2]
    - lockfree boost::atomic_flag : yes [2]
    - gcc visibility           : yes [2]
    - sfinae_expr              : yes [2]
    - cxx11_unified_initialization_syntax : yes [2]
    - cxx11_hdr_initializer_list : yes [2]
    - cxx11_hdr_chrono         : yes [2]
    - cxx11_numeric_limits     : yes [2]
    - cxx11_hdr_array          : yes [2]
    - cxx11_hdr_atomic         : yes [2]
    - cxx11_allocator          : yes [2]
    - cxx11_explicit_conversion_operators : yes [2]
    - cxx14_decltype_auto      : yes [2]
    - cxx14_generic_lambdas    : yes [2]
    - cxx14_return_type_deduction : yes [2]
    - cxx14_variable_templates : yes [2]
    - long double support      : yes [2]
    - Has Large File Support   : yes [2]
    - Has attribute init_priority : yes [2]
    - std_wstreambuf builds    : yes [2]
    - std_wstreambuf           : yes [2]
    - libbacktrace builds      : yes [2]
    - addr2line builds         : yes [2]
    - WinDbg builds            : no [2]
    - cxx11_rvalue_references  : yes [3]
    - WinDbg builds            : no [3]
    - WinDbgCached builds      : no [2]
    - WinDbgCached builds      : no [3]
    - BOOST_COMP_GNUC >= 4.3.0 : no [2]
    - cxx11_hdr_thread         : yes [2]
    - cxx11_hdr_regex          : yes [2]

[1] clng-10/trgt-os-andrd
[2] clng-lnx-10/rls/abi-apcs/archt-arm/bst.l-lbcnv/bst.l-on/bst.l-off/cxstd-2a-iso/lnk-sttc/nm-on/pythn-3.8/trgt-os-andrd/thrd-mlt/vsblt-hdn
[3] clng-lnx-10/rls/abi-apcs/archt-arm/bst.l-lbcnv/bst.l-on/bst.l-off/bld-no/cxstd-2a-iso/lnk-sttc/nm-on/pythn-3.8/trgt-os-andrd/thrd-mlt/vsblt-hdn

Component configuration:

    - atomic                   : building
    - charconv                 : building
    - chrono                   : building
    - cobalt                   : building
    - container                : building
    - context                  : building
    - contract                 : building
    - coroutine                : building
    - date_time                : building
    - exception                : building
    - fiber                    : building
    - filesystem               : building
    - graph                    : building
    - graph_parallel           : not building
    - headers                  : not building
    - iostreams                : building
    - json                     : building
    - locale                   : building
    - log                      : building
    - math                     : building
    - mpi                      : not building
    - nowide                   : building
    - program_options          : building
    - python                   : not building
    - random                   : building
    - regex                    : building
    - serialization            : building
    - stacktrace               : building
    - system                   : building
    - test                     : building
    - thread                   : building
    - timer                    : building
    - type_erasure             : building
    - url                      : building
    - wave                     : building

libs/context/src/asm/make_arm64_aapcs_elf_gas.S:61:5: error: unknown use of instruction mnemonic without a size suffix
    and x0, x0, ~0xF
    ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:64:17: error: unknown token in expression
    sub x0, x0, #0xb0
                ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:68:16: error: expected ']' in brackets expression
    str x2, [x0, #0xa0]
               ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:72:5: error: invalid instruction mnemonic 'adr'
    adr x1, finish
    ^~~
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:73:16: error: expected ']' in brackets expression
    str x1, [x0, #0x98]
               ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:75:5: error: unknown use of instruction mnemonic without a size suffix
    ret x30
    ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:79:13: error: unknown token in expression
    mov x0, #0
            ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:81:5: error: invalid instruction mnemonic 'bl'
    bl _exit
    ^~
ERRO[1152] error waiting for container: unexpected EOF
    ld: error: undefined symbol: boost::archive::detail::basic_oarchive::save_object(void const*, boost::archive::detail::basic_oserializer const&)
    >>> referenced by oserializer.hpp:260 (/Users/me/.conan2/p/b/boostcfd77fc990e6b/p/include/boost/archive/detail/oserializer.hpp:260)
@cjserio cjserio added the bug Something isn't working label Aug 13, 2024
@neobrain
Copy link

neobrain commented Sep 15, 2024

I also ran into this today. According to the Conan documentation, this should work.

It looks like b2 uses /usr/bin/clang instead of the cross-toolchain. This becomes evident when trying to build boost without native clang installed (which fails early). When explicitly adding the location of the NDK's clang to PATH, it will still produce the error you mentioned (using the correct compiler this time), because clang infers the target architecture from its own filename (defaulting to the host). b2 must call clang via the aarch64-linux-android24-clang symlinks instead.

In summary, my workaround is to add this section to my Conan profile:

[buildenv]
PATH+=(path)<NDK_PATH>/toolchains/llvm/prebuilt/linux-x86_64/bin/
CC=aarch64-linux-android24-clang
CXX=aarch64-linux-android24-clang++

Ideally, Conan should either infer these automatically, or the documentation should be fixed to provide a fully functional Conan profile.

EDIT: I changed PATH= to PATH+=(path) to ensure the NDK binaries path gets appended to PATH rather than replacing it. ((path) is a magic string recognized by Conan to handle this appropriately.)

@uilianries
Copy link
Member

You have to consider there is no B2 generator available in Conan (there is an open PR for that). So, any customization should be listed in the Boost recipe directly. When using android-ndk, those extra variables are configured already, including the compiler: https://github.com/conan-io/conan-center-index/blob/master/recipes/android-ndk/all/conanfile.py#L300

So, in case using android-ndk as tool requirement, Boost will be built nicely for Android. Otherwise, you should configure everything manually in your recipe:

conan create all --version=1.85.0 -pr:b default -pr:h android

boost/1.85.0: Exporting package recipe: /home/uilian/Development/conan/conan-center-index/recipes/boost/all/conanfile.py
boost/1.85.0: exports: File 'conandata.yml' found. Exporting it...
boost/1.85.0: Calling export()
boost/1.85.0: Calling export_sources()
boost/1.85.0: Copied 1 '.py' file: conanfile.py
boost/1.85.0: Copied 2 '.yml' files: conandata.yml, dependencies-1.85.0.yml
boost/1.85.0: Copied 2 '.patch' files: 1.82.0-locale-iconv-library-option.patch, 1.85.0-container-aliasing-violation-fix.patch
boost/1.85.0: Exported to cache folder: /home/uilian/.conan2/p/boosta4755ec112be9/e
boost/1.85.0: Exported: boost/1.85.0#8050df433bd49bb19811ef3e3cf1d0b7 (2024-09-16 07:38:59 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.cppstd=17
compiler.libcxx=c++_static
compiler.version=17
os=Android
os.api_level=32
[tool_requires]
*: cmake/3.29.7, android-ndk/r26d
[conf]
tools.build:verbosity=verbose
tools.cmake.cmaketoolchain:generator=Ninja
tools.compilation:verbosity=verbose
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=yes

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[tool_requires]
*: cmake/3.29.7
[conf]
tools.build:verbosity=verbose
tools.cmake.cmaketoolchain:generator=Ninja
tools.compilation:verbosity=verbose
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=yes


======== Computing dependency graph ========
Graph root
    cli
Requirements
    boost/1.85.0#8050df433bd49bb19811ef3e3cf1d0b7 - Cache
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
    libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
    android-ndk/r26d#0a8a020a2e0ce2edbda6ff226a33a23a - Cache
    b2/5.2.1#91bc73931a0acb655947a81569ed8b80 - Cache
    cmake/3.29.7#cbf5446442af81d8f7e1b6c719e5982b - Cache
Resolved version ranges
    b2/[>=5.2 <6]: b2/5.2.1
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
boost/1.85.0: Forced build from source
Requirements
    boost/1.85.0#8050df433bd49bb19811ef3e3cf1d0b7:59ef2ccd60e2c2ca77db2e2259c6d4944e8a3344 - Build
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:2ff997fe7ebc8a85679750b3fa964fbe19c0d09c#a4dc8ed27fe52539ad497e49aa19ed8d - Cache
    libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1:1fb490abea0c07fe60f9417ffad5cf9f74dde6ec#3b2b4152c3dcb2991e1842fee5a8c527 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:1fb490abea0c07fe60f9417ffad5cf9f74dde6ec#c166df81ec333aac702db77c5d0b9829 - Cache
Build requirements
    android-ndk/r26d#0a8a020a2e0ce2edbda6ff226a33a23a:63fead0844576fc02943e16909f08fcdddd6f44b#b049c823c3ef83c1c734cd5760bd11aa - Cache
    b2/5.2.1#91bc73931a0acb655947a81569ed8b80:63fead0844576fc02943e16909f08fcdddd6f44b#f9c46d924270b1920fa5398114be2576 - Cache
    cmake/3.29.7#cbf5446442af81d8f7e1b6c719e5982b:63fead0844576fc02943e16909f08fcdddd6f44b#a394ed2616f3b9d4c653c510e5838734 - Cache

======== Installing packages ========
cmake/3.29.7: Already installed! (1 of 7)
cmake/3.29.7: Appending PATH environment variable: /home/uilian/.conan2/p/cmake97f6298230c3a/p/bin
cmake/3.29.7: Appending PATH environment variable: /home/uilian/.conan2/p/cmake97f6298230c3a/p/bin
android-ndk/r26d: Already installed! (2 of 7)
b2/5.2.1: Already installed! (3 of 7)
bzip2/1.0.8: Already installed! (4 of 7)
libbacktrace/cci.20210118: Already installed! (5 of 7)
zlib/1.3.1: Already installed! (6 of 7)

-------- Installing package boost/1.85.0 (7 of 7) --------
boost/1.85.0: Building from source
boost/1.85.0: Package boost/1.85.0:59ef2ccd60e2c2ca77db2e2259c6d4944e8a3344
boost/1.85.0: Building your package in /home/uilian/.conan2/p/b/boost4c08af286404b/b
boost/1.85.0: Calling generate()
boost/1.85.0: Generators folder: /home/uilian/.conan2/p/b/boost4c08af286404b/b/build-release/conan
boost/1.85.0: Generating aggregated env files
boost/1.85.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
boost/1.85.0: Calling build()
boost/1.85.0: WARN: replace_in_file didn't find pattern '$(>) > $(<)' in '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/libs/stacktrace/build/Jamfile.v2' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build/src/tools/gcc.jam' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build/src/tools/gcc.jam' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '    <conditional>@numa' in '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/libs/fiber/build/Jamfile.v2' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '! [ $(property-set).get <target-os> ] in windows cygwin darwin aix &&' in '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/boostcpp.jam' file.
boost/1.85.0: WARN: Patching user-config.jam
boost/1.85.0: WARN: 
using zlib : 1.3.1 : <include>"/home/uilian/.conan2/p/b/zlib7206d61cf2803/p/include" <search>"/home/uilian/.conan2/p/b/zlib7206d61cf2803/p/lib" <name>z ;
using bzip2 : 1.0.8 : <include>"/home/uilian/.conan2/p/b/bzip2bbc6d9c15ab1e/p/include" <search>"/home/uilian/.conan2/p/b/bzip2bbc6d9c15ab1e/p/lib" <name>bz2 ;
using "clang-linux" :  :  "/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android32-clang++" : 
<archiver>"/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar" <ranlib>"/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" <compileflags>"--sysroot=/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/sysroot -I/home/uilian/.conan2/p/b/libbad41422dba2b6e/p/include" <linkflags>"--sysroot=/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/sysroot -L/home/uilian/.conan2/p/b/libbad41422dba2b6e/p/lib"  ;
boost/1.85.0: Cross building, detecting compiler...
boost/1.85.0: Cross building flags: []
boost/1.85.0: WARN: b2 -q numa=on target-os=android architecture=arm address-model=64 binary-format=elf abi=aapcs --layout=system --user-config=/home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libc threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=clang-linux cxxstd=17 pch=on -sLIBBACKTRACE_PATH=/home/uilian/.conan2/p/b/libbad41422dba2b6e/p define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1 linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/uilian/.conan2/p/b/boost4c08af286404b/p -j12 --abbreviate-paths -d2 --debug-configuration --build-dir="/home/uilian/.conan2/p/b/boost4c08af286404b/b/build-release"
boost/1.85.0: RUN: b2 -q numa=on target-os=android architecture=arm address-model=64 binary-format=elf abi=aapcs --layout=system --user-config=/home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libc threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=clang-linux cxxstd=17 pch=on -sLIBBACKTRACE_PATH=/home/uilian/.conan2/p/b/libbad41422dba2b6e/p define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1 linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/uilian/.conan2/p/b/boost4c08af286404b/p -j12 --abbreviate-paths -d2 --debug-configuration --build-dir="/home/uilian/.conan2/p/b/boost4c08af286404b/b/build-release"
notice: found boost-build.jam at /home/uilian/.conan2/p/boosta4755ec112be9/s/src/boost-build.jam
notice: loading B2 from /home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build-system.jam
notice: Searching '/etc' '/home/uilian' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/util' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/tools' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/options' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/contrib' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in '/etc' '/home/uilian' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/util' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/tools' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/options' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/contrib' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build' '/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2'.
notice: Loading explicitly specified user configuration file:
    /home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build/user-config.jam
notice: Searching '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from '/home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build'.
notice: [zlib] Using pre-installed library
notice: [zlib] Condition
notice: [bzip2] Using pre-installed library
notice: [bzip2] Condition
notice: will use '/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android32-clang++' for clang-linux, condition <toolset>clang-linux-17
warning: toolset clang-linux initialization: can not find tool windres
warning: initialized from /home/uilian/.conan2/p/boosta4755ec112be9/s/src/tools/build/user-config.jam:6
notice: using rc compiler :: <toolset>clang-linux-17 :: as
notice: [zlib] zlib is already configured
notice: [bzip2] bzip is already configured
notice: iostreams: not using lzma compression 
notice: iostreams: not using zstd compression 
notice: [python-cfg] Configuring python...
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command 'python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg]   interpreter command: "python"
notice: [python-cfg]   include path: "/opt/pyenv/versions/3.12.4/include/python3.12"
notice: [python-cfg]   library path: "/opt/pyenv/versions/3.12.4/lib/python3.12/config" "/opt/pyenv/versions/3.12.4/lib"
notice: [python-cfg] Checking for NumPy...
notice: [python-cfg] running command 'python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
notice: [python-cfg] NumPy enabled
/home/uilian/.conan2/p/boosta4755ec112be9/s/src/libs/test/build/../../predef/check/predef.jam:17: in modules.import from module predef
warning: loading predef
warning: circular module loading dependency:
warning: build-system Jamfile</home/uilian/.conan2/p/boosta4755ec112be9/s/src/libs/test/build> predef ==> predef
/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:1308: in import from module Jamfile</home/uilian/.conan2/p/boosta4755ec112be9/s/src/libs/test/build>
libs/test/build/Jamfile.v2:11: in modules.load from module Jamfile</home/uilian/.conan2/p/boosta4755ec112be9/s/src/libs/test/build>
/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:544: in load-jamfile from module project
/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:68: in load from module project
/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:109: in load-used-projects from module project
/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:79: in load from module project
/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build/project.jam:201: in project.find from module project
/home/uilian/.conan2/p/b20717b8c0763fa/p/bin/.b2/build-system.jam:618: in module scope from module build-system
Performing configuration checks

    - default address-model    : 64-bit [1]

...

clang-linux.compile.c++ /home/uilian/.conan2/p/b/boost4c08af286404b/b/build-release/boost/bin.v2/libs/regex/build/clng-lnx-17/rls/cxstd-17-iso/lnk-sttc/nm-on/trgt-os-andrd/thrd-mlt/vsblt-hdn/regex.o

    "/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android32-clang++"   -std=c++17 -fvisibility-inlines-hidden -O3 -Wall -fvisibility=hidden -Wno-inline -m64 --sysroot=/home/uilian/.conan2/p/androc80020a02a776/p/bin/toolchains/llvm/prebuilt/linux-x86_64/sysroot -I/home/uilian/.conan2/p/b/libbad41422dba2b6e/p/include -fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line -DBOOST_ALL_NO_LIB=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1 -DBOOST_USE_NUMA -DNDEBUG   -I"."  -c -o "/home/uilian/.conan2/p/b/boost4c08af286404b/b/build-release/boost/bin.v2/libs/regex/build/clng-lnx-17/rls/cxstd-17-iso/lnk-sttc/nm-on/trgt-os-andrd/thrd-mlt/vsblt-hdn/regex.o" "libs/regex/build/../src/regex.cpp"

I would not see it as a bug, but a misconfiguration from your environment. Please, add tools.build:compiler_executables to you profile, pointing the expected compiler for Android.

@uilianries uilianries self-assigned this Sep 16, 2024
@uilianries uilianries added question Further information is requested and removed bug Something isn't working labels Sep 16, 2024
@neobrain
Copy link

@uilianries Thanks for the reply!

I would not see it as a bug, but a misconfiguration from your environment. Please, add tools.build:compiler_executables to you profile, pointing the expected compiler for Android.

Makes sense, though this would be a documentation bug then. cjserio and I were just copying the Conan documentation. Any chance a functional profile could be listed on that page?

In fact, mentioning CCI's android-ndk package there would also be useful, though personally I would prefer an example that works with a manually installed NDK. So ideally we'd have both: One example profile that works with manual installs, and a simpler one that uses android-ndk as a tool requirement?

@cjserio
Copy link
Author

cjserio commented Sep 16, 2024

Yes thank you so much! I was just going to comment that the docs make no mention of using the NDK as a tool_requires. I was following the docs and pointing the path to my local NDK path which was really clunky because other developers and our CI/CD runners have it installed in different locations. Changing my profile to:

[settings]
arch=armv8
os=Android
os.api_level=24
compiler=clang
compiler.version=14
compiler.libcxx=c++_static
compiler.cppstd=20

[tool_requires]
android-ndk/r25c

has made this much simpler and of course Boost builds properly now.

@uilianries
Copy link
Member

@cjserio @neobrain Thank you for your feedback! Indeed we discussed about Android examples in the documentation this morning in a meeting. Yes, the documentation can be improved and adding hint about those exceptional cases. Thank you again for giving your thoughts.

@cjserio
Copy link
Author

cjserio commented Sep 20, 2024

@uilianries You said

I would not see it as a bug, but a misconfiguration from your environment. Please, add tools.build:compiler_executables to you profile, pointing the expected compiler for Android.

I didn't notice it until now as I didn't need that to properly compile Boost. All I needed to do was stop hard coding my NDK path and just use the tool_requires with the android-ndk, but now I'm trying to compile freetype/2.13.2 on Android and it's failing because meson is sticking a sys_root path in front of all of my cached conan include paths so nothing's working.

I don't mean to hijack this topic but can you either explain more about this compiler_executables or offer a working and complete example of what an Android profile should look like?

@cjserio
Copy link
Author

cjserio commented Sep 20, 2024

In my attempt to be a good citizen I started a new thread here: #25342

@cjserio cjserio closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants