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

[Mobile] after build and install miss some file #22531

Open
WangHHY19931001 opened this issue Oct 22, 2024 · 5 comments
Open

[Mobile] after build and install miss some file #22531

WangHHY19931001 opened this issue Oct 22, 2024 · 5 comments
Labels
contributions welcome external contributions welcome feature request request for unsupported feature or enhancement platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@WangHHY19931001
Copy link

Describe the issue

after build and install miss "nnapi_provider_factory.h"

env:
os:
Windows 10 pro
version 22H2
os version: 19045.5011
Windows Feature Experience Pack 1000.19060.1000.0

android studio:
Android Studio Ladybug | 2024.2.1 Patch 1
Build #AI-242.23339.11.2421.12483815, built on October 11, 2024
Runtime version: 21.0.3+-12282718-b509.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 12
Registry:
ide.instant.shutdown=false
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
com.jetbrains.plugins.ini4idea (242.23339.18)
com.developerphil.adbidea (1.6.18)
com.github.tuchg.nonasciicodecompletionhelper (1.0.1)

android sdk path:
C:\Users\dell\AppData\Local\Android\Sdk

installed sdk platforms:
Android 15.0 api:35 revision:1
Android 14.0 api:34 revision:3
Android 10.0 api:29 revision:5
Android 8.1 api:27 revision:3

android ndk path:
C:\Users\dell\AppData\Local\Android\Sdk\ndk\27.2.12479018

To reproduce

git clone this project and checkout v1.19.2, use cmd to build:

.\build.bat --config Release --android --skip_tests --android_sdk_path "C:\Users\dell\AppData\Local\Android\Sdk" --android_ndk_path "C:\Users\dell\AppData\Local\Android\Sdk\ndk\27.2.12479018" --android_abi arm64-v8a --android_api 29 --cmake_generator Ninja --use_nnapi

and into build/Windows/Release use cmd to install:

cmake --install .

into "C:\Program Files (x86)\onnxruntime\include\onnxruntime" cant't fund "nnapi_provider_factory.h" only see "cpu_provider_factory.h", and into "C:\Program Files (x86)\onnxruntime\lib" fund "libonnxruntime_providers_nnapi.a"

Urgency

No response

Platform

Android

OS Version

windows

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

1.19.2

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

ffceed9

ONNX Runtime API

C++/C

Architecture

ARM64

Execution Provider

NNAPI

Execution Provider Library Version

No response

@WangHHY19931001 WangHHY19931001 added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Oct 22, 2024
@snnn snnn added the feature request request for unsupported feature or enhancement label Oct 22, 2024
@snnn
Copy link
Member

snnn commented Oct 22, 2024

In https://github.com/microsoft/onnxruntime/blob/main/cmake/onnxruntime_providers_nnapi.cmake , we need something like:

install(FILES ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/cpu/cpu_provider_factory.h  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/)

See: https://github.com/microsoft/onnxruntime/blob/main/cmake/onnxruntime_providers_cpu.cmake#L211

@snnn snnn added the contributions welcome external contributions welcome label Oct 22, 2024
@skottmckay
Copy link
Contributor

If you're building for Android it would be more typical to build an AAR and use that in an Android app than to use cmake --install.

https://onnxruntime.ai/docs/build/custom.html#android

If you don't want to build an AAR that the header can simply be copied from https://github.com/microsoft/onnxruntime/tree/main/include/onnxruntime/core/providers/nnapi to wherever you need it.

@WangHHY19931001
Copy link
Author

If you're building for Android it would be more typical to build an AAR and use that in an Android app than to use cmake --install.

https://onnxruntime.ai/docs/build/custom.html#android

If you don't want to build an AAR that the header can simply be copied from https://github.com/microsoft/onnxruntime/tree/main/include/onnxruntime/core/providers/nnapi to wherever you need it.

i want build native only lib, but it not work, see lib/pc need a lib which been named "libonnxruntime.a", but not have, need some help

@skottmckay
Copy link
Contributor

All the individual static libraries required are copied to the lib directory. You should be able to link against those. We don't explicitly create a libonnxruntime.a that combines them.

@WangHHY19931001
Copy link
Author

All the individual static libraries required are copied to the lib directory. You should be able to link against those. We don't explicitly create a libonnxruntime.a that combines them.

copy all static lib and libc libm link success, but not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome external contributions welcome feature request request for unsupported feature or enhancement platform:mobile issues related to ONNX Runtime mobile; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants