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] Must build on Ubuntu 20.04 with gcc 9 #24168

Open
BengtGustafsson opened this issue Mar 25, 2025 · 2 comments
Open

[Build] Must build on Ubuntu 20.04 with gcc 9 #24168

BengtGustafsson opened this issue Mar 25, 2025 · 2 comments
Labels
build build issues; typically submitted using template

Comments

@BengtGustafsson
Copy link
Contributor

Describe the issue

In 1.21 you start using from_chars for float except for libstdc++ which does not have it. But gcc 9 which is what is available on the still supported ubuntu 20.04 platform. There was also an issue related to lohmann json which forced us to move from 1.21 to main.

It is impossible for us to upgrade beyond Ubuntu 20.04. You should not be this bleeding edge all the time. We have customers around the world and they are slow to update their OSes due to medtec regulatory issues. You can definitely not assume that everyone will upgrade before EOL of a version and should offer a grace period of at least 6 months after something goes out of support, preferrably longer.

I will push a PR that #ifs on the gcc version which we really require to be included in 1.21.1, which is due.... when? The release roadmap is not updated. Our release is due Q2 so I hope it is before end of May at least.

Urgency

We really need this within May. We don't want to be on our own fork of onnxruntime when we make a release.

Target platform

linux Ubuntu 20.04

Build script

Any

Error / output

In file included from /src/onnxruntime/onnxruntime/test/common/string_utils_test.cc:5:
/src/onnxruntime/include/onnxruntime/core/common/parse_string.h: In instantiation of ‘std::enable_if_t<ParseWithFromChars, bool> onnxruntime::TryParseStringWithClassicLocale(std::string_view, T&) [with T = float; std::enable_if_t<ParseWithFromChars, bool> = bool; std::string_view = std::basic_string_view]’:
/src/onnxruntime/onnxruntime/test/common/string_utils_test.cc:19:3: required from ‘void onnxruntime::test::{anonymous}::TestSuccessfulParse(const string&, const T&) [with T = float; std::string = std::__cxx11::basic_string]’
/src/onnxruntime/onnxruntime/test/common/string_utils_test.cc:33:34: required from here
/src/onnxruntime/include/onnxruntime/core/common/parse_string.h:38:41: error: no matching function for call to ‘from_chars(std::basic_string_view::const_pointer, std::basic_string_view::const_pointer, float&)’
38 | const auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), parsed_value);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /src/onnxruntime/include/onnxruntime/core/common/parse_string.h:6,
from /src/onnxruntime/onnxruntime/test/common/string_utils_test.cc:5:
/usr/include/c++/9/charconv:600:5: note: candidate: ‘template std::__detail::__integer_from_chars_result_type<_Tp> std::from_chars(const char*, const char*, _Tp&, int)’
600 | from_chars(const char* __first, const char* __last, _Tp& __value,
| ^~~~~~~~~~

Visual Studio Version

No response

GCC / Compiler Version

gcc9

@BengtGustafsson BengtGustafsson added the build build issues; typically submitted using template label Mar 25, 2025
@fs-eire
Copy link
Contributor

fs-eire commented Mar 26, 2025

I think the minimal GCC version requirement is now 11.1:

if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 11.1)
message(FATAL_ERROR "GCC version must be greater than or equal to 11.1")
endif()

If you cannot upgrade your GCC version, I think you can checkout an older version of onnxruntime that still builds with GCC 9

@BengtGustafsson
Copy link
Contributor Author

BengtGustafsson commented Mar 26, 2025

Yes, but 1.20 does not allow using the latest TensorRT versions and the version it supports has sporadic crashes. And 1.21 does not allow --usedml and --usetensorrt simultaneously, so we have to go to main which does not build on ubuntu 20.04. I have a patch though, which I will submit as a PR. Interestingly the cmake snippet you show above does not kill the build for us when using gcc 9.4.

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

2 participants