Created attachment 883334 [details] output of `emerge --info '=sci-mathematics/sage-10.2::sage-on-gentoo'` Compilation of sci-mathematics/sage-10.2 failes with Cython.Compiler.Errors.CompileError: sage/algebras/fusion_rings/shm_managers.pyx
Created attachment 883335 [details] content of /var/tmp/portage/sci-mathematics/sage-10.2/temp/build.log This is the build log of sage-10.2
Thanks Mark-Joe for the report. I must say I have been unable to reproduce the error so far. I will confess that I have not done a build with python 3.10 in ages and it is not even on my current Gentoo systems anymore. For now, my leading theory is that building with 3.10 has issues, and I may just drop it if it is confirmed. Does the build succeed with python 3.11? Which version of cython do you have installed?
I could successfully build sage in a gentoo container with python 3.10 from scratch. So I suspect there is something else going on in your environment.
I switched to python 3.11 and then from cython 3.0.6 to cython 3.0.8 Every time compilation failed with the error Cython.Compiler.Errors.CompileError: sage/algebras/fusion_rings/shm_managers.pyx What else could I try?
Error compiling Cython file: ------------------------------------------------------------ ... from cysignals.memory cimport sig_malloc from multiprocessing import shared_memory from sage.algebras.fusion_rings.poly_tup_engine cimport poly_to_tup, tup_fixes_sq, _flatten_coeffs from sage.rings.integer cimport Integer from sage.rings.rational cimport Rational from sage.rings.polynomial.multi_polynomial cimport MPolynomial_libsingular ^ ------------------------------------------------------------ sage/algebras/fusion_rings/shm_managers.pyx:25:0: 'sage/rings/polynomial/multi_polynomial/MPolynomial_libsingular.pxd' not found Error compiling Cython file: ------------------------------------------------------------ ... else: self.fvars = np.ndarray((self.ngens, ), dtype=self.fvars_t) self.child_id = 0 # Populate with initialziation data for sextuple, fvar in init_data.items(): if isinstance(fvar, MPolynomial_libsingular): ^ ------------------------------------------------------------ sage/algebras/fusion_rings/shm_managers.pyx:505:32: 'MPolynomial_libsingular' is not a constant, variable or function identifier Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1350, in cythonize_one_helper return cythonize_one(*m) File "/usr/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1326, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: sage/algebras/fusion_rings/shm_managers.pyx This is very strange. Why does it look for sage/rings/polynomial/multi_polynomial/MPolynomial_libsingular.pxd which does not exist? The definition is available in sage/rings/polynomial/multi_polynomial.p{xd,yx}. You do not happen to have some special cython flags setup globally? I do not know what that would look like but it is the only thing I can think of. One thing that could be tried is change the failing "from" import to from sage.rings.polynomial.multi_polynomial_libsingular cimport MPolynomial_libsingular I could give you a patch to try.
Also, is this your first time building sage or did you have success building it before?
Thanks, looking into the previous installation of sage was helpful. I had sage 9.8 installed and wanted to upgrade. As long as sage 9.8 was still existing on my PC, I could not compile sage 10.2. After uninstalling sage 9.8 and python 3.10 I could compile sage 10.2. Unfortunately, sage 10.2 does not work fully, yet, though. When I run it in a terminal, I get the following: SageMath version 10.2, Release Date: 2023-12-03 │ │ Using Python 3.12.1. Type "help()" for help. Warning: sage.all is not available; this is a limited REPL. I am wondering what to do to make the warning disappear and have sage.all available.
I see, the old install was in the way. I may have to look into putting hard blockers on older versions of sage to force cleaning before install. Can you check you have the same problem when running sage with other python? Like EPYTHON=python3.11 sage for example?
Thanks. I tried EPYTHON=python3.11 sage but it gives the same warning that sage.all is missing.
I try to reinstall all python packages needed for sage, like numpy, etc. and see whether that helps.
If that does not fix it, can you send the result of equery f sage equery should be in gentoolkit if you do not have it installed.
Created attachment 884160 [details] output of "equery f sage" Reinstalling the python packages for sage did not help. I attach the output from equery f sage Thanks
OK, sage.all is definitely there. I also do not have an issue on my current stable machine. But I will do a rebuild just in case something changed since the last install.
OK, I updated everything to make sure it was not a new behavior from ipython but no. I do not run into that problem. I am thinking there may be some settings in .sage or .ipython that are responsible. So, let's see what happens when you run sage --nodotsage ? From the python shell type import sage ? Same thing but from ipython rather than python?
sage --nodotsage shows the same: Warning: sage.all is not available; this is a limited REPL. The command import sage in either the python or the ipython shell does not give a warning. I try to recompile all scientific libraries and see what happens.
I am fairly sure that's a waste of time. I'll try to dig the error code to see if I can find a clue.
It was easier to find than I expected. It is coming from sage/misc/banner.py. It should only happen if an import of sage.all does fail. Can you start sage with SAGE_BANNER="no" sage and then try import sage.all
Just digged around sage's start up scripts. Basically sage is started from python and the first python commands are from sage.misc.banner import banner banner() and the message comes from banner_text which is called by banner(). What does it says when run from python directly?
Under ipython and python I tried from sage.misc.banner import banner banner() and always got the warning "sage.all is not available" back. Calling import sage.all results in the following: ImportError: /usr/lib/python3.12/site-packages/sage/matrix/matrix_modn_dense_float.cpython-312-x86_64-linux-gnu.so: undefined symbol: _ZNK6Givaro7IntegercvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEB5cxx11Ev Under some google group https://groups.google.com/g/sage-support/c/we-BvSt6WRk I found that that indicates a linking error and that probably files from some old sage installation are picked up. That is also my impression but I can't figure out which files/libraries these are. I removed the old sage 9.8 but it seems some stuff is still there. On another machine with a rather new gentoo installation and no old sage installation I could install sage 10.2 without any problem.
After having recompiled gcc-12, deleted old instances of gcc and after recompilation of all packages needed for sage with gcc-12 it now works. There is no warning about a missing sage.all I could not figure out exactly what the reason was, but there was some indication that it could have to do with an old libstdc++ . Thanks for the help.
I meant to answer earlier but I am at a conference and quite busy. From the output, the faulty package would have been givaro (and yes it is C++ and a change of C++ abi causing that kind of error is not a first). In the case of givaro it is part of a stack that needs to be rebuild together: givaro/fflas-ffpack/linbox.