From cc3283a74860bf9f2f02f70a3b87531d9adae6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 15 Jul 2021 16:05:22 +0200 Subject: [PATCH] Actually enable Pythran, and fix it on 32bit arches --- 14427.patch | 38 ++++++++++++++++++++++++++++++++++++++ scipy.spec | 5 ++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 14427.patch diff --git a/14427.patch b/14427.patch new file mode 100644 index 0000000..b954ca9 --- /dev/null +++ b/14427.patch @@ -0,0 +1,38 @@ +From c19bf22ce8d8cc2be8ce7950ffb93429ddc49e78 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Sun, 18 Jul 2021 11:14:29 +0200 +Subject: [PATCH] Extra pythran annotation for i686 support + +Bug spotted on Fedora, see https://src.fedoraproject.org/rpms/scipy/pull-request/22 + +The `int[::]` annotation is used to accept non-contiguous views. +--- + scipy/optimize/_group_columns.py | 2 ++ + scipy/signal/_max_len_seq_inner.py | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/scipy/optimize/_group_columns.py b/scipy/optimize/_group_columns.py +index d5dd9e1e48a1..8b4fcee34e7b 100644 +--- a/scipy/optimize/_group_columns.py ++++ b/scipy/optimize/_group_columns.py +@@ -54,6 +54,8 @@ def group_dense(m, n, A): + + #pythran export group_sparse(int, int, intc[], intc[]) + #pythran export group_sparse(int, int, int[], int[]) ++#pythran export group_sparse(int, int, intc[::], intc[::]) ++#pythran export group_sparse(int, int, int[::], int[::]) + def group_sparse(m, n, indices, indptr): + groups = -np.ones(n, dtype=np.intp) + current_group = 0 +diff --git a/scipy/signal/_max_len_seq_inner.py b/scipy/signal/_max_len_seq_inner.py +index fe57499af329..88d6ef3d7557 100644 +--- a/scipy/signal/_max_len_seq_inner.py ++++ b/scipy/signal/_max_len_seq_inner.py +@@ -4,6 +4,7 @@ + import numpy as np + + #pythran export _max_len_seq_inner(intp[], int8[], int, int, int8[]) ++#pythran export _max_len_seq_inner(int[], int8[], int, int, int8[]) + + # Fast inner loop of max_len_seq. + def _max_len_seq_inner(taps, state, nbits, length, seq): diff --git a/scipy.spec b/scipy.spec index 4191dab..b5ef4a5 100644 --- a/scipy.spec +++ b/scipy.spec @@ -4,7 +4,7 @@ # Pythran is an optional build dependency. # When used, it makes some modules faster, # but it is usually not available soon enough for new major Python versions. -%bcond_with pythran +%bcond_without pythran # Set to pre-release version suffix if building pre-release, else %%{nil} %global rcver %{nil} @@ -29,6 +29,9 @@ License: BSD and Boost and Public Domain Url: http://www.scipy.org/scipylib/index.html Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz +# Fix Pythran modules on 32bit arches, merged upstream +Patch1: https://github.com/scipy/scipy/pull/14427.patch + BuildRequires: fftw-devel, suitesparse-devel BuildRequires: %{blaslib}-devel BuildRequires: gcc-gfortran, swig, gcc-c++