Add cudatoolkit to PATH

This commit is contained in:
2026-03-16 11:32:32 +01:00
parent b07c53191a
commit 8ea3d58939
2 changed files with 8 additions and 2 deletions

View File

@@ -19,7 +19,7 @@
symlinkJoin,
zlib,
cudaPackages,
cudaPackages ? null,
enableCuda ? true,
}:
@@ -228,6 +228,7 @@ stdenv.mkDerivation {
passthru = {
inherit llvmMajorVersion;
inherit enableCuda cudaPackages;
};
meta = {

View File

@@ -1,5 +1,6 @@
{
stdenv,
lib,
wrapCCWith,
llvm-intel-unwrapped,
gcc,
@@ -11,6 +12,10 @@ let
cc:
let
targetConfig = stdenv.targetPlatform.config;
extraPath = builtins.concatStringsSep ":" (
[ "${gcc.cc}/bin" ] ++ lib.optionals cc.enableCuda [ "${cc.cudaPackages.cudatoolkit}/bin" ]
);
in
wrapCCWith {
inherit cc;
@@ -40,7 +45,7 @@ let
extraBuildCommands = ''
# FIXME: We should find a better way to modify the PATH instead of using
# this ugly hack. See https://jungle.bsc.es/git/rarias/bscpkgs/issues/9
echo 'path_backup="${gcc.cc}/bin:$path_backup"' >>$out/nix-support/cc-wrapper-hook
echo 'path_backup="${extraPath}:$path_backup"' >>$out/nix-support/cc-wrapper-hook
# Disable hardening by default
echo "" > $out/nix-support/add-hardening.sh