mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 12:43:52 +00:00
f89973e36a
* python310Packages.paddle-bfloat: build from source * Update pkgs/development/python-modules/paddle-bfloat/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> --------- Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>
47 lines
1.0 KiB
Nix
47 lines
1.0 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, pythonOlder
|
|
, pythonAtLeast
|
|
, numpy
|
|
}:
|
|
let
|
|
pname = "paddle-bfloat";
|
|
version = "0.1.7";
|
|
in
|
|
buildPythonPackage {
|
|
inherit pname version;
|
|
format = "setuptools";
|
|
|
|
src = fetchPypi {
|
|
pname = "paddle_bfloat";
|
|
inherit version;
|
|
hash = "sha256-mrjQCtLsXOvqeHHMjuMx65FvMfZ2+wTh1ao9ZJE+9xw=";
|
|
};
|
|
|
|
postPatch = ''
|
|
sed '1i#include <memory>' -i bfloat16.cc # gcc12
|
|
# replace deprecated function for python3.11
|
|
substituteInPlace bfloat16.cc \
|
|
--replace "Py_TYPE(&NPyBfloat16_Descr) = &PyArrayDescr_Type" "Py_SET_TYPE(&NPyBfloat16_Descr, &PyArrayDescr_Type)"
|
|
'';
|
|
|
|
disabled = pythonOlder "3.9" || pythonAtLeast "3.12";
|
|
|
|
propagatedBuildInputs = [
|
|
numpy
|
|
];
|
|
|
|
pythonImportsCheck = [ "paddle_bfloat" ];
|
|
|
|
# upstream has no tests
|
|
doCheck = false;
|
|
|
|
meta = with lib; {
|
|
description = "Paddle numpy bfloat16 package";
|
|
homepage = "https://pypi.org/project/paddle-bfloat";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ happysalada ];
|
|
};
|
|
}
|