Skip to contentSkip to conversation

python-numpy: Ensure `_npy_scaled_cexp{, f, l}` is defined when needed

PATCH New Alexey Brodkin 2 participants 2 messages Sep 22, 2017 – Sep 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python-numpy: Ensure `_npy_scaled_cexp{, f, l}` is defined when needed

With update of Numpy to the latest version we've got one change which breaks Numpy compilcation in some cases.

This change back-ports upstream fix from:
https://github.com/numpy/numpy/pull/9740

Cc Rahul Bedarkar <[email protected]>
Cc Gwenhael Goavec-Merou <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Peter Korsgaard <[email protected]>

---

Note it supersedes http://patchwork.ozlabs.org/patch/816381/.

 ..._npy_scaled_cexp-f-l-is-defined-when-need.patch | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/python-numpy/0003-BUG-Ensure-_npy_scaled_cexp-f-l-is-defined-when-need.patch
package/python-numpy/0003-BUG-Ensure-_npy_scaled_cexp-f-l-is-defined-when-need.patch new file +43 -0
new file mode 100644
index 0000000000..a243df544e
@@ -0,0 +1,43 @@
+From 9aa5d577c58f04f9606674dd6f326aee1bf1e6e8 Mon Sep 17 00:00:00 2001
+From: Charles Harris <[email protected]>
+Date: Thu, 21 Sep 2017 10:10:05 -0600
+Subject: [PATCH] BUG: Ensure `_npy_scaled_cexp{,f,l}` is defined when needed.
+
+The `_npy_scaled_cexp{,f,l}` functions were previously only defined when
+the npy_cexp fallback functions were needed, but they are also called by
+the npy_csinh and npy_ccosh functions.
+
+Signed-off-by: Alexey Brodkin <[email protected]>
+---
+ numpy/core/src/npymath/npy_math_complex.c.src | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/numpy/core/src/npymath/npy_math_complex.c.src b/numpy/core/src/npymath/npy_math_complex.c.src
+index a82a6737c..fb31e8e6a 100644
+--- a/numpy/core/src/npymath/npy_math_complex.c.src
++++ b/numpy/core/src/npymath/npy_math_complex.c.src
+@@ -184,7 +184,9 @@ npy_carg at c@(@ctype@ z)
+ #define SCALED_CEXP_LOWERL 11357.216553474703895L
+ #define SCALED_CEXP_UPPERL 22756.021937783004509L
+ 
+-#ifndef HAVE_CEXP at C@
++#if !defined(HAVE_CSINH at C@) || \
++    !defined(HAVE_CCOSH at C@) || \
++    !defined(HAVE_CEXP at C@)
+ 
+ static
+ @ctype@
+@@ -212,6 +214,10 @@ _npy_scaled_cexp at c@(@type@ x, @type@ y, npy_int expt)
+                          npy_ldexp at c@(mant * mantsin, expt + exsin));
+ }
+ 
++#endif
++
++#ifndef HAVE_CEXP at C@
++
+ @ctype@
+ npy_cexp at c@(@ctype@ z)
+ {
+-- 
+2.11.0
+
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 python-numpy: Ensure `_npy_scaled_cexp{, f, l}` is defined when needed

Quoted 11 lines · Alexey Brodkin

With update of Numpy to the latest version we've got one change which breaks Numpy compilcation in some cases.

This change back-ports upstream fix from:
https://github.com/numpy/numpy/pull/9740

Cc Rahul Bedarkar <[email protected]>
Cc Gwenhael Goavec-Merou <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Peter Korsgaard <[email protected]>

Applied to master, thanks. It has apparently also been merged upstream, great!

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF