Build Failure: Cython CompileError in pari/convert_sage.pyx (pari_PRIMES) (develop branch)

94 views
Skip to first unread message

Ashutosh Rajora

unread,
Mar 26, 2025, 1:12:11 PM3/26/25
to sage-support

Hello ,

I was working on an issue,  I've set up my environment, cloned the repository, and followed the developer guide to prepare for making changes.

After creating a new branch (fix-limit-syntax-38761) from the develop branch and applying the necessary code changes to src/sage/calculus/calculus.py, I encountered a build failure when running ./sage -br.

The core error seems unrelated to my changes :

[sagelib-10.6.rc0] [spkg-install] sage/libs/pari/convert_sage.pyx:578:10: undeclared name not builtin: pari_PRIMES [sagelib-10.6.rc0] [spkg-install] Exception while cythonizing source files: CompileError(None, 'sage/libs/pari/convert_sage.pyx') ... [sagelib-10.6.rc0] [spkg-install] Cython.Compiler.Errors.CompileError: sage/libs/pari/convert_sage.pyx

To check whether the error coming was due to the changes i made in the calculus file i did the following:

  1. Ran make sagelib-clean and then ./sage -br. The error persisted.

  2. Used git stash to temporarily remove my changes to src/sage/calculus/calculus.py and ran ./sage -br again. The same error occurred, Restored my changes (git stash pop).

  3. Ran make clean and then ./sage -br. The error persisted.

  4. Updated my local develop branch (git checkout develop &  git pull upstream develop).

  5. Switched back to my feature branch (git checkout fix-limit-syntax-38761).

  6. Committed my changes to calculus.py.

  7. Rebased my branch onto the updated develop branch (git rebase develop).

  8. Ran ./sage -br again. The error persisted.

    My build environment details are:

  • Operating System: Ubuntu 22.04.4 LTS (running on WSL2 )

  • Python: 3.12.5 (from Sage's venv)

  • GCC: 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)


    Could someone please provide guidance on how to resolve this build issue related to pari_PRIMES in sage/libs/pari/convert_sage.pyx?


I have attached the relevant log files:

  • logs/pkgs/sagelib-10.6.rc0.log 

  • config.log


sagelib-10.6.rc0.log
config.log

Antonio Rojas

unread,
Mar 26, 2025, 2:02:53 PM3/26/25
to sage-support
Can you post the pari and cypari build logs too?

Ashutosh Rajora

unread,
Mar 27, 2025, 12:28:19 AM3/27/25
to sage-support
Sure, here they are :
cypari-2.2.0.log
pari-2.15.5.log

Antonio Rojas

unread,
Mar 27, 2025, 3:33:05 AM3/27/25
to sage-support
This doesn't match what your config.log says:
[...]
real_configure:113712: result: cypari: no suitable system package; standard, installed SPKG version 2.2.0 will be replaced by version 2.2.1 [...]
real_configure:145677: result: pari: installed SPKG version 2.15.5 will be replaced by version 2.17.1 [...]
Are those logs from your current installation attempt?

Ashutosh Rajora

unread,
Mar 27, 2025, 4:19:09 AM3/27/25
to sage-support
well i am not sure, they should be, how do i confirm this ?

Ashutosh Rajora

unread,
Mar 27, 2025, 5:40:53 AM3/27/25
to sage-support
I faced an issue while building Sage from source 2-3 weeks, what i ended up doing was that whenever i used to face any error while build i used to delete things and then again run build, so probably this could have caused some inconsistency or incompatibility related to the PARI upgrade ??

Ashutosh Rajora

unread,
Mar 27, 2025, 12:46:18 PM3/27/25
to sage-support
woahh, now it seems the build is broken and even sage is not working, do i need to build it again?
Screenshot 2025-03-27 193216.png

Dima Pasechnik

unread,
Mar 27, 2025, 2:05:00 PM3/27/25
to sage-s...@googlegroups.com
clean up the repo:

   git clean -fdx

then update the branch

   git pull

and build again

Ashutosh Rajora

unread,
Mar 28, 2025, 10:11:10 AM3/28/25
to sage-support
Sir, thanks a lot for the fix, it worked.

Successfully raised a PR for the issue i was working on

Thanks,
Reply all
Reply to author
Forward
0 new messages