Ask Your Question
1

installing msolve on a binary release of SageMath-10.7 for macOS

asked 2025-10-15 21:02:38 +0100

Sébastien gravatar image

updated 2025-10-22 19:41:30 +0100

Bonjour,

A colleague of mine is using macOS. We managed to install and use the binary release of SageMath-10.7 for macOS 10.13 availaible at https://github.com/3-manifolds/Sage_m.... Now my colleague wants to install msolve to solve groebner basis.

  • Unfortunately, sage -i msolve does not work? What is the recommended way to install a package like msolve on this sage? The user is a usual mac user which hates opening a terminal.
  • I don't know from which repository I could run make msolve ?
  • Therefore, I installed Xcode tools and I downloaded the msolve source from https://msolve.lip6.fr/ and run .configure, make and sudo make install.
  • The command msolve is now present (all tests passed during make check) on the command line (both the normal command line and sage -sh).

Surprisingly, sage keeps telling me the msolve feature is still not present (?). I get the following error:

sage: P.<a,b,c> = PolynomialRing(QQ,3, order='degrevlex')
sage: I = sage.rings.ideal.Katsura(P,3)
sage: I.groebner_basis(algorithm='msolve', proof=False)
Traceback (most recent call last)
...
FeatureNotPresentError: msolve is not available.
Executable 'msolve' not found on PATH.
Further installation instructions might be available at https://msolve.lip6.fr/.

Why?

UPDATE:

On the command line (after running sage in the terminal), the msolve feature is not detected eventhough it is present:

sage: from sage.features.msolve import msolve
sage: msolve().is_present()
FeatureTestResult('msolve', False)
sage: msolve().is_functional()
FeatureTestResult('msolve', False)
sage: !msolve -h
msolve library for polynomial system solving
implemented by J. Berthomieu, C. Eder, M. Safey El Din
...

But, in a jupyter notebook, I get something different, or let's say worse, because an error is raised. I get:

sage: from sage.features.msolve import msolve
sage: msolve().is_present()
FeatureTestResult('msolve', False)
sage: msolve().is_functional()
Traceback (most recent call last):
File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/features/msolve.py:57, in msolve.is_functional(self)
     56         """
---> 57         msolve_out = subprocess.run(["msolve", "-h"], capture_output=True)
     59 #        if msolve_out.returncode != 0:
FileNotFoundError: [Errno 2] No such file or directory: 'msolve'
sage: !msolve -h
zsh:1: command not found: msolve
edit retag flag offensive close merge delete

Comments

Try to run the following and check the output:

from sage.features.msolve import msolve
msolve().is_present()
msolve().is_functional()
Max Alekseyev gravatar imageMax Alekseyev ( 2025-10-18 02:55:21 +0100 )edit

The first returns FeatureTestResult('msolve', False). The second returns:

Traceback (most recent call last):
File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/features/msolve.py:57, in msolve.is_functional(self)
     56         """
---> 57         msolve_out = subprocess.run(["msolve", "-h"], capture_output=True)
     59 #        if msolve_out.returncode != 0:
FileNotFoundError: [Errno 2] No such file or directory: 'msolve'
Sébastien gravatar imageSébastien ( 2025-10-21 00:35:15 +0100 )edit

Also:

!msolve -h
zsh:1: command not found: msolve

which makes me thinks I may have compiled msolve using bash, but not zsh. Maybe it is a reason it does not sees msolve?

Sébastien gravatar imageSébastien ( 2025-10-21 03:53:04 +0100 )edit

In the question you said that sage: !msolve -h works, but now you say it doesn't. Please clarify.

Max Alekseyev gravatar imageMax Alekseyev ( 2025-10-21 21:42:46 +0100 )edit

My bad. I am reporting from my ubuntu about the behavior on the mac of a colleague. I assumed something which was not true when writing the question. I just fixed the question: I removed the "This confirms msolve is there:" part.

Sébastien gravatar imageSébastien ( 2025-10-22 15:47:17 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2025-10-22 18:21:20 +0100

My guess is that /usr/local/bin is not in the user's PATH, but that's where msolve was installed. To repair this:

  • Within Sage you can run something like os.environ['PATH'] += ":/usr/local/bin" to append that directory to PATH. If this works, then alter your PATH in your shell's init file to make the change persistent.
  • Alternatively, when you build msolve, you can use ./configure --prefix=/path/to/someplace/else, to specify another location in which to install it, ideally some place that's already in your PATH. Maybe $HOME/.local?
  • Alternatively, you could use homebrew to install their version of msolve, and also follow the homebrew instructions to make sure that you permanently add the appropriate directories to your PATH.
edit flag offensive delete link more

Comments

Thank you John. I will be away for the next days. I will have access to the machine again only next Monday. I will report back next week.

Sébastien gravatar imageSébastien ( 2025-10-23 03:27:33 +0100 )edit

Indeed, I confirm that /usr/local/bin is where msolve got installed but it was not in the PATH when running the Jupyter notebook. After adding os.environ['PATH'] += ":/usr/local/bin" to the init.sage, I can now confirm that !msolve -h is now recognized in a Jupyter cell.

Now, the behavior of the sage command line and the Jupyter notebook are the same: msolve().is_present() returns FeatureTestResult('msolve', False). Any further clue why it does not return True?

Sébastien gravatar imageSébastien ( 2025-10-31 18:39:46 +0100 )edit

What happens if you do: import subprocess; subprocess.run(["msolve", "-h"]) ?

John Palmieri gravatar imageJohn Palmieri ( 2025-10-31 21:15:12 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2025-10-15 21:02:38 +0100

Seen: 192 times

Last updated: Oct 22