cuda_select_nvcc_arch_flags does not work with CMAKE_EXECUTABLE_SUFFIX
Repro case CMakeLists.txt:
cmake_minimum_required(VERSION 3.15.2)
project(foo)
set(CMAKE_EXECUTABLE_SUFFIX "-dbg${CMAKE_EXECUTABLE_SUFFIX}")
find_package(CUDA)
cuda_select_nvcc_arch_flags(ARCH_FLAGS "Auto")
list(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
message("ARCH_FLAGS = ${ARCH_FLAGS}")
cmake
output:
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /opt/cuda (found version "10.1")
CMake Error: Unable to find the executable at any of:
/home/lahwaacz/stuff/cmake_bug/build/CMakeFiles/CMakeTmp/cmTC_f272f-dbg
/home/lahwaacz/stuff/cmake_bug/build/CMakeFiles/CMakeTmp/Debug/cmTC_f272f-dbg
/home/lahwaacz/stuff/cmake_bug/build/CMakeFiles/CMakeTmp/Development/cmTC_f272f-dbg
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2;6.0;6.1;7.0;7.0+PTX;7.5;7.5+PTX
ARCH_FLAGS = -gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_70,code=compute_70;-gencode;arch=compute_75,code=compute_75
-- Configuring incomplete, errors occurred!
See also "/home/lahwaacz/stuff/cmake_bug/build/CMakeFiles/CMakeOutput.log".
See also "/home/lahwaacz/stuff/cmake_bug/build/CMakeFiles/CMakeError.log".