From fe42dee0300e6eb6564effdb0ff2ac9274afbb51 Mon Sep 17 00:00:00 2001 From: "Andy Chun @noneucat" Date: Mon, 18 Jan 2021 13:34:47 -0800 Subject: [PATCH] cudatoolkit: set CUDA_HOST_COMPILER cmake flag to supported gcc version --- pkgs/development/compilers/cudatoolkit/common.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index c18eb9d534a2..747de25142e5 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -147,6 +147,10 @@ stdenv.mkDerivation rec { mkdir -p $out/nix-support echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook + # Set the host compiler to be used by nvcc for CMake-based projects: + # https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables + echo "cmakeFlags+=' -DCUDA_HOST_COMPILER=${gcc}/bin'" >> $out/nix-support/setup-hook + # Move some libraries to the lib output so that programs that # depend on them don't pull in this entire monstrosity. mkdir -p $lib/lib