rust-or / good_lp

Linear Programming for Rust, with a user-friendly API. This crate allows modeling LP problems, and lets you solve them with various solvers.
https://crates.io/crates/good_lp
MIT License
216 stars 35 forks source link

Add support for SCIP #23

Closed mmghannam closed 1 year ago

mmghannam commented 1 year ago

Related issue: #11

mmghannam commented 1 year ago

I added support for the SCIP solver, but there's one issue I could not fix related to CI. There is no prebuilt Debian package for SCIP for ubuntu 22.04. This can be solved in two ways:

dlaehnemann commented 1 year ago

I think you should be able to install it via conda, as SCIP is available on conda-forge.org as a package aptly called scip.

And as far as I understand it, the standard linux containers on GitHub Actions come with conda pre-installed. So you should be able to simply add the following line to the install deps step:

conda install -y --channel conda-forge scip

This will have conda install the package scip from the --channel conda-forge, without asking for interactive confirmation on the command-line (-y for just saying yes).

Hope that helps.

mmghannam commented 1 year ago

@dlaehnemann That's a good idea, thank you! I tried it but the build script couldn't find the SCIP installation. I will fix that issue first in russcip and link to an updated version here.

lovasoa commented 1 year ago

Maybe you can install the old .deb in the newer Ubuntu ?

mmghannam commented 1 year ago

Maybe you can install the old .deb in the newer Ubuntu ?

I already tried that and I get a dependecy error that I could not fix.

 scipoptsuite : Depends: libgsl23 (>= 2.5) but it is not installable
mmghannam commented 1 year ago

@lovasoa Now it's working with the conda setup. Thank you again @dlaehnemann for the suggestion!

lovasoa commented 1 year ago

@mmghannam, can you also update the README ?

lovasoa commented 1 year ago

Hello @pokutta, maybe you can advise us.

We are trying to provide an easy to use binding to SCIP fot the rust programming language. What is the preferred way to install scip on a recent ubuntu ? The package provided on the official website depends on libgsl23, but it looks like it has been removed in favor of libgslcblas0 in recent versions of debian and ubuntu. Trying to install it on ubuntu results in

Package libgsl23 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libgslcblas0 libgslcblas0:i386
matbesancon commented 1 year ago

looks good! Awesome to have SCIP here

lovasoa commented 1 year ago

@mmghannam , would you be interested in moving russcip and scip-sys to the @rust-or organization ? You would keep control over the repos, but it would be an insurance for the community that they stay maintained.

mmghannam commented 1 year ago

@mmghannam , would you be interested in moving russcip and scip-sys to the @rust-or organization ? You would keep control over the repos, but it would be an insurance for the community that they stay maintained.

I appreciate the offer, but I would rather keep it on my account for now until it grows a bit more. If there is anything else you would like me to change/add to the pull request, I'd be happy to do it.

lovasoa commented 1 year ago

I made a few changes to this PR, I think it is ready.

If you want to stay the only maintainer of russcip, do you guarantee you will be able to maintain it in the long term, and keep it up to date with the upstream SCIP ?

I had a look at the code of russcip, and opened a few issues: https://github.com/mmghannam/russcip/issues

mmghannam commented 1 year ago

I made a few changes to this PR, I think it is ready.

Great!

If you want to stay the only maintainer of russcip, do you guarantee you will be able to maintain it in the long term, and keep it up to date with the upstream SCIP ?

That's a tough question, I guess I do guarantee it in the short term, and if that changes I will look for more maintainers to add to the project. If you have other questions, we can discuss this further through email (ghannam@htw-berlin.de) if you want.

I had a look at the code of russcip, and opened a few issues: mmghannam/russcip/issues

Thanks a lot! this is very helpful.

lovasoa commented 1 year ago

If you don't want to move russcip to the @rust-or organization, could you maybe add at least one other maintainer to your existing repository ? Maybe one of your teachers, or someone from the scip project directly ? I think that would reassure users.

There are still memory safety issues in the code.

mmghannam commented 1 year ago

I am a member of the Mathematical Optimization Methods research group, which has many core SCIP developers. I have talked with the head of development of SCIP, Prof. Dr. Ambros Gleixner (@ambros-gleixner), and the project will eventually be part of the scipopt organization (since it has all SCIP wrappers) once the API is stable enough. For now, I added @matbesancon, who is one of the core developers and has experience in Rust. I suggest we close this pull request until all memory/API issues are resolved. After that, I will update the code for the new API and reopen the pull request.

Thank you very much for your contributions to russcip, and if you would be interested I can add you to the repo as a collaborator.

ambros-gleixner commented 1 year ago

👍

lovasoa commented 1 year ago

Great, perfect, thank you @mmghannam ! We can leave this pr open, and we'll come back to it when russcip is ready.

mmghannam commented 1 year ago

@lovasoa I updated to russcip's new memory-safe API. Please let me know if anything else is needed.