Skip to content

Implement support for HiPO solver. - #55

Open
MathieuDutSik wants to merge 4 commits into
rust-or:masterfrom
MathieuDutSik:hipo_support
Open

MathieuDutSik wants to merge 4 commits into
rust-or:masterfrom
MathieuDutSik:hipo_support

Conversation

@MathieuDutSik

Copy link
Copy Markdown

It would be nice to expose the HiPO solver of HiGHS to the Rust endpoint.

The problem is that HiPO depends on BLAS. And the access to it requires some care.

  1. First of all, to provide some safety, the HiPO is feature gated so that existing implementation can work without changes.
  2. highs-sys can pass the CMAKE compilation option to the highs. If absent, then either we use Apple BLAS if present, otherwise we download the OpenBLAS implementation in order to provide it.

We cannot provide OpenBLAS all the way because Intel has its own specific implementation, AMD has its own, and so on. You want to be able to use the best BLAS library when compiling. On the other hand, you want to make the installation easy. So, OpenBLAS is provided as an option.

@jajhall

jajhall commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Good to hear. If necessary, @galabovaa and @filikat can offer advice, and will also be interested to know.

@lovasoa

lovasoa commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

That sounds very interesting. I don't think I'm the most qualified to review this; @jajhall, if the HiGHS team thinks this was done properly, feel free to merge !

@jajhall

jajhall commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

I don't know how you pick up HiGHS, but there are (for example) two sets of binaries: one (MIT) without HiPO, and one (Apache 2) with HiPO. Maybe this licensing issue is important to you.

@filikat

filikat commented Jul 9, 2026

Copy link
Copy Markdown

That is very nice indeed! I cannot offer advice on Rust-specific issues, but happy to help for any other HiPO-related issue.

@MathieuDutSik

Copy link
Copy Markdown
Author

That is very nice indeed! I cannot offer advice on Rust-specific issues, but happy to help for any other HiPO-related issue.

Thanks.
The thing that is a little worrying is the CI entries that are cancelled. I think you can raise those limits to higher values safely since it is an open-source project.

@GermanHeim

Copy link
Copy Markdown
Collaborator

This is a great addition. Just wanted to add that this is currently failing on W10 without a BLAS installation. These are the logs I am getting:
hipo.log

It correctly detects that OpenBLAS isn't present and builds OpenBLAS. However, it fails on Target "highs_extras".

@lovasoa

lovasoa commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

I checked out the PR code, and ran cargo test --all-features

It fails with

  -- HIGHS_VCPKG: OFF
  -- Configuring incomplete, errors occurred!
  cargo:warning=highs-sys: HiGHS' cmake found no system BLAS; building the bundled OpenBLAS instead. Set HIGHS_BLA_VENDOR/HIGHS_BLAS_ROOT to use a system BLAS, or HIGHS_BUILD_OPENBLAS=1 to skip this probe.
  -- HIGHS_VCPKG: OFF
  -- Configuring incomplete, errors occurred!

  --- stderr
  running: cd "/home/ophir/dev/highs-sys/target/debug/build/highs-sys-40e0c097a87da8fc/out/build" && CMAKE_PREFIX_PATH="" LC_ALL="C" "cmake" "/home/ophir/dev/highs-sys/HiGHS" "-B" "/home/ophir/dev/highs-sys/target/debug/build/highs-sys-40e0c097a87da8fc/out/build" "-G" "Ninja" "-DBUILD_CXX_EXE=OFF" "-DBUILD_EXAMPLES=OFF" "-DHIPO=ON" "-DBUILD_SHARED_EXTRAS_LIB=OFF" "-DFAST_BUILD=ON" "-DBUILD_SHARED_LIBS=OFF" "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL" "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=FALSE" "-DZLIB=ON" "-DBUILD_OPENBLAS=OFF" "-DCMAKE_INSTALL_PREFIX=/home/ophir/dev/highs-sys/target/debug/build/highs-sys-40e0c097a87da8fc/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -w" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -w" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -w" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  running: cd "/home/ophir/dev/highs-sys/target/debug/build/highs-sys-40e0c097a87da8fc/out/build" && CMAKE_PREFIX_PATH="" LC_ALL="C" "cmake" "/home/ophir/dev/highs-sys/HiGHS" "-B" "/home/ophir/dev/highs-sys/target/debug/build/highs-sys-40e0c097a87da8fc/out/build" "-G" "Ninja" "-DBUILD_CXX_EXE=OFF" "-DBUILD_EXAMPLES=OFF" "-DHIPO=ON" "-DBUILD_SHARED_EXTRAS_LIB=OFF" "-DFAST_BUILD=ON" "-DBUILD_SHARED_LIBS=OFF" "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL" "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=FALSE" "-DZLIB=ON" "-DBUILD_OPENBLAS=OFF" "-DBUILD_OPENBLAS=ON" "-DCMAKE_INSTALL_PREFIX=/home/ophir/dev/highs-sys/target/debug/build/highs-sys-40e0c097a87da8fc/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -w" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -w" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -w" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.

  thread 'main' (71209) panicked at /home/ophir/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cmake-0.1.58/src/lib.rs:1132:5:

@lovasoa

lovasoa commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Is there a way to remove the dependency to ninja ? Or at the very worse, clearly document it and fail with a more helpful error message when it's not installed.

@GermanHeim

Copy link
Copy Markdown
Collaborator

It is also failing in my Fedora 44 Niri Install. Posting logs in case it helps.
f.log

Compiles fine without the hipo flag.

@lovasoa lovasoa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just marking the state until it compiles cleanly

Comment thread build.rs
let try_discover = !cfg!(feature = "hipo");
if cfg!(all(feature = "discover", feature = "hipo")) {
println!(
"cargo:warning=highs-sys: the 'hipo' feature requires building HiGHS with HiPO, so the 'discover' feature is ignored (a discovered system HiGHS may lack HiPO)."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the user explicitly set "discover", we are not building it behind their back !

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.

5 participants