CUDA as Language support: How to provide an alternate toolkit?
Hello, I am trying to use project(myproj LANGUAGES C CXX CUDA)
, but in a cross-compilation environment.
Up to now, it has worked rather well - after specifying CMAKE_CUDA_COMPILER
to /usr/local/cuda/bin/nvcc
and CMAKE_SYSTEM_PROCESSOR
to aarch64
in my toolchain file, it accurately selects the right /usr/local/cuda/targets/aarch64-linux-gnu
include and lib directories.
However, I recently included a header file that is missing in /usr/local/cuda/targets/aarch64-linux-gnu
, but present on the target system (installed using a different tool). I have a local copy of the target system's rootfs, which has the missing headers. I'm looking into this with NVIDIA, but in the mean time I would like to see if I can move forward with a workaround.
My question: is it possible for me to tell CMake to get its includes and libs from a copy of the target's rootfs instead of the local CUDA install on my host machine?
I have been scouring the CUDA-related CMake files under Modules
(ex: CMakeDetermineCUDACompiler.cmake
, CMakeCUDAInformation.cmake
, etc. Basically anything with CUDA in the name) but I haven't been able to find a variable I can set to force this information. I'd like to use this method instead of the deprecated FindCUDA
script.