Tests fail to find the symbol Osi_getIntegerTolerance in lib/libCbcSolver.so
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coin-or/python-mip
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
coin-or/python-mip#426 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
coin-or/python-mip#425 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
coin-or/python-mip#423 · 4 comments · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
coin-or/python-mip#422 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
coin-or/python-mip#420 · 4 comments ·
All issues in coin-or/python-mip
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ROCm/rocm-systems#12638 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Poll constructor throws for an uncached channel while resolving a message context-menu interactionOpenbug need repro packages:discord.js
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
discordjs/discord.js#11645 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DOI-USGS/dataretrieval-python#430 ·
Maintainers usually reply within 1 day
-
Validator client startup retry loop ignores context cancellation until the reconnect backoff expiresOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OffchainLabs/prysm#17596 ·
Maintainers usually reply within 2 days