Accepting request 209593 from devel:languages:python

fix for ppc64le, please forward to factory (forwarded request 209578 from adrianSuSE)

OBS-URL: https://build.opensuse.org/request/show/209593
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-numpy?expand=0&rev=37
This commit is contained in:
Stephan Kulow 2013-12-08 18:46:07 +00:00 committed by Git OBS Bridge
parent 397afecd8d
commit 9521c1fa2a
3 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,74 @@
--- ./numpy/core/setup.py.orig 2013-12-05 10:09:02.655607503 +0000
+++ ./numpy/core/setup.py 2013-12-05 10:10:06.126607391 +0000
@@ -465,7 +465,7 @@ def configuration(parent_package='',top_
'MOTOROLA_EXTENDED_12_BYTES_BE',
'IEEE_QUAD_LE', 'IEEE_QUAD_BE',
'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE',
- 'DOUBLE_DOUBLE_BE']:
+ 'DOUBLE_DOUBLE_BE', 'DOUBLE_DOUBLE_LE']:
moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
else:
raise ValueError("Unrecognized long double format: %s" % rep)
--- ./numpy/core/setup_common.py.orig 2013-12-05 10:09:12.407607486 +0000
+++ ./numpy/core/setup_common.py 2013-12-05 10:12:04.389607182 +0000
@@ -256,6 +256,8 @@ _IEEE_QUAD_PREC_BE = ['300', '031', '326
_IEEE_QUAD_PREC_LE = _IEEE_QUAD_PREC_BE[::-1]
_DOUBLE_DOUBLE_BE = ['301', '235', '157', '064', '124', '000', '000', '000'] + \
['000'] * 8
+_DOUBLE_DOUBLE_LE = ['000', '000', '000', '124', '064', '157', '235', '301'] + \
+ ['000'] * 8
def long_double_representation(lines):
"""Given a binary dump as given by GNU od -b, look for long double
@@ -295,6 +297,8 @@ def long_double_representation(lines):
return 'IEEE_QUAD_LE'
elif read[8:-8] == _DOUBLE_DOUBLE_BE:
return 'DOUBLE_DOUBLE_BE'
+ elif read[8:-8] == _DOUBLE_DOUBLE_LE:
+ return 'DOUBLE_DOUBLE_LE'
elif read[:16] == _BEFORE_SEQ:
if read[16:-8] == _IEEE_DOUBLE_LE:
return 'IEEE_DOUBLE_LE'
--- ./numpy/core/src/npymath/ieee754.c.src.orig 2013-12-05 10:27:37.806605529 +0000
+++ ./numpy/core/src/npymath/ieee754.c.src 2013-12-05 10:15:22.245606831 +0000
@@ -133,7 +133,7 @@ float _nextf(float x, int p)
return x;
}
-#ifdef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
+#if defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) || defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE)
/*
* FIXME: this is ugly and untested. The asm part only works with gcc, and we
--- ./numpy/core/src/npymath/npy_math_private.h.orig 2013-12-05 10:09:39.735607438 +0000
+++ ./numpy/core/src/npymath/npy_math_private.h 2013-12-05 10:13:51.717606992 +0000
@@ -435,7 +435,7 @@ do {
typedef npy_uint32 ldouble_sign_t;
#endif
-#ifndef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
+#if !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) && !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE)
/* Get the sign bit of x. x should be of type IEEEl2bitsrep */
#define GET_LDOUBLE_SIGN(x) \
(((x).a[LDBL_SIGN_INDEX] & LDBL_SIGN_MASK) >> LDBL_SIGN_SHIFT)
@@ -476,7 +476,7 @@ do {
((x).a[LDBL_MANH_INDEX] & ~LDBL_MANH_MASK) | \
(((IEEEl2bitsrep_part)(v) << LDBL_MANH_SHIFT) & LDBL_MANH_MASK))
-#endif /* #ifndef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE */
+#endif /* #if !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) && !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE) */
/*
* Those unions are used to convert a pointer of npy_cdouble to native C99
--- ./numpy/core/src/private/npy_fpmath.h.orig 2013-12-05 10:09:28.015607458 +0000
+++ ./numpy/core/src/private/npy_fpmath.h 2013-12-05 10:12:49.261607102 +0000
@@ -41,7 +41,8 @@
defined(HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE) || \
defined(HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE) || \
defined(HAVE_LDOUBLE_MOTOROLA_EXTENDED_12_BYTES_BE) || \
- defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE))
+ defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) || \
+ defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE))
#error No long double representation defined
#endif

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Dec 5 11:17:52 CET 2013 - mls@suse.de
- add numpy-double-double-le.patch for ppc64le
-------------------------------------------------------------------
Thu Oct 31 10:17:25 UTC 2013 - toddrme2178@gmail.com

View File

@ -28,6 +28,7 @@ License: BSD-3-Clause
Group: Development/Libraries/Python
Source: http://sourceforge.net/projects/numpy/files/NumPy/%{version}/%{modname}-%{version}.tar.gz
Patch0: numpy-buildfix.patch
Patch1: numpy-double-double-le.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: blas-devel
BuildRequires: lapack-devel
@ -88,6 +89,7 @@ This package contains files for developing applications using %{modname}.
%prep
%setup -q -n %{modname}-%{version}
%patch0 -p1
%patch1
# Fix non-executable scripts
sed -i "1d" numpy/{compat/setup,distutils/{conv_template,cpuinfo,exec_command,from_template,setup,system_info},f2py/{auxfuncs,capi_maps,cb_rules,cfuncs,common_rules,crackfortran,diagnose,docs/usersguide/setup_example,f2py2e,f90mod_rules,func2subr,__init__,rules,setup,use_rules},ma/setup,matrixlib/setup,setup,testing/{print_coercion_tables,setup}}.py