1{ stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx
2, config
3, enableCuda ? config.cudaSupport
4, cudaPackages
5, enableAvx ? stdenv.hostPlatform.avxSupport
6, enableSse41 ? stdenv.hostPlatform.sse4_1Support
7, enableSse42 ? stdenv.hostPlatform.sse4_2Support
8} :
9
10stdenv.mkDerivation rec {
11 pname = "ucc";
12 version = "1.3.0";
13
14 src = fetchFromGitHub {
15 owner = "openucx";
16 repo = "ucc";
17 rev = "v${version}";
18 sha256 = "sha256-xcJLYktkxNK2ewWRgm8zH/dMaIoI+9JexuswXi7MpAU=";
19 };
20
21 outputs = [ "out" "dev" ];
22
23 enableParallelBuilding = true;
24
25 postPatch = ''
26
27 for comp in $(find src/components -name Makefile.am); do
28 substituteInPlace $comp \
29 --replace "/bin/bash" "${stdenv.shell}"
30 done
31 '';
32
33 nativeBuildInputs = [ libtool automake autoconf ]
34 ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ];
35 buildInputs = [ ucx ]
36 ++ lib.optionals enableCuda [
37 cudaPackages.cuda_cccl
38 cudaPackages.cuda_cudart
39 ];
40
41
42 preConfigure = ''
43 ./autogen.sh
44 '' + lib.optionalString enableCuda ''
45 configureFlagsArray+=( "--with-nvcc-gencode=${builtins.concatStringsSep " " cudaPackages.cudaFlags.gencode}" )
46 '';
47 configureFlags = [ ]
48 ++ lib.optional enableSse41 "--with-sse41"
49 ++ lib.optional enableSse42 "--with-sse42"
50 ++ lib.optional enableAvx "--with-avx"
51 ++ lib.optional enableCuda "--with-cuda=${cudaPackages.cuda_cudart}";
52
53 postInstall = ''
54 find $out/lib/ -name "*.la" -exec rm -f \{} \;
55
56 moveToOutput bin/ucc_info $dev
57 '';
58
59 meta = with lib; {
60 description = "Collective communication operations API";
61 mainProgram = "ucc_info";
62 license = licenses.bsd3;
63 maintainers = [ maintainers.markuskowa ];
64 platforms = platforms.linux;
65 };
66}