Skip to content

[Build] Build script for MacOS fails for targets older than 13.4 because tests can not be built #24277

Open
@juhanisimola-yousician

Description

@juhanisimola-yousician

Describe the issue

According to https://onnxruntime.ai/docs/build/inferencing.html, "By default, ONNX Runtime is configured to be built for a minimum target macOS version of 10.12." In practice, when the runtime is built without specifying a target OS it is built for the major OS version the build machine is running (15.0 when building on 15.4 in my case). When the --apple_deploy_target argument is set to anything less than 13.4, the build fails because the tests are using functionality that is not available on older MacOS versions. The runtime itself is compiled, but I couldn't find an option to disable building the tests.

Urgency

No response

Target platform

MacOS

Build script

./build.sh --cmake_generator Ninja --config Release --skip_submodule_sync --skip_tests --build_shared_lib --apple_deploy_target 10.15 --minimal_build --cmake_extra_defines CMAKE_OSX_ARCHITECTURES="x86_64;arm64" CMAKE_IGNORE_PATH=/opt/homebrew

Error / output

The first error is

In file included from /Users/juhani.simola/work/onnxruntime-1.21.0/onnxruntime/test/common/logging/sinks_test.cc:3:
In file included from /Users/juhani.simola/work/onnxruntime-1.21.0/include/onnxruntime/core/common/common.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/chrono:969:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__chrono/formatter.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__chrono/ostream.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/format_functions.h:29:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_floating_point.h:74:30: error: 'to_chars' is unavailable: introduced in macOS 13.4
  to_chars_result __r = std::to_chars(__first, __last, __value, __fmt, __precision);

Visual Studio Version

No response

GCC / Compiler Version

Xcode 15.4 and 16.3, SDK 16.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    quantizationissues related to quantization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions