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] ORT 1.15 cross building IOS and use ORT as subrepos #16238

Closed
ThomasRetornaz opened this issue Jun 5, 2023 · 10 comments
Closed

[Build] ORT 1.15 cross building IOS and use ORT as subrepos #16238

ThomasRetornaz opened this issue Jun 5, 2023 · 10 comments
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@ThomasRetornaz
Copy link

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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:

$<TARGET_FILE:protobuf::protoc>

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

@ThomasRetornaz ThomasRetornaz added the build build issues; typically submitted using template label Jun 5, 2023
@github-actions github-actions bot added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Jun 5, 2023
@snnn
Copy link
Member

snnn commented Jun 5, 2023

What's your host operating system?

@ThomasRetornaz
Copy link
Author

Hi i launch upgrade of the OS and brew upgrade to get the last tools

  • macos ventura
  • last xcode
  • cmake uptodate
  • macbookpro x64

@edgchen1
Copy link
Contributor

edgchen1 commented Jun 5, 2023

I've encountered this too when building on MacOS. A workaround is to use an external protoc with --path_to_protoc_exe.

The protobuf version is specified here:

protobuf;https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.12.zip;7cf2733949036c7d52fda017badcab093fe73bfa

@snnn
Copy link
Member

snnn commented Jun 5, 2023

@john-dance
Copy link

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?

@snnn
Copy link
Member

snnn commented Jun 7, 2023

Why it is problematic ? Just want to know all your concerns.
When we do cross-compiling, we need to compile the some of the source code more than once: one for the host os for making protoc work, one for the target os(iOS). Unfortunately, cmake doesn't have the support. There isn't a way that we can tell cmake to build the same target twice. In the past, we can manually drive the build by using some python code in build.py to drive the code. But now protobuf becomes more and more complicated, It has many dependencies. We need to build the dependencies first. A dependency may also have dependencies. So, I think, when possible, we should fetch a prebuilt binary and just use it. I can add some code in onnxruntime_external_deps.cmake to help, but it doesn't change the fact that the protoc binary is external built.

@john-dance
Copy link

Fetching a prebuilt binary is fine. But the onnxruntime build should do the fetching so that it gets the required version and dependencies.

@jwanga
Copy link

jwanga commented Jun 14, 2023

I resolved this by installing protobuf and passing the protoc executable path to the build script with. --path_to_protoc_exe. I had to install v21 of protobuf. anything newer wouldn't compile

brew install protobuf@21

./build.sh --config Debug --use_xcode --ios --ios_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 13.0 --path_to_protoc_exe /opt/homebrew/opt/protobuf@21/bin/protoc

@john-dance
Copy link

Thank you for resolving this.
What is the timeline for an official release tag ... v1.15.1?

@ThomasRetornaz
Copy link
Author

Follow #16238 (comment) solve the issue

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

No branches or pull requests

5 participants