{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , clr , gfortran , rocblas , rocsolver , gtest , lapack-reference , buildTests ? false , buildBenchmarks ? false , buildSamples ? false }: # Can also use cuSOLVER stdenv.mkDerivation (finalAttrs: { pname = "hipsolver"; version = "6.0.2"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ] ++ lib.optionals buildSamples [ "sample" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "hipSOLVER"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-iMfaOv4TdTkmaRHCZOuqUfjO081J6on71+s8nIwwV00="; }; nativeBuildInputs = [ cmake rocm-cmake clr gfortran ]; buildInputs = [ rocblas rocsolver ] ++ lib.optionals buildTests [ gtest ] ++ lib.optionals (buildTests || buildBenchmarks) [ lapack-reference ]; cmakeFlags = [ "-DCMAKE_C_COMPILER=hipcc" "-DCMAKE_CXX_COMPILER=hipcc" # Manually define CMAKE_INSTALL_