{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , rocblas , rocsparse , clr , fmt , gtest , gfortran , lapack-reference , buildTests ? false , buildBenchmarks ? false , gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900" "gfx906:xnack-" ] }: stdenv.mkDerivation (finalAttrs: { pname = "rocsolver"; version = "5.7.1"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocSOLVER"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-qxmjm4tgpCnfJ2SqUXndk6y0MsPJUKHvjv/3Uc0smr4="; }; nativeBuildInputs = [ cmake rocm-cmake clr ] ++ lib.optionals (buildTests || buildBenchmarks) [ gfortran ]; buildInputs = [ rocblas rocsparse fmt ] ++ lib.optionals buildTests [ gtest ] ++ lib.optionals (buildTests || buildBenchmarks) [ lapack-reference ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" "-DCMAKE_CXX_FLAGS=-Wno-switch" # Way too many warnings # Manually define CMAKE_INSTALL_