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