From 8a34c2a27ffef93e2c55bd155141902c8facef4d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 6 Apr 2023 10:54:23 +0200 Subject: [PATCH] configure: enclose CUDA paths in quotes only in Win autoconf doesn't handle the quotation marks well, in this case it doesn't take the path given by eg. `-L"/usr/local/cuda/lib64"`. This allows at least correct configure in Linux, in Windows, user may perhaps need to set LIBRARY_PATH env variable. --- configure.ac | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 54c989fcd..c2ca78d98 100644 --- a/configure.ac +++ b/configure.ac @@ -2079,10 +2079,6 @@ then nvcc_minor=`"$NVCC" --version |grep release|sed 's/^.*release @<:@0-9@:>@@<:@0-9@:>@*\.\(@<:@0-9@:>@@<:@0-9@:>@*\).*$/\1/'` AC_MSG_RESULT($nvcc_minor) - CUDA_INC="\"-I$CUDA_PATH/include\"" - CUDA_COMPILER="$NVCC" - INC="$INC $CUDA_INC" - if test $ac_cv_sizeof_int_p -eq 8 -a $system = Linux then CUDA_LIB_PATH="$CUDA_PATH/lib64" @@ -2090,8 +2086,9 @@ then CUDA_LIB_PATH="$CUDA_PATH/lib" fi - if test $system = Windows -a $nvcc_major -ge 8; - then + if test $system = Windows; then + CUDA_PATH="\"$CUDA_PATH\"" + CUDA_LIB_PATH="\"$CUDA_LIB_PATH\"" if test $WORD_LEN = 64; then CUDA_LIB_PATH="$CUDA_LIB_PATH/x64" else @@ -2099,7 +2096,10 @@ then fi fi - CUDA_LIB="-L\"$CUDA_LIB_PATH\" -lcudart" + CUDA_LIB="-L$CUDA_LIB_PATH -lcudart" + CUDA_INC="-I$CUDA_PATH/include" + CUDA_COMPILER="$NVCC" + INC="$INC $CUDA_INC" if test $system = MacOSX; then LDFLAGS="$LDFLAGS${LDFLAGS:+ }-rpath $CUDA_LIB_PATH"