Skip to content

sagemath: update to 10.5#51902

Merged
leahneukirchen merged 8 commits intovoid-linux:masterfrom
tornaria:sagemath
Dec 31, 2024
Merged

sagemath: update to 10.5#51902
leahneukirchen merged 8 commits intovoid-linux:masterfrom
tornaria:sagemath

Conversation

@tornaria
Copy link
Contributor

@tornaria tornaria commented Aug 18, 2024

This now includes:

  • pari: update to 2.17.1.
  • gp2c: update to 0.0.14.
  • eclib: update to 2024111.
  • giac: update to 1.9.0.998.
  • lcalc: rebuild for pari-2.17.0
  • python3-cysignals: rebuild for pari-2.17.0
  • python3-cypari2: rebuild for pari-2.17.0
  • sagemath: update to 10.5.

There's more stuff to update, but I want to start small. This includes two difficult updates: python 3.13 and pari 2.17.

Testing the changes

  • I tested the changes in this PR: YES

@dkwo

@tornaria tornaria force-pushed the sagemath branch 4 times, most recently from 7b24a6d to 377d7d9 Compare August 24, 2024 04:03
@tornaria tornaria changed the title [BETA] sagemath: update to 10.5.beta2 [BETA] sagemath: update to 10.5.beta3 Sep 8, 2024
@dkwo
Copy link
Contributor

dkwo commented Sep 9, 2024

I tried to crosscompile sagemath from aarch64 to x86_64: it looks like we should add to hostmakedepends "python3-gmpy2 python3-memory_allocator python3-numpy ecl python3-cypari2 python3-cysignals python3-devel". Makes sense?

@tornaria
Copy link
Contributor Author

I tried to crosscompile sagemath from aarch64 to x86_64: it looks like we should add to hostmakedepends "python3-gmpy2 python3-memory_allocator python3-numpy ecl python3-cypari2 python3-cysignals python3-devel". Makes sense?

Sure, but we still don't have cross for ntl and others, does it make sense to bother with this?

@dkwo
Copy link
Contributor

dkwo commented Sep 10, 2024

True. It's still useful to know in general, and it could be useful later, if we decide e.g. to use qemu to build ntl etc.

@tornaria tornaria changed the title [BETA] sagemath: update to 10.5.beta3 [BETA] sagemath: update to 10.5.beta5 Sep 22, 2024
@tornaria tornaria changed the title [BETA] sagemath: update to 10.5.beta5 [BETA] sagemath: update to 10.5.beta7 Oct 16, 2024
@tornaria tornaria changed the title [BETA] sagemath: update to 10.5.beta7 [BETA] sagemath: update to 10.5.beta8 Oct 29, 2024
@tornaria tornaria changed the title [BETA] sagemath: update to 10.5.beta8 [BETA] sagemath: update to 10.5.rc0 Nov 18, 2024
@tornaria tornaria closed this Dec 24, 2024
@tornaria tornaria deleted the sagemath branch December 24, 2024 21:46
@tornaria tornaria restored the sagemath branch December 24, 2024 21:49
@tornaria tornaria reopened this Dec 24, 2024
@tornaria tornaria changed the title [BETA] sagemath: update to 10.5.rc0 [BETA] sagemath: update to 10.5 Dec 24, 2024
@tornaria tornaria changed the title [BETA] sagemath: update to 10.5 sagemath: update to 10.5 Dec 24, 2024
@tornaria
Copy link
Contributor Author

@dkwo is something like this enough to cross-compile:

--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -6,7 +6,9 @@ _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
 hostmakedepends="pkg-config python3-Cython python3-Jinja2
- python3-pkgconfig python3-setuptools python3-wheel"
+ python3-pkgconfig python3-setuptools python3-wheel
+ python3-gmpy2 python3-memory_allocator python3-numpy ecl
+ python3-cypari2 python3-cysignals python3-devel"
 makedepends="boost-devel brial-devel cliquer-devel ecl eclib-devel
  ecm-devel fflas-ffpack flintlib-devel gap-devel gd-devel giac-devel glpk-devel
  gsl-devel iml-devel lcalc-devel libbraiding-devel libhomfly-devel libmpc-devel

@tornaria tornaria force-pushed the sagemath branch 2 times, most recently from e58e92b to dee54ce Compare December 26, 2024 16:58
@tornaria tornaria marked this pull request as ready for review December 26, 2024 17:57
@dkwo
Copy link
Contributor

dkwo commented Dec 26, 2024

Yes, that should be enough.
I tried to build and check on it aarch64: it fails only one test sage/rings/number_theory/galois_group.py.
After installing sage, I cannot run it though, I get

/usr/bin/sage: line 177: /usr/libexec/sagemath/sage-env-config: Permission denied
/usr/bin/sage: line 916: exec: sage-runtests: not found

@tornaria
Copy link
Contributor Author

tornaria commented Dec 26, 2024

Yes, that should be enough.

👍 I pushed that change here.

I tried to build and check on it aarch64: it fails only one test sage/rings/number_theory/galois_group.py.

Nice, at some point we may want to debug that so tests pass. Can you post the failure?

After installing sage, I cannot run it though, I get

/usr/bin/sage: line 177: /usr/libexec/sagemath/sage-env-config: Permission denied
/usr/bin/sage: line 916: exec: sage-runtests: not found

That's weird. The second error is expected from the first (because sage-env-config sets the correct PATH so if it doesn't run the PATH is incorrect).

What's up with sage-env-config? I don't make it +x but it should not be necessary as line 177 sources it. Am I missing something? Here:

$ ls -l /usr/libexec/sagemath/
total 252
-rwxr-xr-x 1 root root   785 Dec 25 19:20 math-readline
-rwxr-xr-x 1 root root 43267 Dec 25 19:20 sage
-rwxr-xr-x 1 root root   651 Dec 25 19:20 sage-cachegrind
-rwxr-xr-x 1 root root   442 Dec 25 19:20 sage-callgrind
-rwxr-xr-x 1 root root  7788 Dec 25 19:20 sage-cleaner
-rwxr-xr-x 1 root root 10209 Dec 25 19:20 sage-coverage
-rwxr-xr-x 1 root root  1356 Dec 25 19:20 sage-cython
-rwxr-xr-x 1 root root 23416 Dec 25 19:20 sage-env
-rw-r--r-- 1 root root   205 Dec 25 19:20 sage-env-config
-rwxr-xr-x 1 root root   238 Dec 25 19:20 sage-eval
-rwxr-xr-x 1 root root 35314 Dec 25 19:20 sage-fixdoctests
-rwxr-xr-x 1 root root   119 Dec 25 19:20 sage-grep
-rwxr-xr-x 1 root root    70 Dec 25 19:20 sage-grepdoc
-rwxr-xr-x 1 root root   234 Dec 25 19:20 sage-inline-fortran
-rwxr-xr-x 1 root root  1345 Dec 25 19:20 sage-ipynb2rst
-rwxr-xr-x 1 root root   352 Dec 25 19:20 sage-ipython
-rwxr-xr-x 1 root root  3660 Dec 25 19:20 sage-list-packages
-rwxr-xr-x 1 root root   613 Dec 25 19:20 sage-massif
-rwxr-xr-x 1 root root  8463 Dec 25 19:20 sage-notebook
-rwxr-xr-x 1 root root  3138 Dec 25 19:20 sage-num-threads.py
-rwxr-xr-x 1 root root   595 Dec 25 19:20 sage-omega
-rwxr-xr-x 1 root root 10605 Dec 25 19:20 sage-preparse
-rwxr-xr-x 1 root root    28 Dec 25 19:20 sage-python
-rwxr-xr-x 1 root root   699 Dec 25 19:20 sage-run
-rwxr-xr-x 1 root root   245 Dec 25 19:20 sage-run-cython
-rwxr-xr-x 1 root root   121 Dec 25 19:20 sage-runtests
-rwxr-xr-x 1 root root  6219 Dec 25 19:20 sage-startuptime.py
-rwxr-xr-x 1 root root  5646 Dec 25 19:20 sage-update-version
-rwxr-xr-x 1 root root  1201 Dec 25 19:20 sage-valgrind
-rwxr-xr-x 1 root root  1207 Dec 25 19:20 sage-venv-config
-rwxr-xr-x 1 root root   394 Dec 25 19:20 sage-version.sh

@dkwo
Copy link
Contributor

dkwo commented Dec 27, 2024

For me, that file is only readable to root:

$ ls -l /usr/libexec/sagemath/ 
total 252
-rwxr-xr-x 1 root root   785 Dec 26 17:58 math-readline
-rwxr-xr-x 1 root root 43267 Dec 26 17:58 sage
-rwxr-xr-x 1 root root   651 Dec 26 17:58 sage-cachegrind
-rwxr-xr-x 1 root root   442 Dec 26 17:58 sage-callgrind
-rwxr-xr-x 1 root root  7788 Dec 26 17:58 sage-cleaner
-rwxr-xr-x 1 root root 10209 Dec 26 17:58 sage-coverage
-rwxr-xr-x 1 root root  1356 Dec 26 17:58 sage-cython
-rwxr-xr-x 1 root root 23416 Dec 26 17:58 sage-env
-rw------- 1 root root   205 Dec 26 17:58 sage-env-config
-rwxr-xr-x 1 root root   238 Dec 26 17:58 sage-eval
-rwxr-xr-x 1 root root 35314 Dec 26 17:58 sage-fixdoctests
-rwxr-xr-x 1 root root   119 Dec 26 17:58 sage-grep
-rwxr-xr-x 1 root root    70 Dec 26 17:58 sage-grepdoc
-rwxr-xr-x 1 root root   234 Dec 26 17:58 sage-inline-fortran
-rwxr-xr-x 1 root root  1345 Dec 26 17:58 sage-ipynb2rst
-rwxr-xr-x 1 root root   352 Dec 26 17:58 sage-ipython
-rwxr-xr-x 1 root root  3660 Dec 26 17:58 sage-list-packages
-rwxr-xr-x 1 root root   613 Dec 26 17:58 sage-massif
-rwxr-xr-x 1 root root  8463 Dec 26 17:58 sage-notebook
-rwxr-xr-x 1 root root  3138 Dec 26 17:58 sage-num-threads.py
-rwxr-xr-x 1 root root   595 Dec 26 17:58 sage-omega
-rwxr-xr-x 1 root root 10605 Dec 26 17:58 sage-preparse
-rwxr-xr-x 1 root root    28 Dec 26 17:58 sage-python
-rwxr-xr-x 1 root root   699 Dec 26 17:58 sage-run
-rwxr-xr-x 1 root root   245 Dec 26 17:58 sage-run-cython
-rwxr-xr-x 1 root root   121 Dec 26 17:58 sage-runtests
-rwxr-xr-x 1 root root  6219 Dec 26 17:58 sage-startuptime.py
-rwxr-xr-x 1 root root  5646 Dec 26 17:58 sage-update-version
-rwxr-xr-x 1 root root  1201 Dec 26 17:58 sage-valgrind
-rwxr-xr-x 1 root root  1207 Dec 26 17:58 sage-venv-config
-rwxr-xr-x 1 root root   394 Dec 26 17:58 sage-version.sh

@dkwo
Copy link
Contributor

dkwo commented Dec 27, 2024

If I chmod it by hand, then everything works and that test fails like this:

Running doctests with ID 2024-12-27-21-07-26-dc66dad2.
Running with SAGE_LOCAL='/usr' and SAGE_VENV='/usr'
Using --optional=pip,sage
Features to be detected: 4ti2,SAGE_SRC,benzene,bliss,buckygen,conway_polynomials,coxeter3,csdp,cvxopt,cvxopt,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_cubic_hecke,database_ellcurves,database_graphs,database_jones_numfield,database_knotinfo,dot2tex,dvipng,ecm,fpylll,fricas,gap_package_atlasrep,gap_package_design,gap_package_grape,gap_package_guava,gap_package_hap,gap_package_polenta,gap_package_polycyclic,gap_package_qpa,gap_package_quagroup,gfan,giac,glucose,graphviz,imagemagick,info,ipython,jmol,jupymake,jupyter_sphinx,kenzo,kissat,latte_int,lrcalc_python,lrslib,mathics,matroid_database,mcqd,meataxe,mpmath,msolve,nauty,networkx,numpy,palp,pandoc,pdf2svg,pdftocairo,pexpect,phitigra,pillow,plantri,polytopes_db,polytopes_db_4d,pplpy,primecountpy,ptyprocess,pycosat,pycryptosat,pynormaliz,pyparsing,python_igraph,requests,rpy2,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.libs.braiding,sage.libs.ecl,sage.libs.flint,sage.libs.gap,sage.libs.giac,sage.libs.homfly,sage.libs.linbox,sage.libs.m4ri,sage.libs.ntl,sage.libs.pari,sage.libs.singular,sage.misc.cython,sage.modular,sage.modules,sage.numerical.mip,sage.plot,sage.rings.complex_double,sage.rings.finite_rings,sage.rings.function_field,sage.rings.number_field,sage.rings.padics,sage.rings.polynomial.pbori,sage.rings.real_double,sage.rings.real_mpfr,sage.sat,sage.schemes,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,scipy,singular,sirocco,sloane_database,sphinx,symengine_py,sympy,tdlib,threejs,topcom
Doctesting 1 file.
sage -t --warn-long 5.0 --random-seed=338122519044229990874824510482622064820 /usr/lib/python3.13/site-packages/sage/rings/number_field/galois_group.py
**********************************************************************
File "/usr/lib/python3.13/site-packages/sage/rings/number_field/galois_group.py", line 997, in sage.rings.number_field.galois_group.GaloisGroup_v2.artin_symbol
Failed example:
    [G.artin_symbol(P) for P in K.primes_above(7)]
Expected:
    [(1,5)(2,6)(3,7)(4,8), (1,5)(2,6)(3,7)(4,8),
     (1,4)(2,3)(5,8)(6,7), (1,4)(2,3)(5,8)(6,7)]
Got:
    [(1,4)(2,3)(5,8)(6,7),
     (1,4)(2,3)(5,8)(6,7),
     (1,5)(2,6)(3,7)(4,8),
     (1,5)(2,6)(3,7)(4,8)]
**********************************************************************
1 item had failures:
   1 of   8 in sage.rings.number_field.galois_group.GaloisGroup_v2.artin_symbol
    [295 tests, 1 failure, 0.80s wall]
----------------------------------------------------------------------
sage -t --warn-long 5.0 --random-seed=338122519044229990874824510482622064820 /usr/lib/python3.13/site-packages/sage/rings/number_field/galois_group.py  # 1 doctest failed
----------------------------------------------------------------------
Total time for all tests: 1.6 seconds
    cpu time: 0.8 seconds
    cumulative wall time: 0.8 seconds
Features detected for doctesting: sage.groups,sage.rings.number_field,sage.symbolic

@dkwo
Copy link
Contributor

dkwo commented Dec 27, 2024

it seems that's just an ordering issue?

@tornaria
Copy link
Contributor Author

-rw------- 1 root root 205 Dec 26 17:58 sage-env-config

This probably means that the file in your void-packages repo is already 600 and we cp the file. There's a fair number of templates doing that, but most use vinstall.

I think we can do something like:

--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -51,7 +51,7 @@ post_install() {
        mv -T ${DESTDIR}/usr/bin ${DESTDIR}/usr/libexec/sagemath
 
        # copy configuration
-       cp ${FILESDIR}/sage-env-config ${DESTDIR}/usr/libexec/sagemath
+       vinstall ${FILESDIR}/sage-env-config 644 usr/libexec/sagemath
 
        # symlink main binary
        vmkdir usr/bin

to make sure the permissions are 644 regardless.

@tornaria
Copy link
Contributor Author

it seems that's just an ordering issue?

Yes, I'll try to adjust so the ordering doesn't affect the test.

@tornaria
Copy link
Contributor Author

@dkwo both issues should be fixed now 🤞

@dkwo
Copy link
Contributor

dkwo commented Dec 28, 2024

Thanks a lot! Everything works for me now on aarch64. cc @leahneukirchen

@leahneukirchen leahneukirchen merged commit cfd2807 into void-linux:master Dec 31, 2024
@tornaria tornaria deleted the sagemath branch January 4, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants