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] passing --arm64 to ci_build/build.py has error in arm64 host #20814

Open
aungthetnaing opened this issue May 24, 2024 · 3 comments
Open
Labels
build build issues; typically submitted using template platform:windows issues related to the Windows platform

Comments

@aungthetnaing
Copy link
Contributor

Describe the issue

--arm64 should not mean that there is cross-compilation. --arm64 flag should work in both arm64 and x64 hosts.

After this PR 8d09baf

--arm64 flag in arm64 host will fail with the following error-check.

CMAKE_HOST_SYSTEM_NAME: Windows CMake Error at external/onnxruntime_external_deps.cmake:189 (message): ONNX_CUSTOM_PROTOC_EXECUTABLE must be set to cross-compile. Call Stack (most recent call first): CMakeLists.txt:586 (include)

Urgency

No response

Target platform

arm64

Build script

build.bat --build_shared_lib --config Release --parallel --skip_submodule_sync --skip_tests --use_binskim_compliant_compile_flags --msvc_toolset v143 --arm64 --enable_msvc_static_runtime --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF "CMAKE_C_FLAGS=/Qspectre /guard:cf /Zi" "CMAKE_CXX_FLAGS=/Qspectre /guard:cf /Zi" "CMAKE_SHARED_LINKER_FLAGS=/guard:cf /DYNAMICBASE /DEBUG" "CMAKE_EXE_LINKER_FLAGS=/guard:cf /DYNAMICBASE /DEBUG"

Error / output

CMAKE_HOST_SYSTEM_NAME: Windows
CMake Error at external/onnxruntime_external_deps.cmake:189 (message):
ONNX_CUSTOM_PROTOC_EXECUTABLE must be set to cross-compile.
Call Stack (most recent call first):
CMakeLists.txt:586 (include)

Visual Studio Version

VS2022

GCC / Compiler Version

No response

@aungthetnaing aungthetnaing added the build build issues; typically submitted using template label May 24, 2024
@github-actions github-actions bot added the platform:windows issues related to the Windows platform label May 24, 2024
@snnn
Copy link
Member

snnn commented May 26, 2024

Please download protobuf 3.21.12 from https://www.nuget.org/packages/Google.Protobuf, unzip the package, then set ONNX_CUSTOM_PROTOC_EXECUTABLE to the path of the x64 version of protoc.exe. Put ONNX_CUSTOM_PROTOC_EXECUTABLE
in cmake_extra_defines .

@aungthetnaing
Copy link
Contributor Author

Please download protobuf 3.21.12 from https://www.nuget.org/packages/Google.Protobuf, unzip the package, then set ONNX_CUSTOM_PROTOC_EXECUTABLE to the path of the x64 version of protoc.exe. Put ONNX_CUSTOM_PROTOC_EXECUTABLE in cmake_extra_defines .

This step is not required for --arm64 flag run in host x64. So, I believe we should fix it in a way that --arm64 flag will behave the same in both x64 and arm64 host.

@skottmckay
Copy link
Contributor

Platform flags like --arm64 or --x86 are intended for cross compiling. If you're not cross-compiling, simply don't add the --arm64 flag.

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:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants