Skip to content

Commit 4fc3669

Browse files
committed
Update CMake for CUDA 13
Update CMake to the latest 3.x bugfix version, v3.31.12. Backport cmake!12162 CUDA: Add support for cuda_std_23 for nvcc 13.3+.
1 parent b1effa9 commit 4fc3669

2 files changed

Lines changed: 44 additions & 2 deletions

File tree

cmake.spec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
### RPM external cmake 3.31.7
1+
### RPM external cmake 3.31.12
22
%define downloaddir %(echo %realversion | cut -d. -f1,2)
33
Source: http://www.cmake.org/files/v%{downloaddir}/%n-%realversion.tar.gz
4+
# Note: this patch should be removed after updating to CMake 4.4+
5+
Patch0: patches/cmake_cuda_std_23
46
Requires: bz2lib curl expat zlib
57
BuildRequires: gmake
68

@@ -42,4 +44,4 @@ make %makeprocesses
4244
make install/strip
4345

4446
# Look up documentation online.
45-
%define drop_files %i/{doc,man}
47+
%define drop_files %i/{doc,man}

patches/cmake_cuda_std_23.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
commit d01c9a429b25fcea8f5b77547adc23f3fede0471
2+
Author: Arha Gatram <agatram@nvidia.com>
3+
Date: Wed Jun 10 15:53:55 2026 +0000
4+
5+
CUDA: Add support for cuda_std_23 for nvcc 13.3+
6+
7+
CUDA 13.3 has been released with support for `-std=c++23`.
8+
9+
diff --git a/Modules/Compiler/NVIDIA.cmake b/Modules/Compiler/NVIDIA.cmake
10+
index 0d0f03ad00..5bf7044159 100644
11+
--- a/Modules/Compiler/NVIDIA.cmake
12+
+++ b/Modules/Compiler/NVIDIA.cmake
13+
@@ -46,6 +46,14 @@ macro(__compiler_nvidia_cxx_standards lang)
14+
set(CMAKE_${lang}_STANDARD_LATEST 20)
15+
endif()
16+
endif()
17+
+
18+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 13.3)
19+
+ if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.29.30129)
20+
+ set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++23")
21+
+ set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=c++23")
22+
+ set(CMAKE_${lang}_STANDARD_LATEST 23)
23+
+ endif()
24+
+ endif()
25+
else()
26+
set(CMAKE_${lang}03_STANDARD_COMPILE_OPTION "")
27+
set(CMAKE_${lang}03_EXTENSION_COMPILE_OPTION "")
28+
@@ -75,6 +83,12 @@ macro(__compiler_nvidia_cxx_standards lang)
29+
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=c++20")
30+
set(CMAKE_${lang}_STANDARD_LATEST 20)
31+
endif()
32+
+
33+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 13.3)
34+
+ set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++23")
35+
+ set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=c++23")
36+
+ set(CMAKE_${lang}_STANDARD_LATEST 23)
37+
+ endif()
38+
endif()
39+
40+
__compiler_check_default_language_standard(${lang} 6.0 03)

0 commit comments

Comments
 (0)