[Python-modules-team] Bug#756403: python-numpy: fix FTBFS on ppc64el (patch available)

Mauricio Faria de Oliveira mauricfo at linux.vnet.ibm.com
Tue Jul 29 14:58:35 UTC 2014


Package: src:python-numpy
Version: 1:1.8.1-1
Tags: patch
User: debian-powerpc at lists.debian.org
Usertags: ppc64el

Hi,

The patch attached fixes a build error on ppc64el [1], which has been
fixed upstream on 1.9.0 (trivial backport).

May you please consider it for an upload?


With it applied the build finishes successfully, with the following
test-suite summary:

	Ran 5301 tests in 364.252s

	OK (KNOWNFAIL=9, SKIP=6)

Thanks!


[1] 
http://ftp.unicamp.br/pub/ppc64el/debian/buildd-upstream/build_logs/logs/python-numpy_1.8.1-1_ppc64el.build


-- 
Mauricio Faria de Oliveira
IBM Linux Technology Center
-------------- next part --------------
diff -Nru python-numpy-1.8.1/debian/changelog python-numpy-1.8.1/debian/changelog
--- python-numpy-1.8.1/debian/changelog	2014-03-27 16:25:19.000000000 -0300
+++ python-numpy-1.8.1/debian/changelog	2014-07-29 11:16:27.000000000 -0300
@@ -1,3 +1,10 @@
+python-numpy (1:1.8.1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * ppc64el_support.patch: fix FTBFS on ppc64el, backport from 1.9.0
+
+ -- Mauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com>  Tue, 29 Jul 2014 11:14:56 -0300
+
 python-numpy (1:1.8.1-1) unstable; urgency=medium
 
   * New upstream bugfix release
diff -Nru python-numpy-1.8.1/debian/patches/ppc64el-support.patch python-numpy-1.8.1/debian/patches/ppc64el-support.patch
--- python-numpy-1.8.1/debian/patches/ppc64el-support.patch	1969-12-31 21:00:00.000000000 -0300
+++ python-numpy-1.8.1/debian/patches/ppc64el-support.patch	2014-07-29 11:13:19.000000000 -0300
@@ -0,0 +1,131 @@
+Description: Add support to ppc64el.
+ This is a trivial backport of the upstream patch:
+ $ curl https://github.com/numpy/numpy/commit/2ba74c397a5d840665d07f4fc3b2fa00214d1fcd.patch 
+     | filterdiff --clean -x '*/doc/release/1.9.0-notes.rst'
+Origin: backport, https://github.com/numpy/numpy/commit/2ba74c397a5d840665d07f4fc3b2fa00214d1fcd
+Last-Update: 2014-07-29
+From 2ba74c397a5d840665d07f4fc3b2fa00214d1fcd Mon Sep 17 00:00:00 2001
+From: William Grant <wgrant at ubuntu.com>
+Date: Thu, 20 Mar 2014 08:44:31 +0100
+Subject: [PATCH] Adding support of ppc64le architecture
+
+Signed-off-by: William Grant <wgrant at ubuntu.com>
+Signed-off-by: Michel Normand <normand at linux.vnet.ibm.com>
+---
+ doc/release/1.9.0-notes.rst               | 3 +++
+ numpy/core/include/numpy/npy_cpu.h        | 3 +++
+ numpy/core/include/numpy/npy_endian.h     | 3 ++-
+ numpy/core/setup.py                       | 2 +-
+ numpy/core/setup_common.py                | 4 ++++
+ numpy/core/src/npymath/ieee754.c.src      | 3 ++-
+ numpy/core/src/npymath/npy_math_private.h | 3 ++-
+ numpy/core/src/private/npy_fpmath.h       | 5 ++++-
+ 8 files changed, 21 insertions(+), 5 deletions(-)
+
+--- a/numpy/core/include/numpy/npy_cpu.h
++++ b/numpy/core/include/numpy/npy_cpu.h
+@@ -5,6 +5,7 @@
+  *              NPY_CPU_AMD64
+  *              NPY_CPU_PPC
+  *              NPY_CPU_PPC64
++ *              NPY_CPU_PPC64LE
+  *              NPY_CPU_SPARC
+  *              NPY_CPU_S390
+  *              NPY_CPU_IA64
+@@ -41,6 +42,8 @@
+      * _ARCH_PPC is used by at least gcc on AIX
+      */
+     #define NPY_CPU_PPC
++#elif defined(__ppc64le__)
++    #define NPY_CPU_PPC64LE
+ #elif defined(__ppc64__)
+     #define NPY_CPU_PPC64
+ #elif defined(__sparc__) || defined(__sparc)
+--- a/numpy/core/include/numpy/npy_endian.h
++++ b/numpy/core/include/numpy/npy_endian.h
+@@ -27,7 +27,8 @@
+             || defined(NPY_CPU_ARMEL)   \
+             || defined(NPY_CPU_AARCH64) \
+             || defined(NPY_CPU_SH_LE)   \
+-            || defined(NPY_CPU_MIPSEL)
++            || defined(NPY_CPU_MIPSEL)  \
++            || defined(NPY_CPU_PPC64LE)
+         #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
+     #elif defined(NPY_CPU_PPC)          \
+             || defined(NPY_CPU_SPARC)   \
+--- a/numpy/core/setup.py
++++ b/numpy/core/setup.py
+@@ -466,7 +466,7 @@ def generate_config_h(ext, build_dir):
+                            '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)
+--- a/numpy/core/setup_common.py
++++ b/numpy/core/setup_common.py
+@@ -256,6 +256,8 @@ def _pyod3():
+ _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'
+--- a/numpy/core/src/npymath/ieee754.c.src
++++ b/numpy/core/src/npymath/ieee754.c.src
+@@ -133,7 +133,8 @@ static 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
+--- a/numpy/core/src/npymath/npy_math_private.h
++++ b/numpy/core/src/npymath/npy_math_private.h
+@@ -435,7 +435,8 @@ 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)
+--- a/numpy/core/src/private/npy_fpmath.h
++++ b/numpy/core/src/private/npy_fpmath.h
+@@ -29,6 +29,8 @@
+             #define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
+         #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_PPC64)
+             #define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE
++        #elif defined(NPY_CPU_PPC64LE)
++            #define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_LE
+         #endif
+     #endif
+ #endif
+@@ -41,7 +43,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
+ 
diff -Nru python-numpy-1.8.1/debian/patches/series python-numpy-1.8.1/debian/patches/series
--- python-numpy-1.8.1/debian/patches/series	2014-03-27 16:25:19.000000000 -0300
+++ python-numpy-1.8.1/debian/patches/series	2014-07-29 11:13:19.000000000 -0300
@@ -4,3 +4,4 @@
 #05_fix_endianness_detection.patch
 10_use_local_python.org_object.inv_sphinx.diff
 python3-soabi.patch
+ppc64el-support.patch


More information about the Python-modules-team mailing list