Skip to content

Meson: make pari a dependency of cypari2#40844

Merged
vbraun merged 7 commits intosagemath:developfrom
tobiasdiez:no-pari-dep
Jan 14, 2026
Merged

Meson: make pari a dependency of cypari2#40844
vbraun merged 7 commits intosagemath:developfrom
tobiasdiez:no-pari-dep

Conversation

@tobiasdiez
Copy link
Copy Markdown
Contributor

Small improvement: We never use PARI directly (and we shouldn’t); we only use cypari2. However, PARI must still be declared as a dependency because cypari2 links against it and requires it at runtime. To make this explicit in the Meson build, we declare PARI as a dependency of cypari2, not of our own code. (I also asked on the cython mailing list if there is a clearer way to avoid the explicit pari dependency).

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 18, 2025

Documentation preview for this PR (built with commit 7f3cfd1; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@dimpase
Copy link
Copy Markdown
Member

dimpase commented Sep 23, 2025

we have spkgs eclib, lcalc, and sympow which do use pari without cypari. So I don't quite understand the claim

@tobiasdiez tobiasdiez marked this pull request as ready for review September 28, 2025 03:04
@tobiasdiez
Copy link
Copy Markdown
Contributor Author

we have spkgs eclib, lcalc, and sympow which do use pari without cypari. So I don't quite understand the claim

Sure, other packages may use pari. The point here is that sagelib code shouldn't directly access say pari headers - that should only happen via cypari2.

It's not meant to say that you no longer have to install pari to use sage.

@orlitzky
Copy link
Copy Markdown
Contributor

I was going to ask "what goes wrong if we don't link with libpari?" but you answered it in your mailing list post. This looks OK to me then. The "pari" dependency in meson was always libpari so this is making the deps more strict by only using it when we are involving cypari2.

Not really related, but sagelib does still need the pari CLI if you want the tests to pass. There are a lot that do sage: gp(x). Most of those should be updated to use pari(x) instead, though, and we should hide all of sage/interfaces/gp.py behind a feature test for the executable... and ideally deprecate it.

vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 13, 2026
sagemathgh-40844: Meson: make pari a dependency of cypari2
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Small improvement: We never use PARI directly (and we shouldn’t); we
only use cypari2. However, PARI must still be declared as a dependency
because cypari2 links against it and requires it at runtime. To make
this explicit in the Meson build, we declare PARI as a dependency of
cypari2, not of our own code. (I also asked on the cython mailing list
if there is a clearer way to avoid the explicit pari dependency).

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40844
Reported by: Tobias Diez
Reviewer(s):
@vbraun vbraun merged commit 40da0b7 into sagemath:develop Jan 14, 2026
29 of 31 checks passed
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.

5 participants