Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to primecount 4.7 #27662

Closed
slel opened this issue Apr 14, 2019 · 21 comments
Closed

Upgrade to primecount 4.7 #27662

slel opened this issue Apr 14, 2019 · 21 comments

Comments

@slel
Copy link
Member

slel commented Apr 14, 2019

This ticket is to upgrade to primecount 4.7, released 2019-04-17.

Starting with primecount 4.6, released 2019-04-13, the cmake
dependency is relaxed from ≥ 3.9 to ≥ 3.4 (discussed at #27487).

Tarball (to be renamed primecount-4.7.tar.gz):

CC: @slel @vinklein @videlec @embray

Component: packages: optional

Keywords: upgrade, primecount

Author: Samuel Lelièvre, Vincent Delecroix

Branch/Commit: 4d06dee

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/27662

@slel slel added this to the sage-8.8 milestone Apr 14, 2019
@slel
Copy link
Member Author

slel commented Apr 14, 2019

Branch: u/slelievre/primecount-4.6

@slel
Copy link
Member Author

slel commented Apr 14, 2019

Commit: df46a55

@slel
Copy link
Member Author

slel commented Apr 14, 2019

comment:2

After applying the changes in this ticket, downloading the tarball, and running

$ sage -i primecount
$ make

testing on python3 gives:

$ ./sage -t --long --optional=sage,primecount src/sage/interfaces/primecount.pyx
Running doctests with ID 2019-04-14-19-52-42-57423cc3.
Git branch: primecount-4.6
Using --optional=primecount,sage
Doctesting 1 file.
sage -t --long --warn-long 81.8 src/sage/interfaces/primecount.pyx
**********************************************************************
File "src/sage/interfaces/primecount.pyx", line 108, in sage.interfaces.primecount.prime_pi_128
Failed example:
    prime_pi_128(1000)     # optional - primecount
Exception raised:
    Traceback (most recent call last):
      File "/opt/s/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/opt/s/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1095, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.interfaces.primecount.prime_pi_128[1]>", line 1, in <module>
        prime_pi_128(Integer(1000))     # optional - primecount
      File "sage/interfaces/primecount.pyx", line 100, in sage.interfaces.primecount.prime_pi_128 (build/cythonized/sage/interfaces/primecount.cpp:1981)
        cpdef prime_pi_128(n):
      File "sage/interfaces/primecount.pyx", line 113, in sage.interfaces.primecount.prime_pi_128 (build/cythonized/sage/interfaces/primecount.cpp:1892)
        cdef cppstring s = str(n)
      File "stringsource", line 15, in string.from_py.__pyx_convert_string_from_py_std__in_string (build/cythonized/sage/interfaces/primecount.cpp:2448)
    TypeError: expected bytes, str found
**********************************************************************
1 item had failures:
   1 of   3 in sage.interfaces.primecount.prime_pi_128
    [16 tests, 1 failure, 0.05 s]
----------------------------------------------------------------------
sage -t --long --warn-long 81.8 src/sage/interfaces/primecount.pyx  # 1 doctest failed
----------------------------------------------------------------------
Total time for all tests: 0.1 seconds
    cpu time: 0.0 seconds
    cumulative wall time: 0.1 seconds

New commits:

df46a55Upgrade to primecount 4.6

@videlec
Copy link
Contributor

videlec commented Apr 15, 2019

comment:3

Indeed, this is invalid Python 3 in Cython cdef cppstring s = str(n). Replacing str -> bytes is probably sufficient.

@slel

This comment has been minimized.

@slel
Copy link
Member Author

slel commented Apr 17, 2019

comment:4

Thanks for the analysis. I'll make that change in src/sage/interfaces/primecount.pyx and push a branch.

@slel slel changed the title Upgrade to primecount 4.6 Upgrade to primecount 4.7 Apr 17, 2019
@slel
Copy link
Member Author

slel commented Apr 17, 2019

comment:5

Did you mean this?

diff --git a/src/sage/interfaces/primecount.pyx b/src/sage/interfaces/primecount.pyx
index e1ef2b6da1..f9f4f85c15 100644
--- a/src/sage/interfaces/primecount.pyx
+++ b/src/sage/interfaces/primecount.pyx
@@ -110,7 +110,7 @@ cpdef prime_pi_128(n):
         sage: nth_prime_128(2**65)   # not tested
         ?
     """
-    cdef cppstring s = str(n)
+    cdef cppstring s = bytes(n)
     cdef bytes ans
     sig_on()
     ans = primecount.pi(s)

This gives me the following doctest failure (with primecount 4.7):

$ ./sage -t --long --optional=sage,primecount src/sage/interfaces/primecount.pyx
Forcing sage-location, probably because a new package was installed.
Cleaning up, do not interrupt this.
Done cleaning.
Running doctests with ID 2019-04-17-11-08-04-ac57896a.
Git branch: primecount-4.7
Using --optional=primecount,sage
Doctesting 1 file.
sage -t --long --warn-long 81.8 src/sage/interfaces/primecount.pyx
**********************************************************************
File "src/sage/interfaces/primecount.pyx", line 108, in sage.interfaces.primecount.prime_pi_128
Failed example:
    prime_pi_128(1000)     # optional - primecount
Exception raised:
    Traceback (most recent call last):
      File "/opt/s/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/opt/s/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1095, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.interfaces.primecount.prime_pi_128[1]>", line 1, in <module>
        prime_pi_128(Integer(1000))     # optional - primecount
      File "sage/interfaces/primecount.pyx", line 100, in sage.interfaces.primecount.prime_pi_128 (build/cythonized/sage/interfaces/primecount.cpp:1981)
        cpdef prime_pi_128(n):
      File "sage/interfaces/primecount.pyx", line 115, in sage.interfaces.primecount.prime_pi_128 (build/cythonized/sage/interfaces/primecount.cpp:1903)
        sig_on()
    RuntimeError: Aborted
**********************************************************************
1 item had failures:
   1 of   3 in sage.interfaces.primecount.prime_pi_128
    [16 tests, 1 failure, 0.05 s]
----------------------------------------------------------------------
sage -t --long --warn-long 81.8 src/sage/interfaces/primecount.pyx  # 1 doctest failed
----------------------------------------------------------------------
Total time for all tests: 0.1 seconds
    cpu time: 0.0 seconds
    cumulative wall time: 0.1 seconds

@videlec
Copy link
Contributor

videlec commented Apr 18, 2019

comment:6

At least the error changed. It now looks weird and the traceback does not give a clue of what went wrong.

@slel
Copy link
Member Author

slel commented Apr 24, 2019

Changed branch from u/slelievre/primecount-4.6 to u/slelievre/primecount-4.7

@slel
Copy link
Member Author

slel commented Apr 24, 2019

comment:8

Here is the branch if anyone can look into it.


New commits:

ff23d3527662: primecount 4.7 with a py3 fix

@slel
Copy link
Member Author

slel commented Apr 24, 2019

Changed commit from df46a55 to ff23d35

@videlec
Copy link
Contributor

videlec commented Apr 25, 2019

New commits:

27b52c9Merge branch 'u/slelievre/primecount-4.7' of trac.sagemath.org:sage into TMP
616f7e6fix string conversion

@videlec
Copy link
Contributor

videlec commented Apr 25, 2019

Author: Samuel Lelièvre, Vincent Delecroix

@videlec
Copy link
Contributor

videlec commented Apr 25, 2019

Changed branch from u/slelievre/primecount-4.7 to u/vdelecroix/27662

@videlec
Copy link
Contributor

videlec commented Apr 25, 2019

Changed commit from ff23d35 to 616f7e6

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 25, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

172096d27662: primecount 4.7 with a py3 fix
4d06deefix string conversion

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 25, 2019

Changed commit from 616f7e6 to 4d06dee

@dimpase
Copy link
Member

dimpase commented Apr 25, 2019

Reviewer: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Apr 25, 2019

comment:11

LGTM

@dimpase
Copy link
Member

dimpase commented Apr 25, 2019

comment:12

Could someone please review #27487 ? This is very easy, if you have autotools installed.

@vbraun
Copy link
Member

vbraun commented Apr 29, 2019

Changed branch from u/vdelecroix/27662 to 4d06dee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants