Skip to content

Conversation

tobiasdiez
Copy link
Contributor

@tobiasdiez tobiasdiez commented Aug 25, 2025

If gphelp is not available (which happens actually on a few linux distros that don't ship the docs of pari with the pari install), then the install of cypari just fails. With this, instead the compilation succeeds but the auto-generated functions don't have any docstrings. Perhaps not ideal, but still better than not being to install it at all.

Refs #184

@videlec
Copy link
Collaborator

videlec commented Aug 25, 2025

Indeed, the separation between gp and gphelp is annoying. I wonder how the linux distros you mentioned manage the interactive help in a gp prompt. Do you know?

I am not sure it is a good idea to silently build if gphelp is not available. The user will not have access to the function helper ? in an interactive session. And installing gphelp afterwards will not help since this is compiled.

It seems a better idea to me to add an option to disable the docstrings. Then, if in a standard build gphelp is not found, I suggest rather to raise an error with further instructions

...
WhateverError: gphelp not found on the system. You can compile cypari2 by either installing all required dependency or providing the --disable-docstrings option on the setup command line.

What do you think?

@tobiasdiez
Copy link
Contributor Author

I agree it would certainly be nice to still have the documentation available on those systems. But on the other hand it shouldn't come to surprising to users that the cypari methods don't have docs when their pari counterparts don't have docs as well.

My use case is that I want pip install sagemath to succeed, and currently it fails on certain systems during the "getting build dependencies" due to failures in building cypari. In this case, it's also not easily possible to pass build options to cypari.

So while this approach here is perhaps not the best, I hope it's good enough...

@tobiasdiez
Copy link
Contributor Author

I wonder how the linux distros you mentioned manage the interactive help in a gp prompt. Do you know?

I don't really know. I have that problem on gentoo (sagemath/sage#40663) and on Alpine (sagemath/sage#40561), and I think also on ubuntu 22 + 24.

@videlec
Copy link
Collaborator

videlec commented Aug 29, 2025

Since in cypari the pari documentation is compiled as docstrings, it makes a huge difference with gp. You can install gp and gphelp in any order and will have the interactive documentation available. While for cypari, gphelp must be there at compile time.

I agree it would certainly be nice to still have the documentation available on those systems. But on the other hand it shouldn't come to surprising to users that the cypari methods don't have docs when their pari counterparts don't have docs as well.

What about a user who uses cypari but not pari? The interactive documentation is advertized in cypari and your PR is breaking this promise.

My use case is that I want pip install sagemath to succeed, and currently it fails on certain systems during the "getting build dependencies" due to failures in building cypari. In this case, it's also not easily possible to pass build options to cypari.

It this a dependency problem, then why not install gphelp on those systems and make it a dependency of cypari?

So while this approach here is perhaps not the best, I hope it's good enough...

This PR could possibly solve for your usecase but it is only making cypari worse.

@tobiasdiez
Copy link
Contributor Author

Since in cypari the pari documentation is compiled as docstrings, it makes a huge difference with gp. You can install gp and gphelp in any order and will have the interactive documentation available. While for cypari, gphelp must be there at compile time.

You could also simple reinstall cypari after installing gphelp....it's not like this takes a very long time or is super complicated.

What about a user who uses cypari but not pari? The interactive documentation is advertized in cypari and your PR is breaking this promise.

Mhh, I'm not sure what this PR is breaking. Suppose a user has pari without gphelp installed. Then:

  • Currently, installation of cypari2 fails. So the user doesn't get anything.
  • With this PR, installation of cypari2 succeeds but there are no docs.

Once you have gphelp installed, you get the same result with this PR as before. So, for me, this is a net-positive.

Note also that the readme only mentions "PARI/GP >= 2.9.4 (header files and library)" as requirements for installation, not also the docs of pari / gphelp.

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.

2 participants