From 4578df64e4c923d1c3edf1213a209500e7caf453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Tue, 14 Jun 2022 17:03:35 +0000 Subject: [PATCH] fix build after migration to IEEE 128-bit long double on ppc64le --- h5py-3.7.0-ppc-float128.patch | 23 +++++++++++++++++++++++ h5py.spec | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 h5py-3.7.0-ppc-float128.patch diff --git a/h5py-3.7.0-ppc-float128.patch b/h5py-3.7.0-ppc-float128.patch new file mode 100644 index 0000000..71dbd80 --- /dev/null +++ b/h5py-3.7.0-ppc-float128.patch @@ -0,0 +1,23 @@ +diff -up h5py-3.7.0/h5py/h5t.pyx.orig h5py-3.7.0/h5py/h5t.pyx +--- h5py-3.7.0/h5py/h5t.pyx.orig 2022-06-14 16:31:22.964458579 +0000 ++++ h5py-3.7.0/h5py/h5t.pyx 2022-06-14 16:31:46.404768118 +0000 +@@ -282,18 +282,7 @@ cdef (int, int, int) _correct_float_info + nmant = finfo.nmant + maxexp = finfo.maxexp + minexp = finfo.minexp +- # workaround for numpy's buggy finfo on float128 on ppc64 archs +- if ftype_ == np.longdouble and MACHINE == 'ppc64': +- # values reported by hdf5 +- nmant = 116 +- maxexp = 1024 +- minexp = -1022 +- elif ftype_ == np.longdouble and MACHINE == 'ppc64le': +- # values reported by hdf5 +- nmant = 52 +- maxexp = 1024 +- minexp = -1022 +- elif nmant == 63 and finfo.nexp == 15: ++ if nmant == 63 and finfo.nexp == 15: + # This is an 80-bit float, correct mantissa size + nmant += 1 + diff --git a/h5py.spec b/h5py.spec index 0e34fc7..fba0d51 100644 --- a/h5py.spec +++ b/h5py.spec @@ -8,6 +8,10 @@ Release: 2%{?dist} License: BSD URL: http://www.h5py.org/ Source0: https://files.pythonhosted.org/packages/source/h/h5py/h5py-%{version}.tar.gz +# drop the unnecessary workaround for float128 type after +# https://fedoraproject.org/wiki/Changes/PPC64LE_Float128_Transition +# in F-36 +Patch0: h5py-3.7.0-ppc-float128.patch BuildRequires: gcc BuildRequires: hdf5-devel BuildRequires: liblzf-devel @@ -76,6 +80,7 @@ Requires: mpich %prep %setup -q -c -n %{name}-%{version} +%patch0 mv %{name}-%{version} serial cd serial %{__python3} api_gen.py