Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 116 lines 2.3 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 autoreconfHook, 6 doxygen, 7 numactl, 8 rdma-core, 9 libbfd, 10 libiberty, 11 perl, 12 zlib, 13 symlinkJoin, 14 pkg-config, 15 config, 16 autoAddDriverRunpath, 17 enableCuda ? config.cudaSupport, 18 cudaPackages, 19 enableRocm ? config.rocmSupport, 20 rocmPackages, 21}: 22 23let 24 rocmList = with rocmPackages; [ 25 rocm-core 26 rocm-runtime 27 rocm-device-libs 28 clr 29 ]; 30 31 rocm = symlinkJoin { 32 name = "rocm"; 33 paths = rocmList; 34 }; 35 36 # rocm build fails with gcc stdenv due to unrecognised arg parallel-jobs 37 stdenv' = if enableRocm then rocmPackages.stdenv else stdenv; 38in 39stdenv'.mkDerivation (finalAttrs: { 40 pname = "ucx"; 41 version = "1.18.1"; 42 43 src = fetchFromGitHub { 44 owner = "openucx"; 45 repo = "ucx"; 46 rev = "v${finalAttrs.version}"; 47 sha256 = "sha256-LW57wbQFwW14Z86p9jo1ervkCafVy+pnIQQ9t0i8enY="; 48 }; 49 50 outputs = [ 51 "out" 52 "doc" 53 "dev" 54 ]; 55 56 nativeBuildInputs = [ 57 autoreconfHook 58 doxygen 59 pkg-config 60 ] 61 ++ lib.optionals enableCuda [ 62 cudaPackages.cuda_nvcc 63 autoAddDriverRunpath 64 ]; 65 66 buildInputs = [ 67 libbfd 68 libiberty 69 numactl 70 perl 71 rdma-core 72 zlib 73 ] 74 ++ lib.optionals enableCuda [ 75 cudaPackages.cuda_cudart 76 cudaPackages.cuda_nvml_dev 77 78 ] 79 ++ lib.optionals enableRocm rocmList; 80 81 LDFLAGS = lib.optionals enableCuda [ 82 # Fake libnvidia-ml.so (the real one is deployed impurely) 83 "-L${lib.getLib cudaPackages.cuda_nvml_dev}/lib/stubs" 84 ]; 85 86 configureFlags = [ 87 "--with-rdmacm=${lib.getDev rdma-core}" 88 "--with-dc" 89 "--with-rc" 90 "--with-dm" 91 "--with-verbs=${lib.getDev rdma-core}" 92 ] 93 ++ lib.optionals enableCuda [ "--with-cuda=${cudaPackages.cuda_cudart}" ] 94 ++ lib.optional enableRocm "--with-rocm=${rocm}"; 95 96 postInstall = '' 97 find $out/lib/ -name "*.la" -exec rm -f \{} \; 98 99 moveToOutput bin/ucx_info $dev 100 101 moveToOutput share/ucx/examples $doc 102 ''; 103 104 enableParallelBuilding = true; 105 106 meta = { 107 description = "Unified Communication X library"; 108 homepage = "https://www.openucx.org"; 109 license = lib.licenses.bsd3; 110 platforms = lib.platforms.linux; 111 # LoongArch64 is not supported. 112 # See: https://github.com/openucx/ucx/issues/9873 113 badPlatforms = lib.platforms.loongarch64; 114 maintainers = with lib.maintainers; [ markuskowa ]; 115 }; 116})