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] Multiple commands produce "..." #22245

Closed
cyanic-selkie opened this issue Sep 27, 2024 · 7 comments · Fixed by #22379
Closed

[Build] Multiple commands produce "..." #22245

cyanic-selkie opened this issue Sep 27, 2024 · 7 comments · Fixed by #22379
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@cyanic-selkie
Copy link

cyanic-selkie commented Sep 27, 2024

Describe the issue

I am simply trying to build the onnxruntime for iOS/simulator on my MacOS. The build works perfectly fine when building for the host, however, when cross compiling for the iOS/simulator, I get the error below.

Urgency

Relatively urgent as we are soon due to release our app. However, I would image not being able to build for a major platform makes it urgent regardless.

Target platform

iphoneos/iphonesimulator

Build script

./build.sh --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync --use_xcode --ios --apple_sysroot <iphoneos|iphonesimulator> --osx_arch arm64 --apple_deploy_target 17 --update --build

Error / output

...

error: Multiple commands produce '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_customopregistration_test.app/PlugIns'
note: CreateBuildDirectory /path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_customopregistration_test.app/PlugIns
note: Target 'onnxruntime_customopregistration_test' (project 'onnxruntime') has create directory command with output '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_customopregistration_test.app/PlugIns'
error: Multiple commands produce '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_logging_apis_test.app/PlugIns'
note: CreateBuildDirectory /path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_logging_apis_test.app/PlugIns
note: Target 'onnxruntime_logging_apis_test' (project 'onnxruntime') has create directory command with output '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_logging_apis_test.app/PlugIns'
error: Multiple commands produce '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_shared_lib_test.app/PlugIns'
note: CreateBuildDirectory /path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_shared_lib_test.app/PlugIns
note: Target 'onnxruntime_shared_lib_test' (project 'onnxruntime') has create directory command with output '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_shared_lib_test.app/PlugIns'
error: Multiple commands produce '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_test_all.app/PlugIns'
note: CreateBuildDirectory /path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_test_all.app/PlugIns
note: Target 'onnxruntime_test_all' (project 'onnxruntime') has create directory command with output '/path/to/onnxruntime/build/iOS/Release/Release-iphoneos/onnxruntime_test_all.app/PlugIns'

...

Visual Studio Version

No response

GCC / Compiler Version

No response

@cyanic-selkie cyanic-selkie added the build build issues; typically submitted using template label Sep 27, 2024
@github-actions github-actions bot added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Sep 27, 2024
@skottmckay
Copy link
Contributor

Do you have a requirement to build it, or can you use the cocoapod packages?

https://onnxruntime.ai/docs/install/#install-on-ios

@cyanic-selkie
Copy link
Author

cyanic-selkie commented Sep 28, 2024

@skottmckay We do have a requirement to build it because we are linking it to a common rust library that we then use in both the iOS and the Android versions (and eventually web/wasm).

In addition, we would also like to build a minimal version given .ort config.

@cyanic-selkie
Copy link
Author

As a quick workaround, I simply disabled the tests in cmake:

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 5555fa692e..ffdc66cd88 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -1736,9 +1736,9 @@ if (onnxruntime_BUILD_OBJC)
   list(APPEND ONNXRUNTIME_CMAKE_FILES onnxruntime_objectivec)
 endif()
 
-if (onnxruntime_BUILD_UNIT_TESTS)
-  list(APPEND ONNXRUNTIME_CMAKE_FILES onnxruntime_unittests)
-endif()
+# if (onnxruntime_BUILD_UNIT_TESTS)
+#   list(APPEND ONNXRUNTIME_CMAKE_FILES onnxruntime_unittests)
+# endif()
 
 if (onnxruntime_BUILD_WINML_TESTS)
   list(APPEND ONNXRUNTIME_CMAKE_FILES winml_unittests)

@skottmckay
Copy link
Contributor

skottmckay commented Sep 28, 2024

We build with unit tests enabled in the CIs and don't see any issues and I can't repro this. Does it happen with a clean build output directory (can set a new one with something like --build_dir build/iOS.new)?

You can disable all the tests with --cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF. This greatly speeds up build time as well.

@cyanic-selkie
Copy link
Author

Hm, that's interesting.

I literally did this:

  1. git clone --recursive git@github.com:microsoft/onnxruntime.git && cd onnxruntime
  2. ./build.sh --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync --use_xcode --ios --apple_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 17 --update --build

And the error was there. Originally, I built the v1.19.2 tag, but it happens on the main branch as well.

I tried specifying a different build dir, but nothing different happened.

I'm not sure if relevant, but the system cmake version is 3.30.3.

sw_vers output:

ProductName:		macOS
ProductVersion:		14.6.1
BuildVersion:		23G93

xcodebuild --version output:

Xcode 16.0
Build version 16A242d

Disabling the tests with --cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF works, so thanks. We'll just use that for the time being.

@edgchen1
Copy link
Contributor

I've seen this too when building for iOS with Xcode 16. Our CI builds use 14.3.1.

@edgchen1
Copy link
Contributor

edgchen1 commented Oct 8, 2024

It may be a CMake / Xcode 16 issue:
https://gitlab.kitware.com/cmake/cmake/-/issues/26301

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants