(Urgent) cannot install pyscipopt

93 views
Skip to first unread message

Martin R

unread,
Feb 16, 2024, 10:48:09 AMFeb 16
to sage-devel
I (urgently) need the scip MILP solver (on 10.3.beta8, Ubuntu 22.04).

sage -i pyscipopt

ends with

***************************************************************
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make pyscipopt'):

* package:         numpy-1.26.2
 last build time: Feb 4 18:46
 log file:        /home/martin/sage-trac/logs/pkgs/numpy-1.26.2.log

* package:         pyscipopt-4.3.0
 last build time: Feb 16 16:44
 log file:        /home/martin/sage-trac/logs/pkgs/pyscipopt-4.3.0.log

It is safe to delete any log files and build directories, but they
contain information that is helpful for debugging build problems.
WARNING: If you now run 'make' again, the build directory of the
same version of the package will, by default, be deleted. Set the
environment variable SAGE_KEEP_BUILT_SPKGS=yes to prevent this.

make: *** [Makefile:40: pyscipopt] Error 1

The log is attached.

Please excuse me posting to the wrong list, etc.

Martin
pyscipopt-4.3.0.log

Dima Pasechnik

unread,
Feb 16, 2024, 11:01:46 AMFeb 16
to sage-devel
Try  ./sage --pip install pyscipopt

it appears they have a newer version now, 4.4.0.

HTH
Dima

Matthias Koeppe

unread,
Feb 16, 2024, 11:55:21 AMFeb 16
to sage-devel
As noted in https://github.com/sagemath/sage/wiki/Sage-10.2-Release-Tour#known-problems-and-workarounds, our pyscipopt package has not been updated to work with Cython 3 yet. (Still the same in upstream PySCIPOpt master, as noted https://github.com/scipopt/PySCIPOpt/pull/630#issuecomment-1938080592)

Dima Pasechnik

unread,
Feb 16, 2024, 12:33:07 PMFeb 16
to sage-devel
But you can be lucky with the binary wheel you can get from PyPI. I didn't test it though, but perhaps it will just work.

Martin R

unread,
Feb 16, 2024, 1:39:52 PMFeb 16
to sage-devel
Any hope left?  If not, which version of sage do I have to downgrade to?

Thank you for all the hints so far!

Martin

martin@toolbox:~/sage-trac$ ./sage -pip install pyscipopt
Collecting pyscipopt
 Downloading PySCIPOpt-4.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (8.3 kB)
Downloading PySCIPOpt-4.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.9 MB)
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.9/12.9 MB 5.3 MB/s eta 0:00:00
Installing collected packages: pyscipopt
Successfully installed pyscipopt-4.4.0
martin@toolbox:~/sage-trac$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.3.beta8, Release Date: 2024-02-13              │
│ Using Python 3.10.12. Type "help()" for help.                      │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛                 
sage: default_sdp_solver("SCIP")

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

...

Dima Pasechnik

unread,
Feb 16, 2024, 2:18:42 PMFeb 16
to sage-...@googlegroups.com
You need an SPD solver - it's a different package, scip_sdp, not pyscipopt.
Try 

make scip_sdp

(probably followed up by "make build", just in case)

Martin R

unread,
Feb 16, 2024, 2:25:07 PMFeb 16
to sage-devel
Oh no, sorry, this was a typo!

YES SCIP WORKS!

Only, for some reason this is now slower than GLPK - I'm lost.  I'll look through the tickets, I think there was a specific one responsible for big speedups.

Thank you so much for your support!

Martin

Dima Pasechnik

unread,
Feb 16, 2024, 2:31:15 PMFeb 16
to sage-...@googlegroups.com
On Fri, Feb 16, 2024 at 7:25 PM 'Martin R' via sage-devel <sage-...@googlegroups.com> wrote:
Oh no, sorry, this was a typo!

YES SCIP WORKS!

Only, for some reason this is now slower than GLPK - I'm lost.  I'll look through the tickets, I think there was a specific one responsible for big speedups.

you've installed a binary blob, which is almost surely suboptimal for your CPU.

Did you try cbc package? It's also a faster than GLPK LP solver.

Or get an academic license for GUROBI.

 
--
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/6907b47b-96b2-45fb-8bd6-f437b023e935n%40googlegroups.com.

Martin R

unread,
Feb 16, 2024, 2:41:55 PMFeb 16
to sage-devel
I'm currently checking out https://github.com/sagemath/sage/pull/35103 and browsing through old issues (there should be one speeding up add_constraint, because indeed for the current problem most of the time (according to %prun) is spent in add_constraint, and I reported and fixed some of these a long time ago, but apparently, they never made it into sage.  what a waste).

I'll look into the other options after that!  Thank you so much!

Martin

Martin R

unread,
Feb 16, 2024, 3:14:20 PMFeb 16
to sage-devel
Indeed, #35103 gives a speedup of 50% in the case I'm considering!

Martin
Reply all
Reply to author
Forward
0 new messages