···
cudaSupport ? config.cudaSupport or false,
···
pname = "paddlepaddle" + lib.optionalString cudaSupport "-gpu";
pyShortVersion = "cp${builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion}";
cpuOrGpu = if cudaSupport then "gpu" else "cpu";
allHashAndPlatform = import ./binary-hashes.nix;
-
allHashAndPlatform."${stdenv.system}"."${cpuOrGpu}"."${pyShortVersion}"
-
or (throw "${pname} has no binary-hashes.nix entry for '${stdenv.system}.${cpuOrGpu}.${pyShortVersion}' attribute");
-
platform = allHashAndPlatform."${stdenv.system}".platform;
···
···
-
disabled = pythonOlder "3.9" || pythonAtLeast "3.11";
-
libraryPath = lib.makeLibraryPath (
-
# TODO: remove openssl_1_1 and zlib, maybe by building paddlepaddle from
-
# source as suggested in the following comment:
-
# https://github.com/NixOS/nixpkgs/pull/243583#issuecomment-1641450848
-
++ lib.optionals cudaSupport (
-
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
-
p=$(patchelf --print-rpath $1)
-
patchelf --set-rpath "$p:$libraryPath" $1
-
${lib.optionalString cudaSupport ''
-
fixRunPath $out/${python.sitePackages}/paddle/fluid/libpaddle.so
nativeBuildInputs = [ addDriverRunpath ];
-
propagatedBuildInputs = [
···
pythonImportsCheck = [ "paddle" ];
···
-
description = "PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署";
homepage = "https://github.com/PaddlePaddle/Paddle";
-
license = licenses.asl20;
-
maintainers = with maintainers; [ happysalada ];
-
++ optionals (!cudaSupport) [
···
cudaSupport ? config.cudaSupport or false,
···
pname = "paddlepaddle" + lib.optionalString cudaSupport "-gpu";
+
version = if cudaSupport then "2.6.2" else "3.0.0";
pyShortVersion = "cp${builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion}";
cpuOrGpu = if cudaSupport then "gpu" else "cpu";
allHashAndPlatform = import ./binary-hashes.nix;
+
allHashAndPlatform."${stdenv.hostPlatform.system}"."${cpuOrGpu}"."${pyShortVersion}"
+
or (throw "${pname} has no binary-hashes.nix entry for '${stdenv.hostPlatform.system}.${cpuOrGpu}.${pyShortVersion}' attribute");
+
platform = allHashAndPlatform."${stdenv.hostPlatform.system}".platform;
···
···
+
(pythonOlder "3.11" || pythonAtLeast "3.13")
+
(pythonOlder "3.12" || pythonAtLeast "3.14");
nativeBuildInputs = [ addDriverRunpath ];
···
pythonImportsCheck = [ "paddle" ];
···
+
postFixup = lib.optionalString stdenv.hostPlatform.isLinux (
+
libraryPath = lib.makeLibraryPath (
+
(lib.getLib stdenv.cc.cc)
+
++ lib.optionals cudaSupport (
+
p=$(patchelf --print-rpath $1)
+
patchelf --set-rpath "$p:${libraryPath}" $1
+
${lib.optionalString cudaSupport ''
+
fixRunPath $out/${python.sitePackages}/paddle/base/libpaddle.so
+
fixRunPath $out/${python.sitePackages}/paddle/libs/lib*.so
+
description = "Machine Learning Framework from Industrial Practice";
homepage = "https://github.com/PaddlePaddle/Paddle";
+
license = lib.licenses.asl20;
+
maintainers = with lib.maintainers; [ happysalada ];
+
++ lib.optionals (!cudaSupport) [