Correctly propagate C++17 standard flags to NVCC compilation with older CMake versions.#93
Merged
romerojosh merged 2 commits intomainfrom Nov 4, 2025
Merged
Conversation
a2473cc to
d140fb3
Compare
Collaborator
Author
|
/build |
|
🚀 Build workflow triggered! View run |
|
❌ Build workflow failed! View run |
d140fb3 to
6949cab
Compare
… source compilation. Signed-off-by: Josh Romero <joshr@nvidia.com>
…logic to handle C++ std for .cu files. Signed-off-by: Josh Romero <joshr@nvidia.com>
6949cab to
5e2cf7a
Compare
Collaborator
Author
|
/build |
|
🚀 Build workflow triggered! View run |
|
✅ Build workflow passed! View run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A user reported compilation issues for cuDecomp using the most recent NVHPC release (25.9) against CUDA 13.0. The root cause of their issue was a combination of an older GCC (earlier than GCC-10) and older CMake version (earlier than 3.18).
#72 bumped the required C++ standard to 17 to address deprecation warnings from
libcu++about C++14, which became a true compilation error in thelibcu++version packaged with CUDA 13. It turns out that CMake versions older than 3.18 do not propagate the C++17 flags (viaCMAKE_CXX_STANDARD=17) to.cufile compilation, likely becauseCMAKE_CUDA_STANDARDdoes not support C++17 until CMake 3.18 (ref). This doesn't matter if the GCC compiler is 10 or newer, as C++17 is the default standard applied and works in lieu of CMake providing the C++17 flags tonvcc, but breaks when the GCC is older and the default standard is pre-C++17.To address this, I am manually adding
-std=c++17toCMAKE_CUDA_FLAGSfor CMake versions prior to 3.18. While I could make the CMake minimum version 3.18, this would break builds on Ubuntu 20.04 which defaults to CMake 3.16.