Simply symlinking doesn't actually quite work as evidenced by my CMake CI bot (<https://open.cdash.org/test/498767666>), where I applied it manually.

Having a shim /usr/lib/cuda/include/cuda.h:

    #pragma push_macro("CUDA_VERSION")
    #define CUDA_VERSION 11030
    #pragma pop_macro("CUDA_VERSION")
    #include_next <cuda.h>

Solves the issue. This was suggested in the LLVM discussion (<https://reviews.llvm.org/D108247#3025238>).

It is unclear to me why the symlink variant didn't work as previously when Clang detected the version using version.h having the cuda.h simply in /usr/include and thus the default search path was fine. Though Clang is noted to be sensitive to the ordering of CUDA and other includes due to it wrapping/shimming them to make them work with Clang.

Reply via email to