about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ucc/default.nix
blob: 68f358b3d3deb44ec11496aefa10a80cadf720b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx
, config
, enableCuda ? config.cudaSupport
, cudaPackages
, enableAvx ? stdenv.hostPlatform.avxSupport
, enableSse41 ? stdenv.hostPlatform.sse4_1Support
, enableSse42 ? stdenv.hostPlatform.sse4_2Support
} :

stdenv.mkDerivation rec {
  pname = "ucc";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "openucx";
    repo = "ucc";
    rev = "v${version}";
    sha256 = "sha256-7Mo9zU0sogGyDdWIfTgUPoR5Z8D722asC2y7sHnKbzs=";
  };

  outputs = [ "out" "dev" ];

  enableParallelBuilding = true;

  postPatch = ''

    for comp in $(find src/components -name Makefile.am); do
      substituteInPlace $comp \
        --replace "/bin/bash" "${stdenv.shell}"
    done
  '';

  nativeBuildInputs = [ libtool automake autoconf ]
    ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ];
  buildInputs = [ ucx ]
    ++ lib.optionals enableCuda [
      cudaPackages.cuda_cccl
      cudaPackages.cuda_cudart
    ];


  preConfigure = ''
    ./autogen.sh
  '' + lib.optionalString enableCuda ''
    configureFlagsArray+=( "--with-nvcc-gencode=${builtins.concatStringsSep " " cudaPackages.cudaFlags.gencode}" )
  '';
  configureFlags = [ ]
   ++ lib.optional enableSse41 "--with-sse41"
   ++ lib.optional enableSse42 "--with-sse42"
   ++ lib.optional enableAvx "--with-avx"
   ++ lib.optional enableCuda "--with-cuda=${cudaPackages.cuda_cudart}";

  postInstall = ''
    find $out/lib/ -name "*.la" -exec rm -f \{} \;

    moveToOutput bin/ucc_info $dev
  '';

  meta = with lib; {
    description = "Collective communication operations API";
    license = licenses.bsd3;
    maintainers = [ maintainers.markuskowa ];
    platforms = platforms.linux;
  };
}