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] grpc/1.54.3: Unable to cross-compile with Android NDK #24434

Open
bigcat26 opened this issue Jun 25, 2024 · 1 comment
Open

[package] grpc/1.54.3: Unable to cross-compile with Android NDK #24434

bigcat26 opened this issue Jun 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bigcat26
Copy link
Contributor

Description

An error was reported during the running of the cmake configuration of abseil, which is the dependent library of grpc:

CMake Error at cmake/abseil-cpp.cmake:38 (find_package):
  Could not find a package configuration file provided by "absl" with any of
  the following names:

    abslConfig.cmake
    absl-config.cmake

  Add the installation prefix of "absl" to CMAKE_PREFIX_PATH or set
  "absl_DIR" to a directory containing one of the above files.  If "absl"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:321 (include)

My conanfile is as follows:

[requires]
grpc/1.54.3
gtest/1.14.0
spdlog/1.14.1
[options]
spdlog/*:header_only=True
grpc/*:with_libsystemd=False
[generators]
CMakeDeps

Package and Environment Details

  • Package Name/Version: grpc/1.54.3
  • Operating System+version: Linux Ubuntu 22.04
  • Compiler+version: GCC 12.3.0
  • Conan version: conan 2.4.1
  • Python version: Python 3.11

Conan profile

Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux

Build profile:
[settings]
arch=armv7
build_type=Release
compiler=clang
compiler.libcxx=c++_static
compiler.version=11
os=Android
os.api_level=24
[conf]
tools.android:ndk_path=/home/chris.xiong/work/android/ndk-bundle/

Steps to reproduce

conan install -pr:h default -pr:b android-armv7.profile --build missing -of . ..

Logs

Click to expand log


======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux

Profile build:
[settings]
arch=armv7
build_type=Release
compiler=clang
compiler.libcxx=c++_static
compiler.version=11
os=Android
os.api_level=24
[conf]
tools.android:ndk_path=/home/user/work/android/ndk-bundle/


======== Computing dependency graph ========
Graph root
    conanfile.txt: /home/user/work/authorization_sec/conanfile.txt
Requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02 - Cache
    c-ares/1.19.1#02ac853d7b96c7e631cc12bb373e6b42 - Cache
    fmt/10.2.1#9199a7a0611866dea5c8849a77467b25 - Cache
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68 - Cache
    gtest/1.14.0#25e2a474b4d1aecf5ff4f0555dcdf72c - Cache
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15 - Cache
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73 - Cache
    re2/20230301#e8d673155a0494f27c7589b611e8350d - Cache
    spdlog/1.14.1#972bbf70be1da4bc57ea589af0efde03 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02 - Cache
    c-ares/1.19.1#02ac853d7b96c7e631cc12bb373e6b42 - Cache
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68 - Cache
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15 - Cache
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73 - Cache
    re2/20230301#e8d673155a0494f27c7589b611e8350d - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Resolved version ranges
    openssl/[>=1.1 <4]: openssl/3.2.2
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
grpc/1.54.3: Compatible package ID 6bf3cf3e2380bfca17160b722acc9ee12a3e713e equal to the default package ID: Skipping it.
grpc/1.54.3: Checking 7 compatible configurations
grpc/1.54.3: Compatible configurations not found in cache, checking servers
grpc/1.54.3: '1bda22e3fec1d4d5407b695ebe7c1bfc06e6b7b1': compiler.cppstd=14
grpc/1.54.3: 'cfd0f2eb00fc3288f6535ca9a1b55d885cd6da16': compiler.cppstd=gnu14
grpc/1.54.3: 'ac9be1eb826ccd6c9c51fad5d65e4d1795cbfe17': compiler.cppstd=17
grpc/1.54.3: '16abf552fd9e6402d8ee4ceb6c6f4b071c276c86': compiler.cppstd=20
grpc/1.54.3: '114307396200f814133472ca67a66d1194cfa473': compiler.cppstd=gnu20
grpc/1.54.3: '77bc19c7ca69f7b410e9244a955ab00d5df2f6b5': compiler.cppstd=23
grpc/1.54.3: '8e392ba9457d4fc5d239d7dfb6554fbdd51acecd': compiler.cppstd=gnu23
Requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02:2b3e00e93be912c4468bf5911338440f07c9b5ac#fdb736b16f7cef88bbad16d343ceca27 - Cache
    c-ares/1.19.1#02ac853d7b96c7e631cc12bb373e6b42:63fdbe5443a9be173d5771f9041347e63033dec7#e65f6b05a115b48b266ae052ee8bc5b2 - Cache
    fmt/10.2.1#9199a7a0611866dea5c8849a77467b25:a46a98f6e5bb3cc9fff722120feb850d21c3900a#39b7e5750aadcf0255a1ffba3418ebdb - Cache
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68:6bf3cf3e2380bfca17160b722acc9ee12a3e713e - Build
    gtest/1.14.0#25e2a474b4d1aecf5ff4f0555dcdf72c:6abc5cf15a93a0fe69ba9f89fd240c425083b2a7#9d4f079820ebf244389ff17040135d21 - Cache
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15:8746ea94abdfaf80332aeb6488af844e4907dbcc#6ce5990f09b675251a86f36a5c0700ff - Cache
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73:c6003ba219fb37f652e88cff8e1ddd2d147f9e81#a952cb43a2eebde4ff23a58e085b0cf3 - Cache
    re2/20230301#e8d673155a0494f27c7589b611e8350d:b1415d43005026cf55e47e02433ad49deeb60727#345e109f5730d493a8f466f7ec8f8aaf - Cache
    spdlog/1.14.1#972bbf70be1da4bc57ea589af0efde03:da39a3ee5e6b4b0d3255bfef95601890afd80709#536fa07c5ff18232a266f2954c0dfb20 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:5bc851010eb7b707e5cb2e24cb8ccf0f27989fa9#dc2a8074b76026d7b5841564d286d406 - Cache
Build requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02:c94fa571dc8acf60ef0b639d152b9c0bc554076d#c08583de075b09eff39d3b7195693b5a - Cache
    c-ares/1.19.1#02ac853d7b96c7e631cc12bb373e6b42:ec9c64d28bdbd810fd4a348263b5b44240dc259a#0b45de8ce0ea2ac55377c26a3f531054 - Cache
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68:cf51fd2c082f2f14fe4f472f55233c6d67f904e6 - Build
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15:a25a47a62cf429587aead541f4feebfc1269e5cc#3b26ebabcd15c46bb2ea51055b07dd1b - Cache
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73:8a5779cfc569434b5a204ef96d69b3fd84dd241b#168e163deee5cf975c67470786a66906 - Cache
    re2/20230301#e8d673155a0494f27c7589b611e8350d:247782c9be0ede440deb822657e63497b092dcec#f525ae800b6a9b749884c44186cf8aef - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:4252b6b89806e71ecac31d7f45ebe051aca93657#fac86950eb6044ea2cffae4e4effbe9a - Cache

======== Installing packages ========
abseil/20230125.3: Already installed! (1 of 17)
abseil/20230125.3: Already installed! (2 of 17)
c-ares/1.19.1: Already installed! (3 of 17)
c-ares/1.19.1: Already installed! (4 of 17)
fmt/10.2.1: Already installed! (5 of 17)
gtest/1.14.0: Already installed! (6 of 17)
re2/20230301: Already installed! (7 of 17)
re2/20230301: Already installed! (8 of 17)
zlib/1.3.1: Already installed! (9 of 17)
zlib/1.3.1: Already installed! (10 of 17)
openssl/3.2.2: Already installed! (11 of 17)
openssl/3.2.2: Already installed! (12 of 17)
protobuf/3.21.12: Already installed! (13 of 17)
protobuf/3.21.12: Already installed! (14 of 17)
spdlog/1.14.1: Already installed! (15 of 17)

-------- Installing package grpc/1.54.3 (16 of 17) --------
grpc/1.54.3: Building from source
grpc/1.54.3: Package grpc/1.54.3:cf51fd2c082f2f14fe4f472f55233c6d67f904e6
grpc/1.54.3: Copying sources to build folder
grpc/1.54.3: Building your package in /home/user/.conan2/p/b/grpc22f9f6634b2d9/b
grpc/1.54.3: Calling generate()
grpc/1.54.3: Generators folder: /home/user/.conan2/p/b/grpc22f9f6634b2d9/b/build/Release/generators
grpc/1.54.3: CMakeToolchain generated: conan_toolchain.cmake
grpc/1.54.3: CMakeToolchain generated: /home/user/.conan2/p/b/grpc22f9f6634b2d9/b/build/Release/generators/CMakePresets.json
grpc/1.54.3: CMakeToolchain generated: /home/user/.conan2/p/b/grpc22f9f6634b2d9/b/src/CMakeUserPresets.json
grpc/1.54.3: Generating aggregated env files
grpc/1.54.3: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
grpc/1.54.3: Calling build()
grpc/1.54.3: Apply patch (backport): patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch
grpc/1.54.3: Running CMake.configure()
grpc/1.54.3: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/user/.conan2/p/b/grpc22f9f6634b2d9/p" -DCMAKE_PROJECT_grpc_INCLUDE="/home/user/.conan2/p/b/grpc22f9f6634b2d9/b/src/conan_cmake_project_include.cmake" -DgRPC_BUILD_CODEGEN="ON" -DgRPC_BUILD_CSHARP_EXT="OFF" -DgRPC_BUILD_TESTS="OFF" -DgRPC_INSTALL="ON" -DgRPC_INSTALL_SHAREDIR="res/grpc" -DgRPC_ZLIB_PROVIDER="package" -DgRPC_CARES_PROVIDER="package" -DgRPC_RE2_PROVIDER="package" -DgRPC_SSL_PROVIDER="package" -DgRPC_PROTOBUF_PROVIDER="package" -DgRPC_ABSL_PROVIDER="package" -DgRPC_BUILD_GRPC_CPP_PLUGIN="ON" -DgRPC_BUILD_GRPC_CSHARP_PLUGIN="ON" -DgRPC_BUILD_GRPC_NODE_PLUGIN="ON" -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN="ON" -DgRPC_BUILD_GRPC_PHP_PLUGIN="ON" -DgRPC_BUILD_GRPC_PYTHON_PLUGIN="ON" -DgRPC_BUILD_GRPC_RUBY_PLUGIN="ON" -DCMAKE_CXX_STANDARD="14" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/user/.conan2/p/b/grpc22f9f6634b2d9/b/src"
-- Using Conan toolchain: /home/user/.conan2/p/b/grpc22f9f6634b2d9/b/build/Release/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The C compiler identification is Clang 11.0.5
-- The CXX compiler identification is Clang 11.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/user/work/android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/user/work/android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
CMake Error at cmake/abseil-cpp.cmake:38 (find_package):
  Could not find a package configuration file provided by "absl" with any of
  the following names:

    abslConfig.cmake
    absl-config.cmake

  Add the installation prefix of "absl" to CMAKE_PREFIX_PATH or set
  "absl_DIR" to a directory containing one of the above files.  If "absl"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:321 (include)


-- Configuring incomplete, errors occurred!

grpc/1.54.3: ERROR: 
Package 'cf51fd2c082f2f14fe4f472f55233c6d67f904e6' build failed
grpc/1.54.3: WARN: Build folder /home/user/.conan2/p/b/grpc22f9f6634b2d9/b/build/Release
ERROR: grpc/1.54.3: Error in build() method, line 221
        cmake.configure()
        ConanException: Error 1 while executing
@bigcat26 bigcat26 added the bug Something isn't working label Jun 25, 2024
@bigcat26
Copy link
Contributor Author

It appears that the CMAKE_FIND_ROOT_PATH_MODE_PACKAGE must be set to BOTH during the execution of the cmake configure process. But I don't know how to inject the argument without modifying the recipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant