1{ lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl
2, rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config
3, enableCuda ? false
4, cudatoolkit
5, enableRocm ? false
6, rocm-core, rocm-runtime, rocm-device-libs, hip
7}:
8
9let
10 # Needed for configure to find all libraries
11 cudatoolkit' = symlinkJoin {
12 inherit (cudatoolkit) name meta;
13 paths = [ cudatoolkit cudatoolkit.lib ];
14 };
15 rocm = symlinkJoin {
16 name = "rocm";
17 paths = [ rocm-core rocm-runtime rocm-device-libs hip ];
18 };
19
20in
21stdenv.mkDerivation rec {
22 pname = "ucx";
23 version = "1.14.1";
24
25 src = fetchFromGitHub {
26 owner = "openucx";
27 repo = "ucx";
28 rev = "v${version}";
29 sha256 = "sha256-oAigiCgbr27pX+kNl+RW1P10TKYFSKrHDK4U4z8WMko=";
30 };
31
32 nativeBuildInputs = [ autoreconfHook doxygen pkg-config ];
33
34 buildInputs = [
35 libbfd
36 libiberty
37 numactl
38 perl
39 rdma-core
40 zlib
41 ] ++ lib.optional enableCuda cudatoolkit
42 ++ lib.optionals enableRocm [ rocm-core rocm-runtime rocm-device-libs hip ];
43
44 configureFlags = [
45 "--with-rdmacm=${rdma-core}"
46 "--with-dc"
47 "--with-rc"
48 "--with-dm"
49 "--with-verbs=${rdma-core}"
50 ] ++ lib.optional enableCuda "--with-cuda=${cudatoolkit'}"
51 ++ lib.optional enableRocm "--with-rocm=${rocm}";
52
53 enableParallelBuilding = true;
54
55 meta = with lib; {
56 description = "Unified Communication X library";
57 homepage = "https://www.openucx.org";
58 license = licenses.bsd3;
59 platforms = platforms.linux;
60 maintainers = [ maintainers.markuskowa ];
61 };
62}