Skip to content

Support SCIP installations under lib64#47

Merged
mmghannam merged 3 commits into
scipopt:mainfrom
msakai:lib64-support
Jul 2, 2026
Merged

Support SCIP installations under lib64#47
mmghannam merged 3 commits into
scipopt:mainfrom
msakai:lib64-support

Conversation

@msakai

@msakai msakai commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Problem

On 64-bit RHEL/Fedora/SUSE-like distributions, CMake's GNUInstallDirs installs libraries into <prefix>/lib64 rather than <prefix>/lib. The build script only ever looked in <prefix>/lib, so SCIP could not be found there. Both affected paths fail:

  • --features from-source: SCIP is compiled and installed into OUT_DIR/lib64, then the build panics with <OUT_DIR>/lib does not exist, please check your SCIP installation.
  • SCIPOPTDIR / system install: a SCIP installed under $SCIPOPTDIR/lib64 is not detected, and the build panics with Could not find SCIP installation.

This is what users hit when building on e.g. RHEL / Rocky / AlmaLinux. On Debian/Ubuntu (which keep lib), the build works, which is why this had gone unnoticed.

Changes

  • Probe both lib and lib64 (find_scip_lib_dir), and route emit_link_search() and lib_scip_in_dir() through it. The probe order follows the target pointer width — lib64 first for 64-bit targets — so a 64-bit build doesn't accidentally pick up a 32-bit libscip that may live in a multilib <prefix>/lib. (32-bit targets probe only lib.)
  • Pin CMAKE_INSTALL_LIBDIR=lib for the from-source build so SCIP is installed into OUT_DIR/lib deterministically, regardless of the host distro's GNUInstallDirs default.

The bundled path is unaffected (its prebuilt layout already uses lib, which the probe still finds).

Testing

Two CI jobs are added to cover this going forward:

  • linux-lib64-scipoptdir-test (ubuntu): re-lays the prebuilt bundled libraries into a lib64 prefix (plus a bogus lib/libscip*) and builds against it via SCIPOPTDIR, exercising lib64 detection and the lib64-first order.
  • linux-lib64-from-source-test: builds --features from-source inside a Rocky Linux 10 container.

I added the CI just to be thorough, but I might have gone a little overboard.

msakai and others added 2 commits June 29, 2026 21:02
CMake's GNUInstallDirs installs the SCIP libraries into `lib64` (not
`lib`) on 64-bit RHEL/Fedora/SUSE-like systems, but the build script only
ever looked in `<prefix>/lib`. As a result both `--features from-source`
and SCIPOPTDIR / system installations failed to find SCIP on those
distros (panicking with `<prefix>/lib does not exist` or
`Could not find SCIP installation`).

- Add `find_scip_lib_dir()`, which probes both `lib` and `lib64` for
  `libscip*`, and route `emit_link_search()` and `lib_scip_in_dir()`
  through it. The probe order follows the target pointer width (`lib64`
  first for 64-bit targets) so a 64-bit build does not accidentally pick
  up a 32-bit libscip that may live in a multilib `<prefix>/lib`.
- Pin `CMAKE_INSTALL_LIBDIR=lib` for the from-source build so SCIP is
  always installed into `<prefix>/lib`, regardless of the host distro's
  GNUInstallDirs default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add two jobs covering the `lib64` install layout that CMake's
GNUInstallDirs uses on 64-bit RHEL/Fedora/SUSE-like systems:

- linux-lib64-scipoptdir-test: re-lays the prebuilt bundled libraries
  into a `lib64` prefix (plus a bogus `lib/libscip*`) and builds against
  it through SCIPOPTDIR, exercising lib64 detection and the lib64-first
  probe order.
- linux-lib64-from-source-test: builds `--features from-source` inside a
  Rocky Linux 10 container, exercising the from-source path on a lib64
  distro.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@msakai
msakai marked this pull request as ready for review June 29, 2026 16:10
@msakai

msakai commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

The failure in bundled-test (macos-15) is unrelated to this PR and is caused by the macos-15-arm64 (20260623) Image Update.
Since the Homebrew gcc formula has been updated to GCC 16, the gcc@15 formula is being installed instead; however, the gcc@15 formula does not provide files such as /opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib.

Comment thread build.rs
@mmghannam

Copy link
Copy Markdown
Member

Thank you @msakai!

@mmghannam
mmghannam merged commit f7b1e27 into scipopt:main Jul 2, 2026
23 checks passed
@msakai
msakai deleted the lib64-support branch July 2, 2026 15:31
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.

2 participants