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] CMake Error at onnxruntime_unittests.cmake:1026 (find_path): Could not find onnx_SOURCE_DIR using the following files: onnx/onnx-ml.proto3, onnx/onnx-ml.proto Call Stack (most recent call first): CMakeLists.txt:1789 (include) #23684

Open
Bobchenyx opened this issue Feb 13, 2025 · 10 comments
Labels
build build issues; typically submitted using template

Comments

@Bobchenyx
Copy link

Describe the issue

NVCC_ERROR =
NVCC_OUT = no such file or directory
-- Performing Test HAS_STRINGOP_OVERFLOW
-- Performing Test HAS_STRINGOP_OVERFLOW - Failed
-- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE
-- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE - Success
-- Performing Test HAS_UNDEFINED_VAR_TEMPLATE
-- Performing Test HAS_UNDEFINED_VAR_TEMPLATE - Success
-- Performing Test HAS_UNUSED_BUT_SET_PARAMETER
-- Performing Test HAS_UNUSED_BUT_SET_PARAMETER - Success
-- Performing Test HAS_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAS_UNUSED_BUT_SET_VARIABLE - Success
-- Performing Test HAS_UNUSED_VARIABLE
-- Performing Test HAS_UNUSED_VARIABLE - Success
-- Performing Test HAS_USELESS_CAST
-- Performing Test HAS_USELESS_CAST - Failed
-- Looking for reallocarray
-- Looking for reallocarray - not found
-- Found Git: /opt/homebrew/bin/git (found version "2.48.1")
CMake Error at onnxruntime_unittests.cmake:1026 (find_path):
Could not find onnx_SOURCE_DIR using the following files:
onnx/onnx-ml.proto3, onnx/onnx-ml.proto
Call Stack (most recent call first):
CMakeLists.txt:1789 (include)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/TTS-C/cpp/onnxruntime/tools/ci_build/build.py", line 2998, in
sys.exit(main())
File "/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/TTS-C/cpp/onnxruntime/tools/ci_build/build.py", line 2853, in main
generate_build_tree(
File "/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/TTS-C/cpp/onnxruntime/tools/ci_build/build.py", line 1674, in generate_build_tree
run_subprocess(
File "/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/TTS-C/cpp/onnxruntime/tools/ci_build/build.py", line 867, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
File "/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/TTS-C/cpp/onnxruntime/tools/python/util/run.py", line 49, in run
completed_process = subprocess.run(
File "/opt/anaconda3/envs/tts-c/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/homebrew/bin/cmake', '/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/TTS-C/cpp/onnxruntime/cmake', '--compile-no-warning-as-error', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-DPython_EXECUTABLE=/opt/anaconda3/envs/tts-c/bin/python3', '-DPYTHON_EXECUTABLE=/opt/anaconda3/envs/tts-c/bin/python3', '-Donnxruntime_USE_VCPKG=OFF', '-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=ON', '-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_NNAPI_BUILTIN=OFF', '-Donnxruntime_USE_VSINPU=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_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_ARMNN=OFF', '-Donnxruntime_ARMNN_RELU_USE_CPU=ON', '-Donnxruntime_ARMNN_BN_USE_CPU=ON', '-Donnxruntime_USE_JSEP=OFF', '-Donnxruntime_USE_WEBGPU=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_USE_CUDA_NHWC_OPS=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_WEBNN=OFF', '-Donnxruntime_USE_CANN=OFF', '-Donnxruntime_USE_TRITON_KERNEL=OFF', '-Donnxruntime_DISABLE_FLOAT8_TYPES=OFF', '-Donnxruntime_DISABLE_SPARSE_TENSORS=OFF', '-Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF', '-DCMAKE_OSX_ARCHITECTURES=arm64', '-DCMAKE_OSX_ARCHITECTURES=arm64', '-DCMAKE_TLS_VERIFY=ON', '-DFETCHCONTENT_QUIET=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_PREFIX_PATH=/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/TTS-C/cpp/onnxruntime/build/MacOS/RelWithDebInfo/installed']' returned non-zero exit status 1.
(tts-c) bobchenyx@Mac onnxruntime %

Urgency

No response

Target platform

MacOS m3pro

Build script

(tts-c) bobchenyx@Mac onnxruntime % g++ --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Error / output

CMake Error at onnxruntime_unittests.cmake:1026 (find_path):
Could not find onnx_SOURCE_DIR using the following files:
onnx/onnx-ml.proto3, onnx/onnx-ml.proto
Call Stack (most recent call first):
CMakeLists.txt:1789 (include)

Visual Studio Version

No response

GCC / Compiler Version

No response

@Bobchenyx Bobchenyx added the build build issues; typically submitted using template label Feb 13, 2025
@Bobchenyx
Copy link
Author

(tts-c) bobchenyx@Mac onnxruntime % ./build.sh --config RelWithDebInfo --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=arm64

@snnn
Copy link
Member

snnn commented Feb 13, 2025

I will soon submit a PR to fix it.

@Bobchenyx
Copy link
Author

I will soon submit a PR to fix it.

@snnn Hi there, thanks for the comment and update!
Would it be fine if i pull your branch and try building it locally now? or should I wait till they merge your PR to main?

@therealpurplemana
Copy link

Please merge this! I'm stuck!

@snnn
Copy link
Member

snnn commented Feb 19, 2025

Can you add "--use_vcpkg" to the build command. Does the problem disappear?
(The flag exists in the latest code in the main branch. We will make a new release soon)

@Bobchenyx
Copy link
Author

--use_vcpkg

CMake Error at scripts/cmake/vcpkg_find_acquire_program.cmake:166 (message):
Could not find pkg-config. Please install it via your package manager:

  brew install pkg-config

Call Stack (most recent call first):
scripts/cmake/vcpkg_fixup_pkgconfig.cmake:193 (vcpkg_find_acquire_program)
/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/onnxruntime/cmake/vcpkg-ports/abseil/portfile.cmake:39 (vcpkg_fixup_pkgconfig)
scripts/ports.cmake:196 (include)

error: building abseil:arm64-osx failed with: BUILD_FAILED
See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Elapsed time to handle abseil:arm64-osx: 33 s
Please ensure you're using the latest port files with git pull and vcpkg update.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+abseil
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[abseil]+Build+error+on+arm64-osx&body=Copy%20issue%20body%20from%20%2FUsers%2Fbobchenyx%2FDocuments%2FWork%2FYZ.Wang%2FTTS%2FGPT-SoVITS%2Fonnxruntime%2Fbuild%2FMacOS%2FRelWithDebInfo%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md
You can also submit an issue by running (GitHub CLI must be installed):
/opt/homebrew/bin/gh issue create -R microsoft/vcpkg --title "[abseil] Build failure on arm64-osx" --body-file /Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/onnxruntime/build/MacOS/RelWithDebInfo/vcpkg_installed/vcpkg/issue_body.md
Completed submission of vcpkg-cmake:arm64-osx to 1 binary cache(s) in 5.82 ms
-- Running vcpkg install - failed
CMake Error at /Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/onnxruntime/build/MacOS/vcpkg/scripts/buildsystems/vcpkg.cmake:904 (message):
vcpkg install failed. See logs for more information:
/Users/bobchenyx/Documents/Work/YZ.Wang/TTS/GPT-SoVITS/onnxruntime/build/MacOS/RelWithDebInfo/vcpkg-manifest-install.log
Call Stack (most recent call first):
/opt/homebrew/share/cmake/Modules/CMakeDetermineSystem.cmake:146 (include)
CMakeLists.txt:11 (project)

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage

@snnn
Copy link
Member

snnn commented Feb 20, 2025

Can you run the

brew install pkg-config

command to install the pkg-config tool then run the build again?

@j-nava
Copy link

j-nava commented Feb 20, 2025

FWIW I was experiencing the same issue and my build completed successfully using vcpkg.
This is the full command I ran:

python3 ./tools/ci_build/build.py --build_dir ./build/macos --build --update --config Release --parallel --compile_no_warning_as_error --use_coreml --use_vcpkg

@loloxwg
Copy link

loloxwg commented Feb 24, 2025

Could not find onnx_SOURCE_DIR using the following files:
onnx/onnx-ml.proto3, onnx/onnx-ml.proto
same

@therealpurplemana
Copy link

therealpurplemana commented Feb 24, 2025 via email

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

No branches or pull requests

5 participants