Skip to content

Commit 79a25dc

Browse files
committed
BUILD/CUDA: Fix NVCC search when --with-cuda passed explicitly
1 parent 401c127 commit 79a25dc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

config/m4/cuda.m4

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ AC_DEFUN([AC_LANG_COMPILER(CUDA)], [
2020
2121
AC_ARG_VAR([NVCC], [nvcc compiler path])
2222
AC_ARG_VAR([NVCCFLAGS], [nvcc compiler flags])
23-
BASE_NVCCFLAGS="$BASE_NVCCFLAGS $with_nvcc_gencode"
24-
AC_CHECK_TOOL([NVCC], [nvcc], [])
23+
BASE_NVCCFLAGS="$BASE_NVCCFLAGS -g $with_nvcc_gencode"
24+
AS_IF([test ! -z "$with_cuda" -a -d "$with_cuda/bin"],
25+
[CUDA_BIN_PATH="$with_cuda/bin"],
26+
[CUDA_BIN_PATH=""])
27+
AC_PATH_PROG([NVCC], [nvcc], [], [$CUDA_BIN_PATH:$PATH])
2528
AC_SUBST([NVCC], [$NVCC])
2629
])
2730

@@ -82,7 +85,6 @@ AS_IF([test "x$cuda_checked" != "xyes"],
8285
CUDART_LIBS=""
8386
CUDART_STATIC_LIBS=""
8487
NVML_LIBS=""
85-
CUDA_BIN_PATH=""
8688
CUDA_LIB_DIRS=""
8789
8890
AS_IF([test ! -z "$with_cuda" -a "x$with_cuda" != "xyes" -a "x$with_cuda" != "xguess"],
@@ -91,7 +93,6 @@ AS_IF([test "x$cuda_checked" != "xyes"],
9193
ucx_check_cuda_libdir="$with_cuda/lib$libsuff"
9294
CUDA_CPPFLAGS="-I$with_cuda/include"
9395
CUDA_LDFLAGS="-L$ucx_check_cuda_libdir -L$ucx_check_cuda_libdir/stubs"
94-
CUDA_BIN_PATH="$with_cuda/bin"
9596
CUDA_LIB_DIRS="$ucx_check_cuda_libdir $with_cuda/compat"])
9697
9798
CPPFLAGS="$CPPFLAGS $CUDA_CPPFLAGS"

0 commit comments

Comments
 (0)