rust-or / highs-sys

Rust binding for the HiGHS linear programming solver
https://docs.rs/highs-sys
10 stars 16 forks source link

Enable system-installed HiGHS to be linked #20

Closed Cu3PO42 closed 1 year ago

Cu3PO42 commented 1 year ago

Hi,

I previously raised an issue (#19) about the possibility of linking a version of HiGHS that's already installed on the system rather than always building it. You said you'd welcome a PR, so here it is!

This PR does not change the default behavior of the crate at all, but introduces a new feature that, when enabled, will use pkg-config to find HiGHS and link against it. If that fails, HiGHS will still be built (unless default features are turned off).

In attempting to document this sensibly, I have somewhat restructured parts of the README. I'm not attached to those changes, so I'm happy to revert them if you'd like to do things differently.

Cu3PO42 commented 1 year ago

I'll try and adapt the CI to test the feature on macOS and Linux. I'm not really familiar with how pkg-config works on Windows.

lovasoa commented 1 year ago

Yes, I'd be okay with not testing that on windows, I know how much of a pain windows integration tests can be :smiling_face_with_tear:

Cu3PO42 commented 1 year ago

I have tested the pipeline in a PR on my fork and it looks good to me: https://github.com/Cu3PO42/highs-sys/actions/runs/6183595581/job/16785617873?pr=1.

lovasoa commented 1 year ago

great, thanks !