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

编译android的aar包失败,希望能集成RKNPU2,能否给出更详细的操作步骤 #2482

Open
lemon3853 opened this issue Jun 30, 2024 · 0 comments
Assignees

Comments

@lemon3853
Copy link


温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度


目标

编译集成RKNPU2的android部署环境

环境

  • 【FastDeploy版本】: 说明具体的版本,如fastdeploy-linux-rknpu-develop
  • 【编译命令】如果您是自行编译的FastDeploy,请说明您的编译方式(参数命令)
cmake ..  -DCMAKE_C_COMPILER=/home/lemon/FastDeploy/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
          -DCMAKE_CXX_COMPILER=/home/lemon/FastDeploy/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ \
          -DCMAKE_TOOLCHAIN_FILE=./../cmake/toolchain.cmake \
          -DENABLE_LITE_BACKEND=ON \
          -DTARGET_ABI=arm64 \
          -DENABLE_ORT_BACKEND=OFF \
	      -DENABLE_RKNPU2_BACKEND=ON \
	      -DENABLE_VISION=ON \
	      -DRKNN2_TARGET_SOC=RK356X \
          -DCMAKE_INSTALL_PREFIX=${PWD}/fastdeploy-0.0.0
  • 【系统平台】: Linux x64(Ubuntu 20.04)
  • 【硬件】: 说明具体硬件型号,如 CPU
  • 【编译语言】: C++ / Python(3.7或3.8等)

问题日志及出现问题的操作流程

  • 附上详细的问题日志有助于快速定位分析
  • 【编译缺失依赖】
    同此issue,官方说会更新,但是至今没有解决
    https://github.com/PaddlePaddle/FastDeploy/issues/2215
    https://bj.bcebos.com/fastdeploy/third_libs/lite-linux-arm64-20230316.tgz
  • 【替换成旧版本lite-linux-arm64后,打包aar报错】
  [22/22] Linking CXX shared library C:\Users\lemon\Documents\java\android\fastdeploy\build\intermediates\cxx\Debug\5f16o4i4\obj\arm64-v8a\libfastdeploy_jni.so
  FAILED: C:/Users/lemon/Documents/java/android/fastdeploy/build/intermediates/cxx/Debug/5f16o4i4/obj/arm64-v8a/libfastdeploy_jni.so 
  cmd.exe /C "cd . && C:\Users\lemon\AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --sysroot=C:/Users/lemon/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -Wno-format -ffast-math -Ofast -DNDEBUG -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-unwind-tables -fvisibility=hidden -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -fno-limit-debug-info  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments  -Wl,--gc-sections -Wl,-z,nocopyreloc -shared -Wl,-soname,libfastdeploy_jni.so -o C:\Users\lemon\Documents\java\android\fastdeploy\build\intermediates\cxx\Debug\5f16o4i4\obj\arm64-v8a\libfastdeploy_jni.so CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/bitmap_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/assets_loader_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/runtime_option_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/results_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/visualize_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/pipeline/ppocr_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/pipeline/pipeline_utils_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/detection/picodet_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/detection/detection_utils_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/classification/paddleclas_model_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/classification/classification_utils_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/segmentation/paddleseg_model_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/segmentation/segmentation_utils_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/facedet/scrfd_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/facedet/yolov5face_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/facedet/facedet_utils_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/keypointdetection/pptinypose_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/vision/keypointdetection/keypointdetection_utils_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/text/text_results_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/text/uie/uie_model_jni.cc.o CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/text/uie/uie_utils_jni.cc.o  -ljnigraphics  C:/Users/lemon/Documents/java/android/fastdeploy/libs/fastdeploy-android-latest-shared-dev/lib/arm64-v8a/libfastdeploy.so  C:/Users/lemon/Documents/java/android/fastdeploy/libs/fastdeploy-android-latest-shared-dev/third_libs/install/rknpu2_runtime/lib/librknnrt.so  C:/Users/lemon/Documents/java/android/fastdeploy/libs/fastdeploy-android-latest-shared-dev/third_libs/install/paddlelite/lib/arm64-v8a/libpaddle_full_api_shared.so  C:/Users/lemon/Documents/java/android/fastdeploy/libs/fastdeploy-android-latest-shared-dev/third_libs/install/opencv/sdk/native/libs/arm64-v8a/libopencv_java4.so  C:/Users/lemon/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so  -lGLESv2  -lEGL  C:/Users/lemon/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so  -lGLESv2  -lEGL  -latomic -lm && cd ."
  ld: error: undefined symbol: fastdeploy::RuntimeOption::SetLiteOptimizedModelDir(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)
  >>> referenced by runtime_option_jni.cc
  >>>               CMakeFiles/fastdeploy_jni.dir/fastdeploy_jni/runtime_option_jni.cc.o:(fastdeploy::jni::NewCxxRuntimeOption(_JNIEnv*, _jobject*))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants