From 4fc628c4d7b6148ebd5cb9c800ea3fb337d602c0 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk <21087696+oleksandr-pavlyk@users.noreply.github.com> Date: Fri, 1 Aug 2025 15:33:39 -0500 Subject: [PATCH] Python native extension to use CXX/CUDA standard of NVBench library This fixes cryptic build failure with GNU compiler 14 --- python/CMakeLists.txt | 1 - python/src/py_nvbench.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index abfc59a..139b80b 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -32,7 +32,6 @@ target_link_libraries(_nvbench PRIVATE CUDA::cudart_static) set_target_properties(_nvbench PROPERTIES INSTALL_RPATH "$ORIGIN") set_target_properties(_nvbench PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON) set_target_properties(_nvbench PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(_nvbench PROPERTIES CXX_STANDARD 20) install(TARGETS _nvbench DESTINATION cuda/nvbench) diff --git a/python/src/py_nvbench.cpp b/python/src/py_nvbench.cpp index be2a384..89fb718 100644 --- a/python/src/py_nvbench.cpp +++ b/python/src/py_nvbench.cpp @@ -102,7 +102,7 @@ private: class nvbench_run_error : std::runtime_error {}; -constinit py::handle benchmark_exc{}; +py::handle benchmark_exc{}; class GlobalBenchmarkRegistry { @@ -215,7 +215,7 @@ py::dict py_get_axis_values(const nvbench::state &state) } // essentially a global variable, but allocated on the heap during module initialization -constinit std::unique_ptr global_registry{}; +std::unique_ptr global_registry{}; } // end of anonymous namespace