Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yurivict opened this issue May 7, 2024 · 0 comments

Comments

@yurivict
Copy link

yurivict commented May 7, 2024

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.

@yurivict yurivict changed the title Tests fail to find lib/libCbcSolver.so Tests fail to find the symbol Osi_getIntegerTolerance in lib/libCbcSolver.so May 7, 2024
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

No branches or pull requests

1 participant