CUDA-related bustage with 3.25.1 and Devuan Daedalus/Debian bookwork
I'm trying to build my cuda-api-wrappers
library, on a machine with:
- CMake 3.25.1
- Basically any CUDA version between 11.0 and 11.7 (including 11.0 and 11.7)
- Devuan Daedalus ( = Debian bookwork without systemd)
- Various definitions of
CUDAHOSTCXX
as the environment variable: undefined, /usr/bin/g++-11 and a G++ 8.5.0 I had built a while ago. Also settingCXX
to match that, for good measure.
and this always fails. It either fails because of an incompatible compiler (e.g. 11.0 and g++-11), which is not the bug here, or when the compiler is compatible - what I get is, e.g.:
-- The CUDA compiler identification is NVIDIA 11.7.64
-- The CXX compiler identification is GNU 11.3.0
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-11 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDAToolkit: /usr/local/cuda/include (found suitable version "11.7.64", minimum required is "9.0")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
CMake Error at CMakeLists.txt:51 (target_compile_features):
target_compile_features called with invalid arguments
CMake Error at CMakeLists.txt:52 (target_include_directories):
target_include_directories called with invalid arguments
CMake Error at CMakeLists.txt:58 (target_link_libraries):
The INTERFACE, PUBLIC or PRIVATE option must appear as the second argument,
just after the target name.
CMake Error at CMakeLists.txt:65 (add_library):
add_library ALIAS requires exactly one target argument.
CMake Error at CMakeLists.txt:67 (set_target_properties):
set_target_properties Can not find target to add properties to:
src/cuda/api/multi_wrapper_impls/graph.cpp
CMake Error at CMakeLists.txt:51 (target_compile_features):
target_compile_features called with invalid arguments
CMake Error at CMakeLists.txt:52 (target_include_directories):
target_include_directories called with invalid arguments
CMake Error at CMakeLists.txt:58 (target_link_libraries):
The INTERFACE, PUBLIC or PRIVATE option must appear as the second argument,
just after the target name.
CMake Error at CMakeLists.txt:65 (add_library):
add_library ALIAS requires exactly one target argument.
CMake Error at CMakeLists.txt:67 (set_target_properties):
set_target_properties Can not find target to add properties to:
src/cuda/api/multi_wrapper_impls/graph.cpp
CMake Error at CMakeLists.txt:51 (target_compile_features):
target_compile_features called with invalid arguments
CMake Error at CMakeLists.txt:52 (target_include_directories):
target_include_directories called with invalid arguments
CMake Error at CMakeLists.txt:58 (target_link_libraries):
The INTERFACE, PUBLIC or PRIVATE option must appear as the second argument,
just after the target name.
CMake Error at CMakeLists.txt:65 (add_library):
add_library ALIAS requires exactly one target argument.
CMake Error at CMakeLists.txt:67 (set_target_properties):
set_target_properties Can not find target to add properties to:
src/cuda/api/multi_wrapper_impls/graph.cpp
CMake Error at CMakeLists.txt:73 (target_link_libraries):
The plain signature for target_link_libraries has already been used with
the target "caw_rtc". All uses of target_link_libraries with a target must
be either all-keyword or all-plain.
The uses of the plain signature are here:
* CMakeLists.txt:58 (target_link_libraries)
CMake Error at CMakeLists.txt:83 (target_link_libraries):
The plain signature for target_link_libraries has already been used with
the target "caw_nvtx". All uses of target_link_libraries with a target
must be either all-keyword or all-plain.
The uses of the plain signature are here:
* CMakeLists.txt:58 (target_link_libraries)
CMake Error at CMakeLists.txt:113 (install):
install TARGETS given target "src/cuda/api/multi_wrapper_impls/graph.cpp"
which does not exist.
CMake Error at CMakeLists.txt:122 (export):
export Export set "cuda-api-wrappers_export" not found.
-- Configuring incomplete, errors occurred!
The first lines where this is triggered are:
target_compile_features(${caw_lib} INTERFACE cxx_std_11) # This means _at least_ C++11
target_include_directories(
${caw_lib}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_link_libraries(${caw_lib} INTERFACE CUDA::cudart CUDA::cuda_driver)
See the full CMakeListsts.txt
here.