-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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] ORT 1.15 cross building IOS and use ORT as subrepos #16238
Comments
What's your host operating system? |
Hi i launch upgrade of the OS and brew upgrade to get the last tools
|
I've encountered this too when building on MacOS. A workaround is to use an external protoc with The protobuf version is specified here: Line 29 in 638146b
|
We might resolve it by updating the code block at: https://github.com/microsoft/onnxruntime/blob/main/cmake/external/onnxruntime_external_deps.cmake#LL110C71-L110C94 |
We also have this problem. MacOS is host, targeting iOS. Using an externally built protobuf seems problematic to get everything we need for both host and all target OSes. This worked in v1.14.1. Could this be fixed in v1.15.0? |
Why it is problematic ? Just want to know all your concerns. |
Fetching a prebuilt binary is fine. But the onnxruntime build should do the fetching so that it gets the required version and dependencies. |
I resolved this by installing protobuf and passing the protoc executable path to the build script with.
|
Thank you for resolving this. |
Follow #16238 (comment) solve the issue |
Describe the issue
Hi o/ and first of all thanks for this project
I update my ort submodules to ort1.15 and was unable to cross compiling to iOS as before
The inner build script of ORT fail on some protoc custom command
More formally I do in subrepos
./build.sh --config Release --use_xcode --ios --ios_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 12
and have the failure see below
Thanks for your help
Urgency
Block iOS deployment with last ORT release
Target platform
IOS
Build script
./build.sh --config Release --use_xcode --ios --ios_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 12
Error / output
`-- Configuring done (38.7s)
CMake Error at external/protobuf_function.cmake:158 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
onnxruntime_unittests.cmake:879 (onnxruntime_protobuf_generate)
CMakeLists.txt:1609 (include)
CMake Error at external/protobuf_function.cmake:158 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
onnxruntime_unittests.cmake:879 (onnxruntime_protobuf_generate)
CMakeLists.txt:1609 (include)
CMake Error at external/protobuf_function.cmake:158 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
onnxruntime_unittests.cmake:879 (onnxruntime_protobuf_generate)
CMakeLists.txt:1609 (include)
CMake Error at external/protobuf_function.cmake:158 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
onnxruntime_unittests.cmake:879 (onnxruntime_protobuf_generate)
CMakeLists.txt:1609 (include)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:334 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:343 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
CMake Error at /Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:319 (add_custom_command):
Error evaluating generator expression:
No target "protobuf::protoc"
Call Stack (most recent call first):
/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/_deps/onnx-src/CMakeLists.txt:352 (relative_protobuf_generate_cpp)
-- Generating done (0.1s)
CMake Generate step failed. Build files cannot be regenerated correctly.
Traceback (most recent call last):
File "/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/tools/ci_build/build.py", line 2599, in
sys.exit(main())
File "/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/tools/ci_build/build.py", line 2460, in main
generate_build_tree(
File "/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/tools/ci_build/build.py", line 1369, in generate_build_tree
run_subprocess(
File "/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/tools/ci_build/build.py", line 781, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
File "/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/tools/python/util/run.py", line 49, in run
completed_process = subprocess.run(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/bin/cmake', '/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/cmake', '--compile-no-warning-as-error', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-DPython_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3', '-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3', '-Donnxruntime_USE_MIMALLOC=OFF', '-Donnxruntime_ENABLE_PYTHON=OFF', '-Donnxruntime_BUILD_CSHARP=OFF', '-Donnxruntime_BUILD_JAVA=OFF', '-Donnxruntime_BUILD_NODEJS=OFF', '-Donnxruntime_BUILD_OBJC=OFF', '-Donnxruntime_BUILD_SHARED_LIB=OFF', '-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_NNAPI_BUILTIN=OFF', '-Donnxruntime_USE_RKNPU=OFF', '-Donnxruntime_USE_LLVM=OFF', '-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF', '-Donnxruntime_USE_VITISAI=OFF', '-Donnxruntime_USE_TENSORRT=OFF', '-Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON', '-Donnxruntime_USE_TVM=OFF', '-Donnxruntime_TVM_CUDA_RUNTIME=OFF', '-Donnxruntime_TVM_USE_HASH=OFF', '-Donnxruntime_USE_MIGRAPHX=OFF', '-Donnxruntime_DISABLE_CONTRIB_OPS=OFF', '-Donnxruntime_DISABLE_ML_OPS=OFF', '-Donnxruntime_DISABLE_RTTI=OFF', '-Donnxruntime_DISABLE_EXCEPTIONS=OFF', '-Donnxruntime_MINIMAL_BUILD=OFF', '-Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF', '-Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF', '-Donnxruntime_REDUCED_OPS_BUILD=OFF', '-Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF', '-Donnxruntime_USE_DML=OFF', '-Donnxruntime_USE_WINML=OFF', '-Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF', '-Donnxruntime_USE_TELEMETRY=OFF', '-Donnxruntime_ENABLE_LTO=OFF', '-Donnxruntime_USE_ACL=OFF', '-Donnxruntime_USE_ACL_1902=OFF', '-Donnxruntime_USE_ACL_1905=OFF', '-Donnxruntime_USE_ACL_1908=OFF', '-Donnxruntime_USE_ACL_2002=OFF', '-Donnxruntime_USE_ARMNN=OFF', '-Donnxruntime_ARMNN_RELU_USE_CPU=ON', '-Donnxruntime_ARMNN_BN_USE_CPU=ON', '-Donnxruntime_USE_JSEP=OFF', '-Donnxruntime_ENABLE_NVTX_PROFILE=OFF', '-Donnxruntime_ENABLE_TRAINING=OFF', '-Donnxruntime_ENABLE_TRAINING_OPS=OFF', '-Donnxruntime_ENABLE_TRAINING_APIS=OFF', '-Donnxruntime_ENABLE_CPU_FP16_OPS=OFF', '-Donnxruntime_USE_NCCL=OFF', '-Donnxruntime_BUILD_BENCHMARKS=OFF', '-Donnxruntime_USE_ROCM=OFF', '-DOnnxruntime_GCOV_COVERAGE=OFF', '-Donnxruntime_USE_MPI=OFF', '-Donnxruntime_ENABLE_MEMORY_PROFILE=OFF', '-Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF', '-Donnxruntime_BUILD_WEBASSEMBLY=OFF', '-Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON', '-Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON', '-Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF', '-Donnxruntime_ENABLE_LAZY_TENSOR=OFF', '-Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF', '-Donnxruntime_ENABLE_CUDA_PROFILING=OFF', '-Donnxruntime_ENABLE_ROCM_PROFILING=OFF', '-Donnxruntime_USE_XNNPACK=OFF', '-Donnxruntime_USE_CANN=OFF', '-DCMAKE_OSX_ARCHITECTURES=arm64', '-DCMAKE_OSX_DEPLOYMENT_TARGET=12', '-DCMAKE_SYSTEM_NAME=iOS', '-Donnxruntime_BUILD_SHARED_LIB=ON', '-DCMAKE_OSX_SYSROOT=iphoneos', '-DCMAKE_OSX_DEPLOYMENT_TARGET=12', '-Dprotobuf_BUILD_PROTOC_BINARIES=OFF', '-DCMAKE_TOOLCHAIN_FILE=../cmake/onnxruntime_ios.toolchain.cmake', '-Dprotobuf_BUILD_PROTOC_BINARIES=OFF', '-DCMAKE_TLS_VERIFY=ON', '-DFETCHCONTENT_QUIET=OFF', '-Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF', '-G', 'Xcode', '-Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_PREFIX_PATH=/Users/tretornaz/Projects/myscript_ml/third_part/onnxruntime/build/iOS/Release/installed']' returned non-zero exit status 1.
`
Visual Studio Version
No response
GCC / Compiler Version
No response
The text was updated successfully, but these errors were encountered: