Skip to content

Commit eb4bb6b

Browse files
committed
build: Fix CUDA build checks
When converting the project to C++, I missed the two _Static_assert() calls in the CUDA configure checks, resulting in those tests always failing. Convert to static_assert() such that the tests will work with either a C or C++ compiler. Signed-off-by: Brian Barrett <[email protected]>
1 parent f69cd81 commit eb4bb6b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

m4/check_pkg_cuda.m4

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ AC_DEFUN([CHECK_PKG_CUDA], [
5858
[
5959
AC_MSG_CHECKING([if CUDA 11.3+ is available for GDR Write Flush support])
6060
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
61+
#ifndef __cplusplus
62+
#include <assert.h>
63+
#endif
6164
#include <cuda.h>
62-
_Static_assert(CUDA_VERSION >= 11030, "cudart>=11030 required for cuFlushGPUDirectRDMAWrites");
65+
static_assert(CUDA_VERSION >= 11030, "cudart>=11030 required for cuFlushGPUDirectRDMAWrites");
6366
])],[ check_cuda_gdr_flush_define=1 chk_result=yes ],
6467
[ check_cuda_gdr_flush_define=0 chk_result=no ])
6568
AC_MSG_RESULT(${chk_result})
@@ -70,8 +73,11 @@ AC_DEFUN([CHECK_PKG_CUDA], [
7073
[
7174
AC_MSG_CHECKING([if CUDA 11.7+ is available for DMA-BUF support])
7275
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
76+
#ifndef __cplusplus
77+
#include <assert.h>
78+
#endif
7379
#include <cuda.h>
74-
_Static_assert(CUDA_VERSION >= 11070, "cudart>=11070 required for DMABUF");
80+
static_assert(CUDA_VERSION >= 11070, "cudart>=11070 required for DMABUF");
7581
])],[ check_cuda_dmabuf_define=1 chk_result=yes ],
7682
[ check_cuda_dmabuf_define=0 chk_result=no ])
7783
AC_MSG_RESULT(${chk_result})

0 commit comments

Comments
 (0)