Paddle-Lite 编译android 执行命令:./lite/tools/build_android.sh 报错

hof1towb  于 2022-10-22  发布在  Android
关注(0)|答案(3)|浏览(212)

索引区更新了 42 个路径
-- Found Paddle host system: macosx, version: 12.6
-- Found Paddle host system's CPU: 4 cores
-- CMAKE_CXX_FLAGS: -flto
-- CMAKE_CXX_FLAGS_RELEASE:
-- Found host C compiler: /usr/bin/gcc
-- Found host CXX compiler: /usr/bin/g++
-- Lite ARM Compile android with armv8 gcc
-- Enabling ARC support by default. ENABLE_ARC not provided!
-- Enabling ARC support.
-- Android: Targeting API '21' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64'
-- Android: Selected GCC toolchain 'aarch64-linux-android-4.9'
-- The CXX compiler identification is GNU 4.9.0
-- The C compiler identification is GNU 4.9.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /Users/cvte/Library/android-ndk-r17c/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++
-- Check for working CXX compiler: /Users/cvte/Library/android-ndk-r17c/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ - broken
CMake Error at /usr/local/Cellar/cmake/3.21.4/share/cmake/Modules/CMakeTestCXXCompiler.cmake:62 (message):
The C++ compiler

"/Users/cvte/Library/android-ndk-r17c/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /Users/cvte/Desktop/Paddle-Lite/build.lite.android.armv8.gcc/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_b5557/fast && /usr/local/bin/gmake  -f CMakeFiles/cmTC_b5557.dir/build.make CMakeFiles/cmTC_b5557.dir/build
gmake[1]: Entering directory '/Users/cvte/Desktop/Paddle-Lite/build.lite.android.armv8.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_b5557.dir/testCXXCompiler.cxx.o
/Users/cvte/Library/android-ndk-r17c/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ --sysroot=/Users/cvte/Library/android-ndk-r17c/sysroot  -isystem /Users/cvte/Library/android-ndk-r17c/sources/cxx-stl/llvm-libc++/include -isystem /Users/cvte/Library/android-ndk-r17c/sources/android/support/include -isystem /Users/cvte/Library/android-ndk-r17c/sources/cxx-stl/llvm-libc++abi/include -isystem /Users/cvte/Library/android-ndk-r17c/sysroot/usr/include -isystem /Users/cvte/Library/android-ndk-r17c/sysroot/usr/include/aarch64-linux-android -fobjc-arc  -flto  -O2 -g -DNDEBUG -fPIE -o CMakeFiles/cmTC_b5557.dir/testCXXCompiler.cxx.o -c /Users/cvte/Desktop/Paddle-Lite/build.lite.android.armv8.gcc/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
aarch64-linux-android-g++: error: unrecognized command line option '-fobjc-arc'
gmake[1]:***[CMakeFiles/cmTC_b5557.dir/build.make:78: CMakeFiles/cmTC_b5557.dir/testCXXCompiler.cxx.o] Error 1
gmake[1]: Leaving directory '/Users/cvte/Desktop/Paddle-Lite/build.lite.android.armv8.gcc/CMakeFiles/CMakeTmp'
gmake:***[Makefile:127: cmTC_b5557/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:35 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/cvte/Desktop/Paddle-Lite/build.lite.android.armv8.gcc/CMakeFiles/CMakeOutput.log".
See also "/Users/cvte/Desktop/Paddle-Lite/build.lite.android.armv8.gcc/CMakeFiles/CMakeError.log".

2nbm6dog

2nbm6dog1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看 官网文档常见问题历史Issue 来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQ and Github Issue to get the answer.Have a nice day!

hmae6n7t

hmae6n7t2#

cmake 的版本是 3.21.4

nmpmafwu

nmpmafwu3#

首先建议使用我们的预编译库 https://www.paddlepaddle.org.cn/lite/v2.11/quick_start/release_lib.html

  1. 如果有编译的需求,为了保持统一的编译环境,建议 macOS 和 Ubuntu 的用户使用我们提供的 paddle lite docker 环境 : https://www.paddlepaddle.org.cn/lite/v2.11/source_compile/docker_env.html

  1. 如果确实希望裸机编译,建议参考我们提供的手顺,配置好相应的软件环境,例如在 macOS 上编译 Android 库:
    https://www.paddlepaddle.org.cn/lite/v2.11/source_compile/macos_compile_android.html

相关问题