Skip to content

[Build] Build Failure for ONNX Runtime from Source #23407

@eKevinHoang

Description

@eKevinHoang

Describe the issue

I attempted to build ONNX Runtime from source but ran into a build failure. The error indicated that the nsync_cpp library could not be found, even though it is installed and available in /usr/local/lib. The following libraries exist in /usr/local/lib:

/usr/local/lib/libnsync.1.29.2.dylib
/usr/local/lib/libnsync.dylib
/usr/local/lib/libnsync_cpp.1.dylib
/usr/local/lib/libnsync.1.dylib
/usr/local/lib/libnsync_cpp.1.29.2.dylib
/usr/local/lib/libnsync_cpp.dylib

Despite this, the build process fails with the error about nsync_cpp.

Please let me know if you need any more details or logs to investigate this issue. Thank you!

Urgency

No response

Target platform

MacOS Sequoia 15.2, Homebrew 4.4.16

Build script

./build.sh --config RelWithDebInfo --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=x86_64

Error / output

CMake Error at onnxruntime_mlas.cmake:746 (target_link_libraries):
Target "onnxruntime_mlas_q4dq" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime.cmake:246 (target_link_libraries):
Target "onnxruntime" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:72 (target_link_libraries):
Target "onnxruntime_test_all" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
onnxruntime_unittests.cmake:912 (AddTest)
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:1133 (target_link_libraries):
Target "onnx_test_runner" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:1294 (target_link_libraries):
Target "onnxruntime_perf_test" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:63 (target_link_libraries):
Target "onnxruntime_shared_lib_test" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
onnxruntime_unittests.cmake:1379 (AddTest)
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:63 (target_link_libraries):
Target "onnxruntime_global_thread_pools_test" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
onnxruntime_unittests.cmake:1417 (AddTest)
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:1500 (target_link_libraries):
Target "onnxruntime_mlas_test" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:63 (target_link_libraries):
Target "onnxruntime_customopregistration_test" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
onnxruntime_unittests.cmake:1698 (AddTest)
CMakeLists.txt:1789 (include)

CMake Error at onnxruntime_unittests.cmake:63 (target_link_libraries):
Target "onnxruntime_logging_apis_test" links to:

nsync::nsync_cpp

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
onnxruntime_unittests.cmake:1822 (AddTest)
CMakeLists.txt:1789 (include)

-- Generating done (1.1s)
CMake Generate step failed. Build files cannot be regenerated correctly.
Traceback (most recent call last):
File "/Users/kevin/onnxruntime-1.20.1/tools/ci_build/build.py", line 2998, in
sys.exit(main())
^^^^^^
File "/Users/kevin/onnxruntime-1.20.1/tools/ci_build/build.py", line 2853, in main
generate_build_tree(
File "/Users/kevin/onnxruntime-1.20.1/tools/ci_build/build.py", line 1674, in generate_build_tree
run_subprocess(
File "/Users/kevin/onnxruntime-1.20.1/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/kevin/onnxruntime-1.20.1/tools/python/util/run.py", line 49, in run
completed_process = subprocess.run(
^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/bin/cmake', '/Users/kevin/onnxruntime-1.20.1/cmake', '--compile-no-warning-as-error', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-DPython_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.12/bin/python3', '-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.12/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=x86_64', '-DCMAKE_OSX_ARCHITECTURES=x86_64', '-DCMAKE_TLS_VERIFY=ON', '-DFETCHCONTENT_QUIET=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_PREFIX_PATH=/Users/kevin/onnxruntime-1.20.1/build/MacOS/RelWithDebInfo/installed']' returned non-zero exit status 1.

Visual Studio Version

No response

GCC / Compiler Version

Apple clang version 16.0.0 (clang-1600.0.26.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildbuild issues; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions