question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to link mip to Debian's CBC package throws undefined error

See original GitHub issue

I installed coinor-cbc to my armhf system, and did this:

export PMIP_CBC_LIBRARY="/usr/lib/arm-linux-gnueabihf/libCbcSolver.so.3.9.9"
export LD_LIBRARY_PATH="/usr/lib/arm-linux-gnueabihf/"

as established here.

Then, when I try to execute it on Python’s console, I do:

>>> from mip import Model, MAXIMIZE, CBC, INTEGER, OptimizationStatus
>>> model = Model(sense=MAXIMIZE, solver_name=CBC)

And I inmediately get the error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/mip/model.py", line 93, in __init__
    import mip.cbc
  File "/usr/local/lib/python3.7/dist-packages/mip/cbc.py", line 600, in <module>
    Osi_getNumCols = cbclib.Osi_getNumCols
  File "/usr/local/lib/python3.7/dist-packages/cffi/api.py", line 912, in __getattr__
    make_accessor(name)
  File "/usr/local/lib/python3.7/dist-packages/cffi/api.py", line 908, in make_accessor
    accessors[name](name)
  File "/usr/local/lib/python3.7/dist-packages/cffi/api.py", line 838, in accessor_function
    value = backendlib.load_function(BType, name)
AttributeError: function/symbol 'Osi_getNumCols' not found in library '/usr/lib/arm-linux-gnueabihf/libCbcSolver.so.3.9.9': /usr/lib/arm-linux-gnueabihf/libCbcSolver.so.3.9.9: undefined symbol: Osi_getNumCols

I am using

  • Python 3.7.3
  • mip 1.12.0
  • coinor-cbc 2.9.9+repack1-1
  • Debian GNU/Linux 10 (buster)
  • Kernel: Linux 4.14.78-g8e54a4b
  • Architecture: armv7l

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tkralphscommented, Mar 8, 2022

Sorry, I misspoke. I didn’t mean to say dynamic linking, I meant symbolic linking. You created a symbolic link from libCbc to libCbcSolver when I think you could just directly point python-mip to libCbc by setting PMIP_CBC_LIBRARY.

1reaction
tkralphscommented, Mar 4, 2022

I tried this today and it worked, however it seems that the library has been renamed in the Cbc master and Python-MIP has not been updated (yet).

Yes, there used to be a libCbc and a libCbcSolver, but this separation did not serve much purpose, so the libraries were merged as part of the on-going refactoring being undertaken in the master branch. I’m not sure why you need to do the dynamic linking , though. You should be able to just set PMIP_CBC_LIBRARY to point directly to libCbc, unless I’m missing something.

We are still trying to get to a formal release of the code in Cbc master branch, but it still needs some work and developer bandwidth is severely limited. The work to be done doesn’t need that much knowledge of Cbc internals, volunteers are welcome. See coin-or/Cbc/discussions/465.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debian -- Details of package coinor-cbc in buster
is an open-source mixed integer programming solver written in C++. It can be used as a callable library or as a stand-alone executable....
Read more >
Change log : linux-aws package : Ubuntu - Launchpad
iio: adc: xilinx: Fix error handling - Btrfs: send, fix failure to rename top level inode due to name collision - f2fs: do...
Read more >
IpJ - River Thames Conditions - Environment Agency - GOV.UK
Salt califone, The leader i want question and answer, Cihan kulahcioglu, Angel dear curved pillow, Uzava ship, Itp bizkaia 2013, Skora base sale, ......
Read more >
Debian packages on transit
... for files within Debian packages (command-line interface) un apt-listbugs ... Libraries used by BIND 9 ii binfmt-support 2.2.1-1+deb11u1 amd64 Support ...
Read more >
frequent-classes - CodaLab Worksheets
... angle 7948 track 7925 region 7871 desc 7847 error 7805 holder 7760 index ... 37 3723 37 lmenu 37 linking 37 bfa...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found