14 , buildBenchmarks ? false
15 , buildSamples ? false
18 # Can also use cuSOLVER
19 stdenv.mkDerivation (finalAttrs: {
25 ] ++ lib.optionals buildTests [
27 ] ++ lib.optionals buildBenchmarks [
29 ] ++ lib.optionals buildSamples [
33 src = fetchFromGitHub {
36 rev = "rocm-${finalAttrs.version}";
37 hash = "sha256-5b6kPj9yvXvP7f7AyHDTYRoM/EhQZvwkVCfDflFJugc=";
50 ] ++ lib.optionals buildTests [
52 ] ++ lib.optionals (buildTests || buildBenchmarks) [
57 "-DCMAKE_C_COMPILER=hipcc"
58 "-DCMAKE_CXX_COMPILER=hipcc"
59 # Manually define CMAKE_INSTALL_<DIR>
60 # See: https://github.com/NixOS/nixpkgs/pull/197838
61 "-DCMAKE_INSTALL_BINDIR=bin"
62 "-DCMAKE_INSTALL_LIBDIR=lib"
63 "-DCMAKE_INSTALL_INCLUDEDIR=include"
64 ] ++ lib.optionals buildTests [
65 "-DBUILD_CLIENTS_TESTS=ON"
66 ] ++ lib.optionals buildBenchmarks [
67 "-DBUILD_CLIENTS_BENCHMARKS=ON"
68 ] ++ lib.optionals buildSamples [
69 "-DBUILD_CLIENTS_SAMPLES=ON"
72 postInstall = lib.optionalString buildTests ''
74 mv $out/bin/hipsolver-test $test/bin
75 '' + lib.optionalString buildBenchmarks ''
76 mkdir -p $benchmark/bin
77 mv $out/bin/hipsolver-bench $benchmark/bin
78 '' + lib.optionalString buildSamples ''
80 mv clients/staging/example-* $sample/bin
81 patchelf $sample/bin/example-* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE"
82 '' + lib.optionalString (buildTests || buildBenchmarks) ''
86 passthru.updateScript = rocmUpdateScript {
87 name = finalAttrs.pname;
88 owner = finalAttrs.src.owner;
89 repo = finalAttrs.src.repo;
93 description = "ROCm SOLVER marshalling library";
94 homepage = "https://github.com/ROCm/hipSOLVER";
95 license = with licenses; [ mit ];
96 maintainers = teams.rocm.members;
97 platforms = platforms.linux;
98 broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "6.0.0";