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

在win11中部署Android过程中,执行build.sh遇到问题 #382

Open
ZhangJiaLei123 opened this issue Sep 6, 2024 · 1 comment
Open
Assignees

Comments

@ZhangJiaLei123
Copy link

描述问题

复现

  1. android部署方式

未修改任何代码
按照仓库readme方式部署,使用git bash执行:

 # 1. 下载需要的 Paddle Lite 预测库
 cd PaddleX-Lite-Deploy/libs
 sh download.sh

 # 2. 下载 paddle_lite_opt 工具优化后的模型文件
 cd ../ocr/assets
 sh download.sh PP-OCRv4_mobile

 # 3. 完成可执行文件的编译
 cd ../android/shell/ppocr_demo
 sh build.sh

# 4. 预测
 sh run.sh PP-OCRv4_mobile

  1. 问题

在执行到第三步build.sh,遇到问题,执行 build后, src/build/ppocr_demo 没有生成
以下是运行日志:

$ ./build.sh
NDK_ROOT is D:/soft/Android/develop/sdk/ndk/27.0.11902837
ARM_TARGET_LANG is clang
ARM_ABI is arm64-v8a
PADDLE_LITE_DIR is /d/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/../../../../../libs/android/cxx
OPENCV_LITE_DIR is /d/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/../../../../../libs/android/opencv4.1.0
make: *** No rule to make target 'clean'.  Stop.
-- Building for: Visual Studio 17 2022
-- The C compiler identification is MSVC 19.41.34120.0
-- The CXX compiler identification is MSVC 19.41.34120.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - 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: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- TARGET ARM LANG: clang
-- TARGET ARCH ABI: arm64-v8a
-- PADDLE LITE DIR: D:/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/../../../../../libs/android/cxx
-- PADDLE LITE DIR: D:/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/../../../../../libs/android/opencv4.1.0
-- PADDLELITE_LIBS is D:/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/../../../../../libs/android/cxx/libs/arm64-v8a/libpaddle_light_api_shared.so;D:/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/../../../../../libs/android/cxx/libs/arm64-v8a/libc++_shared.so
-- OPENCV_PATH: D:/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/../../../../../libs/android/opencv4.1.0/arm64-v8a
-- Configuring done (6.9s)
-- Generating done (0.0s)
-- Build files have been written to: D:/Zhang/Documents/workspace/workAndroid/OCR/PaddleX_Lite_Deploy/ocr/android/shell/ppocr_demo/src/build
make: *** No targets specified and no makefile found.  Stop.
make successful!
cp: cannot stat './src/build/ppocr_demo': No such file or directory
copy successful!


环境

系统: win11

  • cmake 版本
    image

  • make版本
    image

@hong19860320
Copy link
Collaborator

image
从错误上看,你用了 visual studio 来编译 android shell 代码,原因可能是你没有修改 build.sh 中 ndk 的路径。你首先应该需要下载指定版本的 android ndk(我们推荐 ndk-17c),然后在 build.sh 指定 ndk 的路径。
image
image

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