{ lib, stdenv, fetchFromGitHub, fetchzip, rocmUpdateScript, cmake, rocm-cmake, rocprim, clr, gfortran, git, gtest, boost, python3Packages, buildTests ? false, buildBenchmarks ? false, # Seems to depend on tests gpuTargets ? clr.localGpuTargets or clr.gpuTargets, }: stdenv.mkDerivation (finalAttrs: { pname = "rocsparse${clr.gpuArchSuffix}"; version = "6.4.3"; outputs = [ "out" ] ++ lib.optionals (buildTests || buildBenchmarks) [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocSPARSE"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-PrLyqHMAJYACkBMz97iBfwCaQ9Kf1IBL7IEf1IF1/m0="; }; nativeBuildInputs = [ cmake # no ninja, it buffers console output and nix times out long periods of no output rocm-cmake clr gfortran ]; buildInputs = [ rocprim git ] ++ lib.optionals (buildTests || buildBenchmarks) [ gtest boost python3Packages.python python3Packages.pyyaml ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=amdclang++" # Manually define CMAKE_INSTALL_