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] Broken build with Xcode 15.3 #19899

Closed
IvanPizhenko opened this issue Mar 13, 2024 · 8 comments
Closed

[Build] Broken build with Xcode 15.3 #19899

IvanPizhenko opened this issue Mar 13, 2024 · 8 comments
Labels
build build issues; typically submitted using template stale issues that have not been addressed in a while; categorized by a bot

Comments

@IvanPizhenko
Copy link

Describe the issue

ONNX runtime build is broken after updating XCode from 15.2 to 15.3.

After installing side by side the Xcode 15.2 and switching to it, it builds successfully again.

Xcode 15.3 clang version info:

% sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
% clang --version                                                
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Xcode 15.2 clang version info:

% sudo xcode-select -s /Applications/Xcode-15.2.app/Contents/Developer
% clang --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode-15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Urgency

No response

Target platform

Mac OS X

Build script

I'm using this ONNX runtime build wrapper
https://github.com/supertone-inc/onnxruntime-build

without it, just run some default build

Error / output

Build error:

[43%] Building CXX object onnxruntime/CMakeFiles/onnxruntime_common.dir/Users/ivan/pro/thirdparty/onnxruntime-build-full-debug/onnxruntime/onnxruntime/core/common/logging/sinks/ostream_sink.cc.o
/Users/ivan/pro/thirdparty/onnxruntime-build-full-debug/onnxruntime/onnxruntime/core/common/logging/sinks/ostream_sink.cc:48:7: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostringstream' (aka 'basic_ostringstream<char>') and 'const Timestamp' (aka 'const time_point<std::chrono::system_clock>'))
  msg << timestamp << " [" << message.SeverityPrefix() << ":" << message.Category() << ":" << logger_id << ", "
  ~~~ ^  ~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/__chrono/ostream.h:46:1: note: candidate function [with _CharT = char, _Traits = std::char_traits<char>, _Duration = std::chrono::duration<long long, std::ratio<1, 1000000>>]
operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_time<_Duration> __tp) {
^
/Users/ivan/pro/thirdparty/onnxruntime-build-full-debug/build/static_lib/_deps/date-src/include/date/date.h:4212:1: note: candidate function [with CharT = char, Traits = std::char_traits<char>, Duration = std::chrono::duration<long long, std::ratio<1, 1000000>>]
operator<<(std::basic_ostream<CharT, Traits>& os, const sys_time<Duration>& tp)
^
1 error generated.
make[2]: *** [onnxruntime/CMakeFiles/onnxruntime_common.dir/Users/ivan/pro/thirdparty/onnxruntime-build-full-debug/onnxruntime/onnxruntime/core/common/logging/sinks/ostream_sink.cc.o] Error 1
make[1]: *** [onnxruntime/CMakeFiles/onnxruntime_common.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Visual Studio Version

No response

GCC / Compiler Version

Apple clang version 15.0.0 (clang-1500.3.9.4)

@IvanPizhenko IvanPizhenko added the build build issues; typically submitted using template label Mar 13, 2024
@skottmckay
Copy link
Contributor

Looks like C++20 added on ostream operator<< for std::chrono::duration and the date library also provides it.

https://en.cppreference.com/w/cpp/chrono/duration/operator_ltlt
https://github.com/HowardHinnant/date/blob/88a3b1512661decb78c60841f819a14eb200423c/include/date/date.h#L4221

The date library doesn't seem to be C++20 aware as I don't see any checks in date.h for #if __cplusplus >= 202002L.

ORT generally uses C++17, with the macOS build being the exception and using C++20.

@jchen351 is using C++20 ORT build required on macOS? #16187 has changes to test code only so not sure if that is an optional change.

If we need to use C++20 in the macOS ORT build we might need to patch date.h to exclude that operator<< implementation for a C++20 build.

@skottmckay
Copy link
Contributor

HowardHinnant/date#773

@snnn
Copy link
Member

snnn commented Mar 20, 2024

We would like to upgrade our C++ standard to C++20. It is working in progress.
Does absl::Time provide the things we need? If yes, we may remove the dependency on "date", to reduce the total number of dependencies we have.

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Apr 20, 2024
@IvanPizhenko
Copy link
Author

hello, are there any news?

@snnn
Copy link
Member

snnn commented Apr 22, 2024

Since the author said: "I'm really not in a position to develop and maintain such a project." We should consider stopping using the lib.

@IvanPizhenko
Copy link
Author

seems to be fixed in main via #20139
but I'll have to wait for release version.

@IvanPizhenko
Copy link
Author

Update: Fix should be available in 1.17.3

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 stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

3 participants