16 , buildBenchmarks ? false
17 , buildSamples ? false
22 stdenv.mkDerivation (finalAttrs: {
28 ] ++ lib.optionals buildTests [
30 ] ++ lib.optionals buildBenchmarks [
32 ] ++ lib.optionals buildSamples [
36 src = fetchFromGitHub {
39 rev = "rocm-${finalAttrs.version}";
40 hash = "sha256-fuYRKdlTrRMwxr3cgMeT3YniPzs4nuvF8YCzr3LLPFM=";
41 fetchSubmodules = true;
53 ] ++ lib.optionals (buildTests || buildBenchmarks || buildSamples) [
62 "-DCMAKE_C_COMPILER=hipcc"
63 "-DCMAKE_CXX_COMPILER=hipcc"
64 "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip"
65 "-DHIP_ROOT_DIR=${clr}"
67 # Manually define CMAKE_INSTALL_<DIR>
68 # See: https://github.com/NixOS/nixpkgs/pull/197838
69 "-DCMAKE_INSTALL_BINDIR=bin"
70 "-DCMAKE_INSTALL_LIBDIR=lib"
71 "-DCMAKE_INSTALL_INCLUDEDIR=include"
72 ] ++ lib.optionals (gpuTargets != [ ]) [
73 "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
74 ] ++ lib.optionals buildTests [
75 "-DBUILD_CLIENTS_TESTS=ON"
76 ] ++ lib.optionals buildBenchmarks [
77 "-DBUILD_CLIENTS_RIDER=ON"
78 ] ++ lib.optionals buildSamples [
79 "-DBUILD_CLIENTS_SAMPLES=ON"
82 postInstall = lib.optionalString buildTests ''
84 mv $out/bin/hipfft-test $test/bin
85 '' + lib.optionalString buildBenchmarks ''
86 mkdir -p $benchmark/bin
87 mv $out/bin/hipfft-rider $benchmark/bin
88 '' + lib.optionalString buildSamples ''
90 mv clients/staging/hipfft_* $sample/bin
91 patchelf $sample/bin/hipfft_* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE"
92 '' + lib.optionalString (buildTests || buildBenchmarks) ''
96 passthru.updateScript = rocmUpdateScript {
97 name = finalAttrs.pname;
98 owner = finalAttrs.src.owner;
99 repo = finalAttrs.src.repo;
103 description = "FFT marshalling library";
104 homepage = "https://github.com/ROCm/hipFFT";
105 license = with licenses; [ mit ];
106 maintainers = teams.rocm.members;
107 platforms = platforms.linux;
108 broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "6.0.0";