1{ stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx
2, config
3, enableCuda ? config.cudaSupport
4, cudatoolkit
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.2.0";
13
14 src = fetchFromGitHub {
15 owner = "openucx";
16 repo = "ucc";
17 rev = "v${version}";
18 sha256 = "sha256-7Mo9zU0sogGyDdWIfTgUPoR5Z8D722asC2y7sHnKbzs=";
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 preConfigure = ''
34 ./autogen.sh
35 '';
36
37 nativeBuildInputs = [ libtool automake autoconf ];
38 buildInputs = [ ucx ]
39 ++ lib.optional enableCuda cudatoolkit;
40
41 configureFlags = [ ]
42 ++ lib.optional enableSse41 "--with-sse41"
43 ++ lib.optional enableSse42 "--with-sse42"
44 ++ lib.optional enableAvx "--with-avx"
45 ++ lib.optional enableCuda "--with-cuda=${cudatoolkit}";
46
47 postInstall = ''
48 find $out/lib/ -name "*.la" -exec rm -f \{} \;
49
50 moveToOutput bin/ucc_info $dev
51 '';
52
53 meta = with lib; {
54 description = "Collective communication operations API";
55 license = licenses.bsd3;
56 maintainers = [ maintainers.markuskowa ];
57 platforms = platforms.linux;
58 };
59}