{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , rocblas , hip , fmt , gtest , gfortran , lapack-reference , buildTests ? false , buildBenchmarks ? false , gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900" "gfx906:xnack-" ] }: stdenv.mkDerivation (finalAttrs: { pname = "rocsolver"; version = "5.4.4"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "rocSOLVER"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-UHUcA9CVPuYFpE2DTvRrRMMj51yNPo5wMTKnByL2RTg="; }; nativeBuildInputs = [ cmake rocm-cmake hip ] ++ lib.optionals (buildTests || buildBenchmarks) [ gfortran ]; buildInputs = [ rocblas fmt ] ++ lib.optionals buildTests [ gtest ] ++ lib.optionals (buildTests || buildBenchmarks) [ lapack-reference ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" # Manually define CMAKE_INSTALL_