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

[Build] Android build issue on windows #21754

Closed
soham24 opened this issue Aug 15, 2024 · 2 comments
Closed

[Build] Android build issue on windows #21754

soham24 opened this issue Aug 15, 2024 · 2 comments
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform

Comments

@soham24
Copy link

soham24 commented Aug 15, 2024

Issue Description

I am trying to build ONNX with training enabled for Android on my Windows system using the following command:

./build.bat --android --android_sdk_path C:/myfiles/cvdl/onnx_local/onnxruntime/Android --android_ndk_path C:/Users/Soham/AppData/Local/Android/Sdk/ndk/26.0.10792818 --android_abi arm64-v8a --android_api 29 --enable_training_apis --enable_training --enable_lto --build_shared_lib --build_java --use_xnnpack --skip_tests --config RelWithDebInfo --cmake_generator Ninja

I have the necessary C++ packages installed via Visual Studio Installer. However, I am encountering an error during the build process. The error appears to be related to the Pybind11 build, even though I am targeting Android. I am unsure why Pybind11 is being built as part of this process. Am I missing something?

Urgency

Target Platform

Android

Build Script

./build.bat --android --android_sdk_path C:/myfiles/cvdl/onnx_local/onnxruntime/Android --android_ndk_path C:/Users/Soham/AppData/Local/Android/Sdk/ndk/26.0.10792818 --android_abi arm64-v8a --android_api 29 --enable_training_apis --enable_training --enable_lto --build_shared_lib --build_java --use_xnnpack --skip_tests --config RelWithDebInfo --cmake_generator Ninja

Error Output

In file included from C:/myfiles/cvdl/onnx_local/onnxruntime/build/Windows/RelWithDebInfo/_deps/pybind11_project-src/include/pybind11/detail/../attr.h:13:
In file included from C:/myfiles/cvdl/onnx_local/onnxruntime/build/Windows/RelWithDebInfo/_deps/pybind11_project-src/include/pybind11/detail/common.h:208:
In file included from C:/Users/Soham/AppData/Local/Programs/Python/Python312/Include/Python.h:12:
C:/Users/Soham/AppData/Local/Programs/Python/Python312/Include/pyconfig.h:59:10: fatal error: 'io.h' file not found
#include <io.h>

Visual Studio Version

2022

@soham24 soham24 added the build build issues; typically submitted using template label Aug 15, 2024
@github-actions github-actions bot added platform:windows issues related to the Windows platform platform:mobile issues related to ONNX Runtime mobile; typically submitted using template labels Aug 15, 2024
@edgchen1
Copy link
Contributor

--enable_training implies --enable_pybind.

if args.build_wheel or args.gen_doc or args.use_tvm or args.enable_training:
args.enable_pybind = True

Try only using --enable_training_apis. See https://onnxruntime.ai/docs/get-started/training-on-device.html for more information about on-device training.

@soham24
Copy link
Author

soham24 commented Aug 17, 2024

@edgchen1 thank you so much. it worked

@soham24 soham24 closed this as completed Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

2 participants