Error compiling sagelib-10.2 with --enable-system-site-packages

168 views
Skip to first unread message

Niranjana K M

unread,
Jan 11, 2024, 11:56:13 PM1/11/24
to sage-devel
Dear all,
I am trying to build sagemath with experimental --enable-system-site-packages configure option. It had trouble building cysignals and fpylll spkgs. In both cases I installed these as system packages and avoided the error building here in sagemath. But similar issue came while building sagelib.

[sagelib-10.2]     Exception while cythonizing source files: ValueError('got unknown compiler directives: legacy_implicit_noexcept, cpow')
[sagelib-10.2]     ************************************************************************
[sagelib-10.2]     Traceback (most recent call last):
[sagelib-10.2]       File "<string>", line 2, in <module>
[sagelib-10.2]       File "<pip-setuptools-caller>", line 34, in <module>
[sagelib-10.2]       File "/mnt/vol_05/for-gentoo/sage/sage/src/setup.py", line 118, in <module>
[sagelib-10.2]         extensions = cythonize(
[sagelib-10.2]                      ^^^^^^^^^^
[sagelib-10.2]       File "/mnt/vol_05/for-gentoo/sage/sage/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 962, in cythonize
[sagelib-10.2]         pythran_options = CompilationOptions(**options)
[sagelib-10.2]                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[sagelib-10.2]       File "/mnt/vol_05/for-gentoo/sage/sage/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/Cython/Compiler/Main.py", line 573, in __init__
[sagelib-10.2]         raise ValueError(message)
[sagelib-10.2]     ValueError: got unknown compiler directives: legacy_implicit_noexcept, cpow
[sagelib-10.2]     ************************************************************************

I am running on Gentoo Linux and sagemath is from git master branch.
I am having system cython-3.0.6 built on python-3.11.7.

Please help me to resolve it.
sagelib-10.2.log
config.log

Michael Orlitzky

unread,
Jan 12, 2024, 6:39:39 AM1/12/24
to sage-...@googlegroups.com
On Thu, 2024-01-11 at 20:56 -0800, Niranjana K M wrote:
>
> I am running on Gentoo Linux and sagemath is from git master branch.
> I am having system cython-3.0.6 built on python-3.11.7.
>
> Please help me to resolve it.
>

Can you post your config.log?

Niranjana K M

unread,
Jan 12, 2024, 7:54:36 AM1/12/24
to sage-...@googlegroups.com
It is attached in the previous mail.

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/c5cf266528f33850d3f1f4eac10e3c2e76c211b1.camel%40orlitzky.com.

Michael Orlitzky

unread,
Jan 12, 2024, 8:33:36 AM1/12/24
to sage-...@googlegroups.com
On Fri, 2024-01-12 at 18:24 +0530, Niranjana K M wrote:
> It is attached in the previous mail.
>

Indeed, sorry, it was my first email of the day. I have to get warmed
up first.

One thing I noticed is that you said "master" branch. Please try the
"develop" branch instead -- that's where the actual development takes
place. Both Sage and Gentoo are fast-moving and you'll have better luck
with the latest code.

(Does anyone actually use the master branch? Someone who wants to check
out a release could just, like, check out the release. They're tagged.
It's a silly pitfall.)

Michael Orlitzky

unread,
Jan 12, 2024, 11:48:48 AM1/12/24
to sage-...@googlegroups.com
On Fri, 2024-01-12 at 08:33 -0500, Michael Orlitzky wrote:
>
> One thing I noticed is that you said "master" branch. Please try the
> "develop" branch instead -- that's where the actual development takes
> place. Both Sage and Gentoo are fast-moving and you'll have better luck
> with the latest code.

I tried with "master" and did not hit this issue. Our systems are
otherwise very similar so that is discouraging, but doesn't necessarily
mean that "develop" won't work for you. I'll continue to poke at it.


Niranjana K M

unread,
Jan 12, 2024, 12:25:02 PM1/12/24
to sage-devel
Should I have had started by cleaning the previous builds? It may be still using old Cython spkg, built when it was sage 10.0 release. Because in venv site-packages, it still says  sage/venv/lib64/python3.11/site-packages/Cython-0.29.32.dist-info.

What are the right sequence of commands to update an existing sagemath git installation? I just did:
$ git fetch --all
$ git pull --all
$ git checkout master
$ ./bootstrap
$ ./configure --enable-system-site-packages --enable-fricas
$ make -j2

Michael Orlitzky

unread,
Jan 12, 2024, 2:56:54 PM1/12/24
to sage-...@googlegroups.com
On Fri, 2024-01-12 at 09:25 -0800, Niranjana K M wrote:
> Should I have had started by cleaning the previous builds? It may be still
> using old Cython spkg, built when it was sage 10.0 release. Because in venv
> site-packages, it still says
> sage/venv/lib64/python3.11/site-packages/Cython-0.29.32.dist-info.

Very possibly.


> What are the right sequence of commands to update an existing sagemath git
> installation? I just did:

Personally I run `git clean -x -f -d` before ./bootstrap to remove
absolutely everything that isn't part of the repository.

Niranjana K M

unread,
Jan 13, 2024, 4:32:26 AM1/13/24
to sage-...@googlegroups.com
Thank you Michael Orlitzky, it worked after cleaning the previous builds. I did,
$ make maintainer-clean

Which is equivalent to, according to the Makefile,
$ make distclean bootstrap-clean

I thought the installation would replace the previous builds when new system packages are available. It is preferring old local spkg installs, if already present, than new versions in system. But if it is spkg only it is going for update.

Is it needed to be fixed or is it usual?

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

Michael Orlitzky

unread,
Jan 13, 2024, 8:07:58 AM1/13/24
to sage-...@googlegroups.com
On Sat, 2024-01-13 at 14:54 +0530, Niranjana K M wrote:
>
> I thought the installation would replace the previous builds when new
> system packages are available. It is preferring old local spkg installs, if
> already present, than new versions in system. But if it is spkg only it is
> going for update.
>
> Is it needed to be fixed or is it usual?

Both.

It should have used the newer packages, but I can't say I'm surprised
that something went wrong. The reason I `git clean -x -f -d` before
every build is because I used to hit these strange issues too often.

FWIW we're about to get GAP in Gentoo:

https://github.com/gentoo/gentoo/pull/34472

And then the only system packages that are missing are PALP and a few
databases. Everything else can be detected and used by Sage, and that
should speed up a clean build by a lot. I would still recommend the
"develop" branch to keep up with the latest changes until Sage itself
finds its way into Gentoo.

Niranjana K M

unread,
Jan 16, 2024, 10:31:30 AM1/16/24
to sage-...@googlegroups.com

FWIW we're about to get GAP in Gentoo:

  https://github.com/gentoo/gentoo/pull/34472

And then the only system packages that are missing are PALP and a few
databases. Everything else can be detected and used by Sage, and that
should speed up a clean build by a lot. I would still recommend the
"develop" branch to keep up with the latest changes until Sage itself
finds its way into Gentoo.

Very nice and good work.

I guess, what Sage is doing with --enable-system-site-packages is that it opens up system's python site-packages. But priority will be the site-packages of Sage installed site-packages directory. Similar to the site-package of $HOME/.local/lib/python3.11/site-packages is prioritized over the one in /usr/lib/python3.11/site-packages. When we are reconfiguring and building Sage, if it detects system python packages, it is just skipping the installation of the respective package as the system site-packages is having that package. But it would have also uninstalled the existing spkg instead of just leaving it.
Reply all
Reply to author
Forward
0 new messages