sage-on-gentoo
sage-on-gentoo copied to clipboard
sci-mathematics/sagemath-standard-10.6: build failure with GCC 15 and Cython 3.1.0
Thank you for maintaining this repo. I ran into 3 issues. I found workarounds for them, and thought it might be useful to share them here.
-
Sage 10.6 doesn't build with GCC 15. To be exact, sci-libs/linbox-1.7.0 doesn't build with GCC 15 without this patch. This has been fixed in upstream. Deps of Sagemath might need some adjustment based on the GCC version.
-
Sage 10.6 doesn't build with Cython 3.1.0. Error messages:
Error compiling Cython file:
------------------------------------------------------------
...
from .paridecl cimport (GEN, t_COMPLEX, dbltor, real_0_bit, stoi, cgetg,
set_gel, gen_0)
from .gen cimport Gen
from cpython.int cimport PyInt_AS_LONG
^
------------------------------------------------------------
/usr/lib/python3.13/site-packages/cypari2/convert.pxd:4:0: 'cpython/int.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
Downgrading to Cython 3.0.12 can be a temporary workaround.
- Sage 10.6 doesn't build with GCC 15 without flag -std=gnu17
In file included from /usr/include/ecl/ecl.h:81,
from /tmp/portage/sci-mathematics/sagemath-standard-10.6/work/sagemath_standard-10.6-python3_13/build0/cythonized/sage/libs/ecl.c:1275:
/usr/include/ecl/object.h:32:13: error: 'bool' cannot be defined via 'typedef'
32 | typedef int bool;
| ^~~~
/usr/include/ecl/object.h:32:13: note: 'bool' is a keyword with '-std=c23' onwards
/tmp/portage/sci-mathematics/sagemath-standard-10.6/work/sagemath_standard-10.6-python3_13/build0/cythonized/sage/libs/ecl.c:6395:5: error: conflicting types for 'ecl_numberp'; have 'int(union cl_lispunion *)'
6395 | int ecl_numberp(cl_object __pyx_v_obj) {
| ^~~~~~~~~~~
In file included from /usr/include/ecl/ecl.h:82:
/usr/include/ecl/external.h:1437:21: note: previous declaration of 'ecl_numberp' with type '_Bool(union cl_lispunion *)'
1437 | extern ECL_API bool ecl_numberp(cl_object x);
I have not started testing gcc-15. I am currently too busy to do those kind of things. linbox is in the main gentoo tree, you should fill a bug there. There is probably a bug tracking gcc-15 porting all over the tree. And this is https://github.com/sagemath/sage/pull/39985 in sagemath's github.
The cython 3.1.0 is new to me and strange. Was cypari2 rebuilt after upgrading to cython 3.1.0? If it was, this looks like a bug that should be reported in sage.
I think the flag change may already be merged into the upcoming 10.7. Still may have to backport it depending on how fast we move with gcc 15.
Looks like cython 3.1.0 is barrel of fun https://bugs.gentoo.org/show_bug.cgi?id=955519
I'm using gcc-14 and sagemath-standard(10.7.beta5) now builds using cython-3.1.1 after rebuilding cypari2(cypari2-2.2.2).
Yes, but I should backport stuff to 10.6. I have little time at the moment unfortunately. Unless I want a distraction.
I was able to compile with gcc-15 and cython-3.1.2 with these 2 patches.
sagemath-standard-10.6-patches.tar.gz
The patches were taken from here and modified to work with Gentoo.
I am surprised it was that easy :) I have been quite busy lately but have resumed some work on sage-on-gentoo. Because 10.7 is going to be released soon (10.7.rc0 has been released so hopefully, real soon) I had decided not to invest too much time in fixing 10.6. But if it is easy, I may get it in.
Well sage 10.7 is now released. So, I will not fix 10.6. It will be removed sometimes next week. Do let me know if 10.7 needs a fix too. Otherwise I will close this issue.
Thank you for the new version. 10.7 compiles without these patches.