From fe42dee0300e6eb6564effdb0ff2ac9274afbb51 Mon Sep 17 00:00:00 2001 From: "Andy Chun @noneucat" Date: Mon, 18 Jan 2021 13:34:47 -0800 Subject: [PATCH 1/2] 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 c18eb9d534a..747de25142e 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 From cf42508bbd301a4f360cdd7da6fa66879b42695d Mon Sep 17 00:00:00 2001 From: "Andy Chun @noneucat" Date: Mon, 18 Jan 2021 13:35:11 -0800 Subject: [PATCH 2/2] ethminer: do not propagate host flags to nvcc and remove clang stdenv dependency --- pkgs/tools/misc/ethminer/default.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/misc/ethminer/default.nix b/pkgs/tools/misc/ethminer/default.nix index 22278cb9a4d..921cb684ddb 100644 --- a/pkgs/tools/misc/ethminer/default.nix +++ b/pkgs/tools/misc/ethminer/default.nix @@ -1,7 +1,6 @@ { lib, stdenv, - clangStdenv, fetchFromGitHub, opencl-headers, cmake, @@ -17,13 +16,9 @@ openssl, pkg-config, cli11 -}@args: +}: -# Note that this requires clang < 9.0 to build, and currently -# clangStdenv provides clang 7.1 which satisfies the requirement. -let stdenv = if cudaSupport then clangStdenv else args.stdenv; - -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { pname = "ethminer"; version = "0.19.0"; @@ -43,9 +38,11 @@ in stdenv.mkDerivation rec { "-DAPICORE=ON" "-DETHDBUS=OFF" "-DCMAKE_BUILD_TYPE=Release" - ] ++ lib.optionals (!cudaSupport) [ + ] ++ (if cudaSupport then [ + "-DCUDA_PROPAGATE_HOST_FLAGS=off" + ] else [ "-DETHASHCUDA=OFF" # on by default - ]; + ]); nativeBuildInputs = [ cmake @@ -81,6 +78,5 @@ in stdenv.mkDerivation rec { platforms = [ "x86_64-linux" ]; maintainers = with maintainers; [ nand0p atemu ]; license = licenses.gpl3Only; - broken = cudaSupport; }; }