#6 Fix build issues on s390x
Merged 5 years ago by limb. Opened 5 years ago by qulogic.
rpms/ qulogic/numpy master  into  master

@@ -0,0 +1,40 @@ 

+ From ec843c7008b3d89e6f6023b88ac0f1d02e39be17 Mon Sep 17 00:00:00 2001

+ From: Elliott Sales de Andrade <quantum.analyst@gmail.com>

+ Date: Sat, 11 Aug 2018 02:45:01 -0400

+ Subject: [PATCH] BUG: Fix undefined functions on big-endian systems.

+ 

+ Both these functions are used by `Dragon4_PrintFloat_IEEE_binary128`,

+ which was recently made available on big-endian systems without these

+ in #11568.

+ 

+ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>

+ ---

+  numpy/core/src/multiarray/dragon4.c | 5 +++--

+  1 file changed, 3 insertions(+), 2 deletions(-)

+ 

+ diff --git a/numpy/core/src/multiarray/dragon4.c b/numpy/core/src/multiarray/dragon4.c

+ index abbf05220..2e599136e 100644

+ --- a/numpy/core/src/multiarray/dragon4.c

+ +++ b/numpy/core/src/multiarray/dragon4.c

+ @@ -114,7 +114,7 @@ LogBase2_64(npy_uint64 val)

+      return LogBase2_32((npy_uint32)val);

+  }

+  

+ -#if defined(HAVE_LDOUBLE_IEEE_QUAD_LE)

+ +#if defined(HAVE_LDOUBLE_IEEE_QUAD_LE) || defined(HAVE_LDOUBLE_IEEE_QUAD_BE)

+  static npy_uint32

+  LogBase2_128(npy_uint64 hi, npy_uint64 lo)

+  {

+ @@ -217,7 +217,8 @@ BigInt_Set_uint64(BigInt *i, npy_uint64 val)

+  

+  #if (defined(HAVE_LDOUBLE_IBM_DOUBLE_DOUBLE_LE) || \

+       defined(HAVE_LDOUBLE_IBM_DOUBLE_DOUBLE_BE) || \

+ -     defined(HAVE_LDOUBLE_IEEE_QUAD_LE))

+ +     defined(HAVE_LDOUBLE_IEEE_QUAD_LE) || \

+ +     defined(HAVE_LDOUBLE_IEEE_QUAD_BE))

+  static void

+  BigInt_Set_2x_uint64(BigInt *i, npy_uint64 hi, npy_uint64 lo)

+  {

+ -- 

+ 2.17.1

+ 

file modified
+13 -16
@@ -11,7 +11,7 @@ 

  

  Name:           numpy

  Version:        1.15.0

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Epoch:          1

  Summary:        A fast multidimensional array facility for Python

  
@@ -20,6 +20,8 @@ 

  URL:            http://www.numpy.org/

  Source0:        https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz

  Source1:	https://docs.scipy.org/doc/numpy/numpy-html-1.14.5.zip

+ # https://github.com/numpy/numpy/pull/11711

+ Patch0001:      0001-BUG-Fix-undefined-functions-on-big-endian-systems.patch

  

  BuildRequires:  python2-devel lapack-devel python2-setuptools gcc-gfortran python2-nose

  BuildRequires:  Cython python2-pytest
@@ -131,8 +133,7 @@ 

  %endif # with_python3

  

  %prep

- %setup -q -n %{name}-%{version}%{?relc}

- #%setup -q -n numpy-cc2b04

+ %autosetup -n %{name}-%{version}%{?relc} -p1

  

  # workaround for rhbz#849713

  # http://mail.scipy.org/pipermail/numpy-discussion/2012-July/063530.html
@@ -235,20 +236,14 @@ 

  

  %check

  pushd doc &> /dev/null

- PYTHONPATH="%{buildroot}%{python2_sitearch}" %{__python2} -c "import pkg_resources, numpy ; numpy.test(verbose=2)" \

- %ifarch s390 s390x

- || :

- %endif

- # don't remove this comment

+ PYTHONPATH="%{buildroot}%{python2_sitearch}" PYTHONDONTWRITEBYTECODE=1 \

+     %{__python2} -c "import pkg_resources, numpy ; numpy.test(verbose=2)"

  popd &> /dev/null

  

  %if 0%{?with_python3}

  pushd doc &> /dev/null

- PYTHONPATH="%{buildroot}%{python3_sitearch}" %{__python3} -c "import pkg_resources, numpy ; numpy.test(verbose=2)" \

- %ifarch s390 s390x

- || :

- %endif

- # don't remove this comment

+ PYTHONPATH="%{buildroot}%{python3_sitearch}" PYTHONDONTWRITEBYTECODE=1 \

Could we add a comment above that says: # WARNING: failing tests will not stop the build!

+     %{__python3} -c "import pkg_resources, numpy ; numpy.test(verbose=2)"

  popd &> /dev/null

  

  %endif # with_python3
@@ -277,9 +272,6 @@ 

  %exclude %{python2_sitearch}/%{name}/LICENSE.txt

  %{_bindir}/conv-template

  %{_bindir}/from-template

- %ifnarch s390x

- %{python2_sitearch}/numpy/__pycache__/*

- %endif

  

  %files -n python2-numpy-f2py

  %doc docs/f2py/*.html
@@ -326,6 +318,11 @@ 

  

  

  %changelog

+ * Sat Aug 11 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1:1.15.0-2

+ - Fix broken build on s390x

+ - Remove bytecode produced by pytest

+ - Re-enable tests on s390x

+ 

  * Tue Jul 24 2018 Gwyn Ciesla <limburgher@gmail.com> - 1:1.15.0-1

  - 1.15.0

  

Also, remove unnecessary pytest bytecode and re-enable tests. Not sure if the tests are going to pass just yet; running in qemu is pretty slow...

All arches are passing, when they should not be. They've been broken for a long time, it seems.

Although, feel free to merge now to get downstream builds working, and I can open a new thing for that.

There are still several arch-specific bugs to fix still. Current progress is here and here.

Could we add a comment above that says: # WARNING: failing tests will not stop the build!

<mock-chroot> sh-4.4# python3
Python 3.7.0 (default, Jul 23 2018, 08:49:45) 
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import multiarray
Illegal instruction (core dumped)
<mock-chroot> sh-4.4# python2
Python 2.7.15 (default, Jul 15 2018, 13:45:45) 
[GCC 8.1.1 20180626 (Red Hat 8.1.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import multiarray
Illegal instruction (core dumped)

If you are running with mock's qemu mode, then it crashes. I don't know what to do about that, but it works fine on CI.

Pull-Request has been merged by limb

5 years ago