{ lib, stdenv, fetchFromGitHub, rocmUpdateScript, cmake, rocm-cmake, rocsparse, clr, gfortran, git, gtest, openmp, buildTests ? false, buildBenchmarks ? false, buildSamples ? false, gpuTargets ? [ ], }: # This can also use cuSPARSE as a backend instead of rocSPARSE stdenv.mkDerivation (finalAttrs: { pname = "hipsparse"; version = "6.3.3"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildSamples [ "sample" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "hipSPARSE"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-3a7fKpYyiqG3aGOg7YrTHmKoH4rgTVLD16DvrZ3YY1g="; }; nativeBuildInputs = [ cmake rocm-cmake clr gfortran ]; buildInputs = [ rocsparse git ] ++ lib.optionals (buildTests || buildBenchmarks) [ gtest ] ++ lib.optionals (buildTests || buildSamples) [ openmp ]; cmakeFlags = [ # Manually define CMAKE_INSTALL_