Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 87 lines 2.0 kB view raw
1{ lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl 2, rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config 3, config 4, autoAddDriverRunpath 5, enableCuda ? config.cudaSupport 6, cudaPackages 7, enableRocm ? config.rocmSupport 8, rocmPackages 9}: 10 11let 12 rocmList = with rocmPackages; [ rocm-core rocm-runtime rocm-device-libs clr ]; 13 14 rocm = symlinkJoin { 15 name = "rocm"; 16 paths = rocmList; 17 }; 18 19in 20stdenv.mkDerivation rec { 21 pname = "ucx"; 22 version = "1.17.0"; 23 24 src = fetchFromGitHub { 25 owner = "openucx"; 26 repo = "ucx"; 27 rev = "v${version}"; 28 sha256 = "sha256-Qd3c51LeF04haZA4wK6loNZwX2a3ju+ljwdPYPoUKCQ="; 29 }; 30 31 outputs = [ "out" "doc" "dev" ]; 32 33 nativeBuildInputs = [ 34 autoreconfHook 35 doxygen 36 pkg-config 37 ] 38 ++ lib.optionals enableCuda [ 39 cudaPackages.cuda_nvcc 40 autoAddDriverRunpath 41 ]; 42 43 buildInputs = [ 44 libbfd 45 libiberty 46 numactl 47 perl 48 rdma-core 49 zlib 50 ] ++ lib.optionals enableCuda [ 51 cudaPackages.cuda_cudart 52 cudaPackages.cuda_nvml_dev 53 54 ] ++ lib.optionals enableRocm rocmList; 55 56 LDFLAGS = lib.optionals enableCuda [ 57 # Fake libnvidia-ml.so (the real one is deployed impurely) 58 "-L${lib.getLib cudaPackages.cuda_nvml_dev}/lib/stubs" 59 ]; 60 61 configureFlags = [ 62 "--with-rdmacm=${lib.getDev rdma-core}" 63 "--with-dc" 64 "--with-rc" 65 "--with-dm" 66 "--with-verbs=${lib.getDev rdma-core}" 67 ] ++ lib.optionals enableCuda [ "--with-cuda=${cudaPackages.cuda_cudart}" ] 68 ++ lib.optional enableRocm "--with-rocm=${rocm}"; 69 70 postInstall = '' 71 find $out/lib/ -name "*.la" -exec rm -f \{} \; 72 73 moveToOutput bin/ucx_info $dev 74 75 moveToOutput share/ucx/examples $doc 76 ''; 77 78 enableParallelBuilding = true; 79 80 meta = with lib; { 81 description = "Unified Communication X library"; 82 homepage = "https://www.openucx.org"; 83 license = licenses.bsd3; 84 platforms = platforms.linux; 85 maintainers = [ maintainers.markuskowa ]; 86 }; 87}