nixpkgs/pkgs/development/libraries/ucc/default.nix
Someone Serge 471dbe9bcf
treewide: consume config.cudaSupport as required
Eliminate uses of `config.cudaSupport or false` and alike, since the
option is now declared in config.nix with a default value

fd .nix -t f -x sed 's/config\.cudaSupport or false, cudaPackages [?] [{][}]/config.cudaSupport, cudaPackages ? { }/' '{}' -i
fd .nix -t f -x sed 's/config\.cudaSupport or false/config.cudaSupport/' '{}' -i
fd .nix -t f -x sed 's/cudaSupport = pkgs.config.cudaSupport/inherit (pkgs.config) cudaSupport/' '{}' -i
fd .nix -t f -x sed 's/cudaSupport = config.cudaSupport/inherit (config) cudaSupport/' '{}' -i
2023-07-20 18:08:19 +03:00

52 lines
1.3 KiB
Nix

{ stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx
, config
, enableCuda ? config.cudaSupport
, cudatoolkit
, 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=";
};
enableParallelBuilding = true;
postPatch = ''
for comp in $(find src/components -name Makefile.am); do
substituteInPlace $comp \
--replace "/bin/bash" "${stdenv.shell}"
done
'';
preConfigure = ''
./autogen.sh
'';
nativeBuildInputs = [ libtool automake autoconf ];
buildInputs = [ ucx ]
++ lib.optional enableCuda cudatoolkit;
configureFlags = [ ]
++ lib.optional enableSse41 "--with-sse41"
++ lib.optional enableSse42 "--with-sse42"
++ lib.optional enableAvx "--with-avx"
++ lib.optional enableCuda "--with-cuda=${cudatoolkit}";
meta = with lib; {
description = "Collective communication operations API";
license = licenses.bsd3;
maintainers = [ maintainers.markuskowa ];
platforms = platforms.linux;
};
}