fix build after migration to IEEE 128-bit long double on ppc64le

This commit is contained in:
Dan Horák 2022-06-14 17:03:35 +00:00
parent 5d4a8321fe
commit 4578df64e4
2 changed files with 28 additions and 0 deletions

View File

@ -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

View File

@ -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