Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Tests fail to find the symbol Osi_getIntegerTolerance in lib/libCbcSolver.so

Open
#382 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start at the Osi_getIntegerTolerance lookup in mip/cbc.py around line 608, then trace the CBC solver initialization from mip/model.py and the failing path in test/mip_2d_pack.py and test/two_dim_pack_test.py. Reproduce with pytest on FreeBSD 14 and the installed libCbcSolver.so; done means the CBC tests no longer fail because the symbol cannot be found.

Written by the indexing model from the issue text.

Description

Describe the bug
/usr/local/lib/libCbcSolver.so was installed by the package coin-or-cbc-2.10.11, which is its latest release, but python-mip fails to find the Osi_getIntegerTolerance symbol in it:

________________________________________________________________ test_2dpack_mip[CBC-./test/data/two_dim_pack_60_10_20.json] ________________________________________________________________
[gw3] freebsd14 -- Python 3.9.18 /usr/local/bin/python3.9

solver = 'CBC', instance = './test/data/two_dim_pack_60_10_20.json'

    @skip_on(NotImplementedError)
    @pytest.mark.parametrize("solver, instance", product(SOLVERS, INSTS))
    def test_2dpack_mip(solver: str, instance: str):
        """tests the MIP solution of different 2D pack instances"""
        with open(instance, "r") as finst:
            data = json.load(finst)
            W = data["W"]
            w = data["w"]
            h = data["h"]
            z_relax = data["relax"]
            z_ub = data["best"]
            isopt = data["opt"]
    
>       mip = create_mip(solver, w, h, W, False)

test/two_dim_pack_test.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/mip_2d_pack.py:16: in create_mip
    m = Model(solver_name=solver)
mip/model.py:91: in __init__
    import mip.cbc
mip/cbc.py:608: in <module>
    Osi_getIntegerTolerance = cbclib.Osi_getIntegerTolerance
/usr/local/lib/python3.9/site-packages/cffi/api.py:912: in __getattr__
    make_accessor(name)
/usr/local/lib/python3.9/site-packages/cffi/api.py:908: in make_accessor
    accessors[name](name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

name = 'Osi_getIntegerTolerance'

    def accessor_function(name):
        key = 'function ' + name
        tp, _ = ffi._parser._declarations[key]
        BType = ffi._get_cached_btype(tp)
>       value = backendlib.load_function(BType, name)
E       AttributeError: function/symbol 'Osi_getIntegerTolerance' not found in library '/usr/local/lib/libCbcSolver.so': Undefined symbol "Osi_getIntegerTolerance"

/usr/local/lib/python3.9/site-packages/cffi/api.py:838: AttributeError
_______________________________________________________________ test_2dpack_mip[CBC-./test/data/two_dim_pack_80_1000_20.json] _______________________________________________________________
[gw2] freebsd14 -- Python 3.9.18 /usr/local/bin/python3.9

solver = 'CBC', instance = './test/data/two_dim_pack_80_1000_20.json'

    @skip_on(NotImplementedError)
    @pytest.mark.parametrize("solver, instance", product(SOLVERS, INSTS))
    def test_2dpack_mip(solver: str, instance: str):
        """tests the MIP solution of different 2D pack instances"""
        with open(instance, "r") as finst:
            data = json.load(finst)
            W = data["W"]
            w = data["w"]
            h = data["h"]
            z_relax = data["relax"]
            z_ub = data["best"]
            isopt = data["opt"]
    
>       mip = create_mip(solver, w, h, W, False)

test/two_dim_pack_test.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/mip_2d_pack.py:16: in create_mip
    m = Model(solver_name=solver)
mip/model.py:91: in __init__
    import mip.cbc
mip/cbc.py:608: in <module>
    Osi_getIntegerTolerance = cbclib.Osi_getIntegerTolerance
/usr/local/lib/python3.9/site-packages/cffi/api.py:912: in __getattr__
    make_accessor(name)
/usr/local/lib/python3.9/site-packages/cffi/api.py:908: in make_accessor
    accessors[name](name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

name = 'Osi_getIntegerTolerance'

    def accessor_function(name):
        key = 'function ' + name
        tp, _ = ffi._parser._declarations[key]
        BType = ffi._get_cached_btype(tp)
>       value = backendlib.load_function(BType, name)
E       AttributeError: function/symbol 'Osi_getIntegerTolerance' not found in library '/usr/local/lib/libCbcSolver.so': Undefined symbol "Osi_getIntegerTolerance"

To Reproduce
Run pytest .

Desktop (please complete the following information):

  • Operating System, version: FreeBSD 14.0
  • Python version: 3.9
  • Python-MIP version (we recommend you to test with the latest version): 1.16-pre

Additional context
Add any other context about the problem here.

Dominant language
Linear Programming
Stars
602
Forks
108
Avg merge
1d 22m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coin-or/python-mip

All issues in coin-or/python-mip

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.