coin-or / coin-or/python-mip

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

Open
#382 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Linear Programming
Stars
600
Forks
108
PR merge metrics
No merged PRs in 30d

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
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
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.