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] build error: unknown type name 'bfloat16_t'; did you mean 'float16_t' #21538

Closed
h122skite opened this issue Jul 29, 2024 · 2 comments
Closed
Labels
platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@h122skite
Copy link

h122skite commented Jul 29, 2024

Describe the issue

Building onnx from souce code under Windows for Android.
I use MINGW(GIT BASH) in Windows
build commnd :./build.bat --android --android_sdk_path 'C:\Users\Jayho\AppData\Local\Android\Sdk' --android_ndk_path 'C:\Users\Jayho\AppData\Local\Android\Sdk\ndk\27.0.12077973' --android_abi arm64-v8a --android_api 27 --cmake_generator Ninja

-- ******** Summary ********
--   CMake version                     : 3.30.1
--   CMake command                     : C:/Users/Jayho/AppData/Local/Programs/Python/Python312/Lib/site-packages/cmake/data/bin/cmake.exe
--   System                            : Android
--   C++ compiler                      : C:/Users/Jayho/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
--   C++ compiler version              : 12.0.8
--   CXX flags                         : -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -ffunction-sections -fdata-sections -DCPUINFO_SUPPORTED -Wnon-virtual-dtor
--   Build type                        : Debug
--   Compile definitions               : ORT_ENABLE_STREAM;EIGEN_MPL2_ONLY;__STDC_FORMAT_MACROS
--   CMAKE_PREFIX_PATH                 : C:\Users\Jayho\source\onnxruntime\onnxruntime\\build\Windows/Debug/installed
--   CMAKE_INSTALL_PREFIX              : C:/Program Files (x86)/onnxruntime
--   CMAKE_MODULE_PATH                 : C:/Users/Jayho/source/onnxruntime/onnxruntime/cmake/external
--
--   ONNX version                      : 1.16.1
--   ONNX NAMESPACE                    : onnx
--   ONNX_USE_LITE_PROTO               : ON
--   USE_PROTOBUF_SHARED_LIBS          : OFF
--   Protobuf_USE_STATIC_LIBS          : ON
--   ONNX_DISABLE_EXCEPTIONS           : OFF
--   ONNX_DISABLE_STATIC_REGISTRATION  : OFF
--   ONNX_WERROR                       : OFF
--   ONNX_BUILD_TESTS                  : OFF
--   ONNX_BUILD_BENCHMARKS             : OFF
--   ONNX_BUILD_SHARED_LIBS            :
--   BUILD_SHARED_LIBS                 : OFF
--
--   Protobuf compiler                 :
--   Protobuf includes                 :
--   Protobuf libraries                :
--   BUILD_ONNX_PYTHON                 : OFF

I've already check the answer(#20099) and try bNDK 27 but it doesn't work.

To reproduce

Follow the instructions of https://onnxruntime.ai/docs/build/android.html.

Urgency

No response

Platform

Android

OS Version

Android NDK27 API 27

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

No response

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

1.16.1

ONNX Runtime API

C++/C

Architecture

X64

Execution Provider

NNAPI

Execution Provider Library Version

No response

@h122skite h122skite added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Jul 29, 2024
@github-actions github-actions bot added the platform:windows issues related to the Windows platform label Jul 29, 2024
@skottmckay
Copy link
Contributor

skottmckay commented Jul 29, 2024

I can build on Windows and Linux (WSL) without a problem.

This line would indicate you're not building with NDK 26+

-- C++ compiler : C:/Users/Jayho/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe

@skottmckay skottmckay removed the platform:windows issues related to the Windows platform label Jul 29, 2024
@h122skite
Copy link
Author

I can build on Windows and Linux (WSL) without a problem.

This line would indicate you're not building with NDK 26+

-- C++ compiler : C:/Users/Jayho/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe

Oops, I found that I hardcoded the NDK path in some scripts so that it resulted in preventting the build command from overwriting it. This issue was gone after I remove the hardcode snippet.

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

No branches or pull requests

2 participants