pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/math/py-scipy py-scipy: redo NetBSD fix so it doesn't ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/42151167fa58
branches:  trunk
changeset: 379213:42151167fa58
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Fri May 13 09:49:31 2022 +0000

description:
py-scipy: redo NetBSD fix so it doesn't have side effects on other opsys

Previous workaround could fail to compile when double and long double are
effectively the same type.

diffstat:

 math/py-scipy/distinfo                              |   4 +-
 math/py-scipy/patches/patch-scipy_special___logit.h |  51 ++++++--------------
 2 files changed, 18 insertions(+), 37 deletions(-)

diffs (84 lines):

diff -r 23ab3bfd4984 -r 42151167fa58 math/py-scipy/distinfo
--- a/math/py-scipy/distinfo    Fri May 13 09:00:59 2022 +0000
+++ b/math/py-scipy/distinfo    Fri May 13 09:49:31 2022 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.32 2022/05/03 15:14:54 tnn Exp $
+$NetBSD: distinfo,v 1.33 2022/05/13 09:49:31 tnn Exp $
 
 BLAKE2s (scipy-1.8.0.tar.gz) = 45a8dad311d6c459a748f31a7df37ce49ee611c8d4c258649288fd624e5a3a05
 SHA512 (scipy-1.8.0.tar.gz) = 674652728ae76479d17189e6974895bb838a8e83b17b9fb91c5f86faebf2a1387e1466555ac5b51d05c293f9b31b9a72e634f5858105ea984ca94bd2f05bbb4c
 Size (scipy-1.8.0.tar.gz) = 38313602 bytes
-SHA1 (patch-scipy_special___logit.h) = fdec9873512693b36f9763d15e81a60f6ac93630
+SHA1 (patch-scipy_special___logit.h) = c729c2b73de00cad4c9ad834a79b80dea7b05af3
 SHA1 (patch-scipy_special___round.h) = bc05a935e6423ce8395450ad3b30e88826939422
 SHA1 (patch-scipy_stats___hypotests__pythran.cpp) = e5d70b810ca020ccd25b9ad7068ce44487d8da60
diff -r 23ab3bfd4984 -r 42151167fa58 math/py-scipy/patches/patch-scipy_special___logit.h
--- a/math/py-scipy/patches/patch-scipy_special___logit.h       Fri May 13 09:00:59 2022 +0000
+++ b/math/py-scipy/patches/patch-scipy_special___logit.h       Fri May 13 09:49:31 2022 +0000
@@ -1,50 +1,31 @@
-$NetBSD: patch-scipy_special___logit.h,v 1.1 2022/05/03 15:14:54 tnn Exp $
+$NetBSD: patch-scipy_special___logit.h,v 1.2 2022/05/13 09:49:31 tnn Exp $
 
 py-scipy: work around undefined PLT symbol "log1pl" on NetBSD
 
---- scipy/special/_logit.h.orig        2022-01-29 22:59:08.475390400 +0000
+--- scipy/special/_logit.h.orig        2022-01-29 22:59:08.000000000 +0000
 +++ scipy/special/_logit.h
-@@ -31,15 +31,41 @@ inline T _expit(T x) {
+@@ -31,6 +31,17 @@ inline T _expit(T x) {
  // obtain accurate results (compared to the naive implementation
  // log(expit(x))).
  //
--template <typename T>
--inline T _log_expit(T x) {
-+inline npy_float _log_expit(npy_float x) {
-     if (x < 0.0) {
-         return x - std::log1p(std::exp(x));
-     }
-     else {
-         return -std::log1p(std::exp(-x));
-     }
--};
-+}
-+inline npy_double _log_expit(npy_double x) {
++#if defined(__NetBSD__)
++template <typename T>
++inline T _log_expit(T x) {
 +    if (x < 0.0) {
-+        return x - std::log1p(std::exp(x));
++        return x - std::log(std::exp(x) + 1.0);
 +    }
 +    else {
-+        return -std::log1p(std::exp(-x));
-+    }
-+}
-+#if defined(__NetBSD__)
-+inline npy_longdouble _log_expit(npy_longdouble x) {
-+    if (x < 0.0) {
-+        return x - std::log(1.0l + std::exp(x));
-+    }
-+    else {
-+        return -std::log(1.0l + std::exp(-x));
++        return -std::log(std::exp(-x) + 1.0);
 +    }
-+}
++};
 +#else
-+inline npy_longdouble _log_expit(npy_longdouble x) {
-+    if (x < 0.0) {
-+        return x - std::log1p(std::exp(x));
-+    }
-+    else {
-+        return -std::log1p(std::exp(-x));
-+    }
-+}
+ template <typename T>
+ inline T _log_expit(T x) {
+     if (x < 0.0) {
+@@ -40,6 +51,7 @@ inline T _log_expit(T x) {
+         return -std::log1p(std::exp(-x));
+     }
+ };
 +#endif
  
  



Home | Main Index | Thread Index | Old Index