Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / ucx / default.nix
blob627cac56bb737290a7b5b932cddd6356827af01a
1 { lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl
2 , rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config
3 , config
4 , enableCuda ? config.cudaSupport
5 , cudatoolkit
6 , enableRocm ? config.rocmSupport
7 , rocmPackages
8 }:
10 let
11   # Needed for configure to find all libraries
12   cudatoolkit' = symlinkJoin {
13     inherit (cudatoolkit) name meta;
14     paths = [ cudatoolkit cudatoolkit.lib ];
15   };
17   rocmList = with rocmPackages; [ rocm-core rocm-runtime rocm-device-libs clr ];
19   rocm = symlinkJoin {
20     name = "rocm";
21     paths = rocmList;
22   };
25 stdenv.mkDerivation rec {
26   pname = "ucx";
27   version = "1.15.0";
29   src = fetchFromGitHub {
30     owner = "openucx";
31     repo = "ucx";
32     rev = "v${version}";
33     sha256 = "sha256-VxIxrk9qKM6Ncfczl4p2EhXiLNgPaYTmjhqi6/w2ZNY=";
34   };
36   outputs = [ "out" "doc" "dev" ];
38   nativeBuildInputs = [ autoreconfHook doxygen pkg-config ];
40   buildInputs = [
41     libbfd
42     libiberty
43     numactl
44     perl
45     rdma-core
46     zlib
47   ] ++ lib.optional enableCuda cudatoolkit
48   ++ lib.optionals enableRocm rocmList;
50   configureFlags = [
51     "--with-rdmacm=${lib.getDev rdma-core}"
52     "--with-dc"
53     "--with-rc"
54     "--with-dm"
55     "--with-verbs=${lib.getDev rdma-core}"
56   ] ++ lib.optional enableCuda "--with-cuda=${cudatoolkit'}"
57   ++ lib.optional enableRocm "--with-rocm=${rocm}";
59   postInstall = ''
60     find $out/lib/ -name "*.la" -exec rm -f \{} \;
62     moveToOutput bin/ucx_info $dev
64     moveToOutput share/ucx/examples $doc
65   '';
67   enableParallelBuilding = true;
69   meta = with lib; {
70     description = "Unified Communication X library";
71     homepage = "https://www.openucx.org";
72     license = licenses.bsd3;
73     platforms = platforms.linux;
74     maintainers = [ maintainers.markuskowa ];
75   };