Suppressed -Wold-style-cast for clang as nvcc host compiler
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 18 Jun 2021 04:56:39 +0000 (06:56 +0200)
committerAndrey Alekseenko <al42and@gmail.com>
Fri, 18 Jun 2021 09:17:57 +0000 (09:17 +0000)
Also updated some cache variable names to fit the style used for other
warning suppressions, in case we get to re-use the configure-time
result in future.

cmake/gmxManageNvccConfig.cmake

index 9fd71bb787a560a623735b8dfe634b002b6f885f..2affeff09e5620c9a061815b7132b958fc6a788f 100644 (file)
@@ -162,12 +162,18 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     # CUDA header cuda_runtime_api.h in at least CUDA 10.1 uses 0
     # where nullptr would be preferable. GROMACS can't fix these, so
     # must suppress them.
-    GMX_TEST_CXXFLAG(CXXFLAGS_NO_ZERO_AS_NULL_POINTER_CONSTANT "-Wno-zero-as-null-pointer-constant" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
+    GMX_TEST_CXXFLAG(HAS_WARNING_NO_ZERO_AS_NULL_POINTER_CONSTANT "-Wno-zero-as-null-pointer-constant" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
 
     # CUDA header crt/math_functions.h in at least CUDA 10.x and 11.1
     # used throw() specifications that are deprecated in more recent
     # C++ versions. GROMACS can't fix these, so must suppress them.
-    GMX_TEST_CXXFLAG(CXXFLAGS_NO_DEPRECATED_DYNAMIC_EXCEPTION_SPEC "-Wno-deprecated-dynamic-exception-spec" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
+    GMX_TEST_CXXFLAG(HAS_WARNING_NO_DEPRECATED_DYNAMIC_EXCEPTION_SPEC "-Wno-deprecated-dynamic-exception-spec" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
+
+    # CUDA headers cuda_runtime.h and channel_descriptor.h in at least
+    # CUDA 11.0 uses many C-style casts, which are ncessary for this
+    # header to work for C. GROMACS can't fix these, so must suppress
+    # the warnings they generate
+    GMX_TEST_CXXFLAG(HAS_WARNING_NO_OLD_STYLE_CAST "-Wno-old-style-cast" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
 
     # Add these flags to those used for the host compiler. The
     # "-Xcompiler" prefix directs nvcc to only use them for host