15 buildBenchmarks ? false,
19 # Can also use cuSOLVER
20 stdenv.mkDerivation (finalAttrs: {
28 ++ lib.optionals buildTests [
31 ++ lib.optionals buildBenchmarks [
34 ++ lib.optionals buildSamples [
38 src = fetchFromGitHub {
41 rev = "rocm-${finalAttrs.version}";
42 hash = "sha256-5b6kPj9yvXvP7f7AyHDTYRoM/EhQZvwkVCfDflFJugc=";
57 ++ lib.optionals buildTests [
60 ++ lib.optionals (buildTests || buildBenchmarks) [
66 "-DCMAKE_C_COMPILER=hipcc"
67 "-DCMAKE_CXX_COMPILER=hipcc"
68 # Manually define CMAKE_INSTALL_<DIR>
69 # See: https://github.com/NixOS/nixpkgs/pull/197838
70 "-DCMAKE_INSTALL_BINDIR=bin"
71 "-DCMAKE_INSTALL_LIBDIR=lib"
72 "-DCMAKE_INSTALL_INCLUDEDIR=include"
74 ++ lib.optionals buildTests [
75 "-DBUILD_CLIENTS_TESTS=ON"
77 ++ lib.optionals buildBenchmarks [
78 "-DBUILD_CLIENTS_BENCHMARKS=ON"
80 ++ lib.optionals buildSamples [
81 "-DBUILD_CLIENTS_SAMPLES=ON"
85 lib.optionalString buildTests ''
87 mv $out/bin/hipsolver-test $test/bin
89 + lib.optionalString buildBenchmarks ''
90 mkdir -p $benchmark/bin
91 mv $out/bin/hipsolver-bench $benchmark/bin
93 + lib.optionalString buildSamples ''
95 mv clients/staging/example-* $sample/bin
96 patchelf $sample/bin/example-* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE"
98 + lib.optionalString (buildTests || buildBenchmarks) ''
102 passthru.updateScript = rocmUpdateScript {
103 name = finalAttrs.pname;
104 owner = finalAttrs.src.owner;
105 repo = finalAttrs.src.repo;
109 description = "ROCm SOLVER marshalling library";
110 homepage = "https://github.com/ROCm/hipSOLVER";
111 license = with licenses; [ mit ];
112 maintainers = teams.rocm.members;
113 platforms = platforms.linux;
115 versions.minor finalAttrs.version != versions.minor stdenv.cc.version
116 || versionAtLeast finalAttrs.version "6.0.0";