···47 ./hooks/mark-for-cudatoolkit-root-hook.sh)
48 { });
4950- # Normally propagated by cuda_nvcc or cudatoolkit through their depsHostHostPropagated
51 setupCudaHook = (final.callPackage
52 ({ makeSetupHook, backendStdenv }:
53 makeSetupHook
54 {
55 name = "setup-cuda-hook";
560057 # Point NVCC at a compatible compiler
58 substitutions.ccRoot = "${backendStdenv.cc}";
5960 # Required in addition to ccRoot as otherwise bin/gcc is looked up
61 # when building CMakeCUDACompilerId.cu
62 substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++";
63-64- # Required by cmake's enable_language(CUDA) to build a test program
65- # When implementing cross-compilation support: this is
66- # final.pkgs.targetPackages.cudaPackages.cuda_cudart
67- # Given the multiple-outputs each CUDA redist has, we can specify the exact components we
68- # need from the package. CMake requires:
69- # - the cuda_runtime.h header, which is in the dev output
70- # - the dynamic library, which is in the lib output
71- # - the static library, which is in the static output
72- substitutions.cudartFlags = let cudart = final.cuda_cudart; in
73- builtins.concatStringsSep " " (final.lib.optionals (final ? cuda_cudart) ([
74- "-I${final.lib.getDev cudart}/include"
75- "-L${final.lib.getLib cudart}/lib"
76- ] ++ final.lib.optionals (builtins.elem "static" cudart.outputs) [
77- "-L${cudart.static}/lib"
78- ]));
79 }
80 ./hooks/setup-cuda-hook.sh)
81 { });
···47 ./hooks/mark-for-cudatoolkit-root-hook.sh)
48 { });
4950+ # Currently propagated by cuda_nvcc or cudatoolkit, rather than used directly
51 setupCudaHook = (final.callPackage
52 ({ makeSetupHook, backendStdenv }:
53 makeSetupHook
54 {
55 name = "setup-cuda-hook";
5657+ substitutions.setupCudaHook = placeholder "out";
58+59 # Point NVCC at a compatible compiler
60 substitutions.ccRoot = "${backendStdenv.cc}";
6162 # Required in addition to ccRoot as otherwise bin/gcc is looked up
63 # when building CMakeCUDACompilerId.cu
64 substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++";
000000000000000065 }
66 ./hooks/setup-cuda-hook.sh)
67 { });
···1-# shellcheck shell=bash
2-3-# CMake's enable_language(CUDA) runs a compiler test and it doesn't account for
4-# CUDAToolkit_ROOT. We have to help it locate libcudart
5-export NVCC_APPEND_FLAGS+=" -L@cudartLib@/lib -L@cudartStatic@/lib -I@cudartInclude@/include"