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

[C++] compilation standard to C++20 #44792

Open
rkannan opened this issue Nov 19, 2024 · 10 comments
Open

[C++] compilation standard to C++20 #44792

rkannan opened this issue Nov 19, 2024 · 10 comments

Comments

@rkannan
Copy link

rkannan commented Nov 19, 2024

Describe the enhancement requested

are there any issues with setting the default to c++20 in the codebase? Currently the cmake_modules/SetupCxxFlags.cmake sets CMAKE_CXX_STANDARD to 17.

Component(s)

C++

@assignUser
Copy link
Member

Yes that's not a quick decision to make. Here is the thread about bumping to 17 2 years ago: https://lists.apache.org/thread/9g14n3odhj6kzsgjxr6k6d3q73hg2njr

@assignUser
Copy link
Member

I checked and we currently can't switch to 20 because CRAN (R package hub) has several builds with AppleClang <=14. This is a blocker but not necessarily the only one.

You are certainly not alone in preferring to use C++20 but as arrow C++ is a foundational library we have to be more conservative with such thinks.

I will close this issue for now, we can re-visted in time

@assignUser assignUser closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
@kou
Copy link
Member

kou commented Nov 30, 2024

It seems that "Apple Clang 1300.0.29.30" is the oldest version based on the last R arrow package check information:

It's based on LLVM 12.0.0. See also: https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2

LLVM 12.0.0 has -std=c++20. See also: https://clang.llvm.org/cxx_status.html#cxx20

So we may be able to use C++20 on CRAM. (We may not be able to use some C++20 features.)

@kou
Copy link
Member

kou commented Dec 31, 2024

We can use C++20 with GCC 8 or later: https://gcc.gnu.org/projects/cxx-status.html#cxx20

@kou kou reopened this Dec 31, 2024
@assignUser
Copy link
Member

I think before such a move we should properly document our support policy. That will create clarity both for users and contributors.

@kou
Copy link
Member

kou commented Jan 1, 2025

I think before such a move we should properly document our support policy.

It mentions supported GCC/Clang/MSVC versions explicitly, right?

@assignUser
Copy link
Member

AFAIK this is the only place we mention it:

A C++17-enabled compiler. On Linux, gcc 7.1 and higher should be sufficient. For Windows, at least Visual Studio VS2017 is required.

https://arrow.apache.org/docs/developers/cpp/building.html

@kou
Copy link
Member

kou commented Jan 1, 2025

It seems that we need to add only Clang version to the document.

@kou
Copy link
Member

kou commented Feb 7, 2025

FYI: We tried C++20: #45445

@pitrou
Copy link
Member

pitrou commented Feb 7, 2025

Thanks for pointing me to this issue @kou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants