cmake cuda cross-compilation can't compile CMakeCUDACompilerId.cu
Hello. I try to cross-compile Linux(x86_64)->Linux(aarch64). For generic c++ all work fine. Cmake version 3.22
Toolchain file:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_SYSROOT /aarch64-image)
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)
set(CMAKE_Fortran_COMPILER /usr/bin/aarch64-linux-gnu-gfortran)
set(CMAKE_CUDA_HOST_COMPILER /usr/bin/aarch64-linux-gnu-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
set(CUDAToolkit_ROOT /usr/local/cuda-10.0/targets/aarch64-linux/) #it's inside CMAKE_SYSROOT
My CMakeLists.txt
starts from project(app1 LANGUAGES CXX CUDA)
When i start cmake configure, i got error at stage check nvcc
, it can't compile test app:
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
It can't link library cudadevrt
and cudart_static
, of course it is inside CMAKE_SYSROOT but cmake even don't try to search it there.
Is there a way to indicate cmake where to search this libs?