···4747 ./hooks/mark-for-cudatoolkit-root-hook.sh)
4848 { });
49495050- # Normally propagated by cuda_nvcc or cudatoolkit through their depsHostHostPropagated
5050+ # Currently propagated by cuda_nvcc or cudatoolkit, rather than used directly
5151 setupCudaHook = (final.callPackage
5252 ({ makeSetupHook, backendStdenv }:
5353 makeSetupHook
5454 {
5555 name = "setup-cuda-hook";
56565757+ substitutions.setupCudaHook = placeholder "out";
5858+5759 # Point NVCC at a compatible compiler
5860 substitutions.ccRoot = "${backendStdenv.cc}";
59616062 # Required in addition to ccRoot as otherwise bin/gcc is looked up
6163 # when building CMakeCUDACompilerId.cu
6264 substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++";
6363-6464- # Required by cmake's enable_language(CUDA) to build a test program
6565- # When implementing cross-compilation support: this is
6666- # final.pkgs.targetPackages.cudaPackages.cuda_cudart
6767- # Given the multiple-outputs each CUDA redist has, we can specify the exact components we
6868- # need from the package. CMake requires:
6969- # - the cuda_runtime.h header, which is in the dev output
7070- # - the dynamic library, which is in the lib output
7171- # - the static library, which is in the static output
7272- substitutions.cudartFlags = let cudart = final.cuda_cudart; in
7373- builtins.concatStringsSep " " (final.lib.optionals (final ? cuda_cudart) ([
7474- "-I${final.lib.getDev cudart}/include"
7575- "-L${final.lib.getLib cudart}/lib"
7676- ] ++ final.lib.optionals (builtins.elem "static" cudart.outputs) [
7777- "-L${cudart.static}/lib"
7878- ]));
7965 }
8066 ./hooks/setup-cuda-hook.sh)
8167 { });
···11-# shellcheck shell=bash
22-33-# CMake's enable_language(CUDA) runs a compiler test and it doesn't account for
44-# CUDAToolkit_ROOT. We have to help it locate libcudart
55-export NVCC_APPEND_FLAGS+=" -L@cudartLib@/lib -L@cudartStatic@/lib -I@cudartInclude@/include"