Skip to content

libscip linkage with OR Tools 9.13 on Mac #4674

Closed

Description

@ankane

Hi, with OR Tools 9.13 on Mac, libortools.dylib links to libscip.9.2.dylib without including rpath (while all of the other linked libraries include it). This leads to linkage errors with downstream projects.

What version of OR-Tools and what language are you using?

Version: 9.13
Language: C++

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi) n/a

What operating system (Linux, Windows, ...) and version? macOS 15.5

What did you do?

Run otool -L lib/libortools.dylib.

What did you expect to see

lib/libortools.dylib:
         ...
	@rpath/libClpSolver.1.dylib (compatibility version 1.0.0, current version 1.17.10)
	@rpath/libscip.9.2.dylib (compatibility version 9.2.0, current version 9.2.2)
	@rpath/libabsl_flags_usage_internal.2505.0.0.dylib (compatibility version 2505.0.0, current version 0.0.0)
        ...

What did you see instead?

lib/libortools.dylib:
         ...
	@rpath/libClpSolver.1.dylib (compatibility version 1.0.0, current version 1.17.10)
	libscip.9.2.dylib (compatibility version 9.2.0, current version 9.2.2)
	@rpath/libabsl_flags_usage_internal.2505.0.0.dylib (compatibility version 2505.0.0, current version 0.0.0)
        ...

Anything else we should know about your project / environment n/a

Activity

  1. self-assigned this
    on Jun 7, 2025
  2. added this to the v10.0 milestone on Jun 7, 2025
  3. Mizux commented on Jun 7, 2025

    @Mizux
    Collaborator

    Did you use a M1 (aarch64) or intel (x86_64) based macOS ?
    EDIT: all macos are impacted linux and windows seems to work as expected

    Sinon .Net and Java meta package depend on all package we need to redoo a full release for theses platforms.
    on Pypi.org each wheel is uploaded side by side so we only have to upload a new release for macos only...

    ToDo:

    • Remove pypi macos wheel packages
    • Add a check in tools/release/ scripts to detect it
    • Find a CMake fix (patching SCIP ?)
    • Regenerate all artifacts and upload them
      • Generate Python artifacts
      • Generate archives artifacts
      • Generate .Net RID
      • Generate Java runtime artifacts

    DevNote:

    This command should catch them

    otool -L <buildir>/lib/libortools.dylib | grep -vqz "/Users"
  4. ankane commented on Jun 7, 2025

    @ankane
    Author

    Both aarch64 and x86-64 have the issue.

  5. jesenko commented on Jun 10, 2025

    @jesenko

    Probably related - using DotNet wrapper also results in error on macos due to libscip library:

    System.TypeInitializationException: The type initializer for 'Google.OrTools.Sat.operations_research_satPINVOKE' threw an exception.
     ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
     ---> System.DllNotFoundException: Unable to load shared library 'google-ortools-native' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environ
    ment variable:
    dlopen(/#####/Debug/net9.0/runtimes/osx-arm64/native/google-ortools-native.dylib, 0x0001): Library not loaded: /Users/corentinl/work/stable/temp_dotnet/lib/libscip.9.2.dylib
    ...
    
  6. Mizux commented on Jun 11, 2025

    @Mizux
    Collaborator

    TLDR: read 5587f01 which fix all...

    AFAIK HiGHS, Soplex and SCIP wrongly use MACOSX_RPATH (copycat ^^; ?)
    https://github.com/ERGO-Code/HiGHS/blob/master/highs/CMakeLists.txt#L46
    https://github.com/scipopt/soplex/blob/master/src/CMakeLists.txt#L7
    https://github.com/scipopt/scip/blob/v922/src/CMakeLists.txt#L9

    They are storing a "path" (i.e. a string) into a variable which should be use to store TRUE or FALSE and CMake if(string) is always FALSE unless store a "TRUE" constant which is not the case here leading to NOT using @rpath directory prefix...

    ref: https://cmake.org/cmake/help/latest/command/if.html#string

    note: Also since each projects already use set(CMAKE_MACOSX_RPATH TRUE) in root CMakeLists.txt they should just stop playing with MACOSX_RPATH target property imho...

    Next step: contact SCIP and HiGHS team to confirm and fix upstream...

  7. modified the milestones: v10.0, v9.14 on Jun 16, 2025
  8. moved this from To do to Done in OR-Tools ToDoon Jun 16, 2025
  9. Mizux commented on Jun 19, 2025

    @Mizux
    Collaborator

    Fixed on v9.14

  10. ankane commented on Jun 19, 2025

    @ankane
    Author

    9.14 works great. Big thanks @Mizux!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions