[arch-commits] Commit in sagemath/trunk (PKGBUILD sagemath-primecount-5.1.patch)

Antonio Rojas arojas at archlinux.org
Mon Sep 2 18:57:30 UTC 2019


    Date: Monday, September 2, 2019 @ 18:57:29
  Author: arojas
Revision: 507071

ntl 11.3.3 and primecount 5.1 rebuild

Added:
  sagemath/trunk/sagemath-primecount-5.1.patch
Modified:
  sagemath/trunk/PKGBUILD

-------------------------------+
 PKGBUILD                      |   10 +++-
 sagemath-primecount-5.1.patch |   89 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-09-02 18:47:39 UTC (rev 507070)
+++ PKGBUILD	2019-09-02 18:57:29 UTC (rev 507071)
@@ -8,7 +8,7 @@
 pkgbase=sagemath
 pkgname=(sagemath sagemath-jupyter)
 pkgver=8.8
-pkgrel=5
+pkgrel=6
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(x86_64)
 url="http://www.sagemath.org"
@@ -47,7 +47,8 @@
         sagemath-ecl-sigfpe.patch
         sagemath-linbox-1.6.patch
         sagemath-threejs-dir-structure.patch
-        meataxe-tables.patch)
+        meataxe-tables.patch
+        sagemath-primecount-5.1.patch)
 sha256sums=('d012ff4f0f34e086fcaf576e25220fc647826116c69b62b887bc0b8ced5c1e9f'
             '20f5d7a1b5b16f4de43edcd4184e99e4687d9cccce70058f3f58f5d909bda300'
             '328e45e78065b5f6527174bda48cfff6828acbf107c2535b0a9a92c3ceb35842'
@@ -61,7 +62,8 @@
             'a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938'
             '81fc39e39e8508f742ccc784efd0492fd04474cee75edf7bd3cbea43edd49b2e'
             '779e4107f663307bc9c564e6f800364e7e1926b6cab18ea6674bd62ea7664143'
-            '8305de73d7a3c68ceaa001866ff933c4fa3a0706700ade2e25046f58270bc6db')
+            '8305de73d7a3c68ceaa001866ff933c4fa3a0706700ade2e25046f58270bc6db'
+            '4e48ce9aa6a584a9e342e4fb0dac91a1af27cfc40bfedb54e68ccad3b9257bb6')
 
 prepare(){
   cd sage-$pkgver
@@ -79,6 +81,8 @@
   patch -p1 -i ../sagemath-python3-notebook.patch
 # use correct online three.js version
   patch -p1 -i ../sagemath-threejs.patch
+# fix build with primecount 5.1
+  patch -p1 -i ../sagemath-primecount-5.1.patch
 
 # Upstream patches  
 # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209

Added: sagemath-primecount-5.1.patch
===================================================================
--- sagemath-primecount-5.1.patch	                        (rev 0)
+++ sagemath-primecount-5.1.patch	2019-09-02 18:57:29 UTC (rev 507071)
@@ -0,0 +1,89 @@
+diff --git a/src/sage/interfaces/primecount.pyx b/src/sage/interfaces/primecount.pyx
+index a0f698779e..86dce1c790 100644
+--- a/src/sage/interfaces/primecount.pyx
++++ b/src/sage/interfaces/primecount.pyx
+@@ -22,7 +22,7 @@ cdef inline int _do_sig(int64_t n):
+     "threshold for sig_on/sig_off"
+     return n >> 26
+ 
+-cpdef int64_t prime_pi(int64_t n, method=None) except -1:
++cpdef int64_t prime_pi(int64_t n) except -1:
+     r"""
+     Return the number of prime numbers smaller or equal than ``n``.
+ 
+@@ -30,71 +30,17 @@ cpdef int64_t prime_pi(int64_t n, method=None) except -1:
+ 
+     - ``n`` - an integer
+ 
+-    - ``method`` - ``None`` or a string that determines the primecount
+-      function to be called
+-
+-        - ``"deleglise_rivat"``
+-        - ``"legendre"``
+-        - ``"lehmer"``
+-        - ``"lmo"``
+-        - ``"meissel"``
+-        - ``"primesieve"``
+-
+     EXAMPLES::
+ 
+         sage: from sage.interfaces.primecount import prime_pi # optional - primecount
+ 
+         sage: prime_pi(1000) == 168                     # optional - primecount
+         True
+-        sage: prime_pi(1000, "deleglise_rivat") == 168  # optional - primecount
+-        True
+-        sage: prime_pi(1000, "legendre") == 168         # optional - primecount
+-        True
+-        sage: prime_pi(1000, "lehmer") == 168           # optional - primecount
+-        True
+-        sage: prime_pi(1000, "lmo") == 168              # optional - primecount
+-        True
+-        sage: prime_pi(1000, "meissel") == 168          # optional - primecount
+-        True
+-        sage: prime_pi(1000, "primesieve") == 168       # optional - primecount
+-        True
+-        sage: prime_pi(1000, "youpi")                   # optional - primecount
+-        Traceback (most recent call last):
+-        ...
+-        ValueError: unknown method 'youpi'
+     """
+     cdef int64_t ans
+-    if method is None:
+-        if _do_sig(n): sig_on()
+-        ans = primecount.pi(n)
+-        if _do_sig(n): sig_off()
+-    elif method == "deleglise_rivat":
+-        if _do_sig(n): sig_on()
+-        ans = primecount.pi_deleglise_rivat(n)
+-        if _do_sig(n): sig_off()
+-    elif method == "legendre":
+-        if _do_sig(n): sig_on()
+-        ans = primecount.pi_legendre(n)
+-        if _do_sig(n): sig_off()
+-    elif method == "lehmer":
+-        if _do_sig(n): sig_on()
+-        ans = primecount.pi_lehmer(n)
+-        if _do_sig(n): sig_off()
+-    elif method == "lmo":
+-        if _do_sig(n): sig_on()
+-        ans = primecount.pi_lmo(n)
+-        if _do_sig(n): sig_off()
+-    elif method == "meissel":
+-        if _do_sig(n): sig_on()
+-        ans = primecount.pi_meissel(n)
+-        if _do_sig(n): sig_off()
+-    elif method == "primesieve":
+-        if _do_sig(n): sig_on()
+-        ans = primecount.pi_primesieve(n)
+-        if _do_sig(n): sig_off()
+-    else:
+-        raise ValueError("unknown method {!r}".format(method))
+-
++    if _do_sig(n): sig_on()
++    ans = primecount.pi(n)
++    if _do_sig(n): sig_off()
+     return ans
+ 
+ cpdef prime_pi_128(n):
+



More information about the arch-commits mailing list