<div dir="ltr"><div>Hi Josh,</div><div>why do you want to use CoinMP with pulp anyway?</div><div><br></div><div>The recommended/ default solver is command line cbc.</div><div><br></div><div>CoinMP uses and old version of cbc and has several unresolved bugs.</div><div><br></div><div>Stu</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 11:13 AM, Joshua Arnott <span dir="ltr"><<a href="mailto:josh@snorfalorpagus.net" target="_blank">josh@snorfalorpagus.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Miles,<br><br></div>Thanks. Using the '--enable-dependency-linking' argument seems to work.<br><br></div>However,
I am now having trouble with a segfault with the following code which
exists with the call to CoinReadFile. I have the same segfault trying to
use PuLP. The same code runs fine on Linux.<br><br>#!/usr/bin/env python3<br><br>import ctypes<br>lib = ctypes.CDLL('libCoinMP.dylib', ctypes.RTLD_GLOBAL)<br>lib.CoinInitSolver('')<br>lib.CoinGetVersionStr.restype = ctypes.c_char_p<br>print(lib.CoinGetVersionStr())<br>lib.CoinCreateProblem.restype = ctypes.c_int<br>hprob = lib.CoinCreateProblem('test')<br>cstr = ctypes.c_char_p(bytes('pack1.mps', 'utf-8'))<br>print(lib.CoinReadFile(hprob, 3, cstr))<br>lib.CoinFreeSolver()<br><br></div>Josh</div><div class="gmail_extra"><br><div class="gmail_quote">On 11 October 2014 19:02, Miles Lubin <span dir="ltr"><<a href="mailto:miles.lubin@gmail.com" target="_blank">miles.lubin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Joshua,<div><br></div><div>Try adding the '--enable-dependency-linking' argument to configure.</div><div><br></div><div>Miles</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Oct 10, 2014 at 5:57 PM, Joshua Arnott <span dir="ltr"><<a href="mailto:josh@snorfalorpagus.net" target="_blank">josh@snorfalorpagus.net</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div style="word-wrap:break-word"><div>Hello,</div><div><br></div><div>I’m trying to use the CoinMP library from Python 3 via ctypes. When I try to load the shared library I get the following error:</div><div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo">Python 3.4.1 (default, May 19 2014, 13:10:29) </div><div style="margin:0px;font-size:11px;font-family:Menlo">[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin</div><div style="margin:0px;font-size:11px;font-family:Menlo">Type "help", "copyright", "credits" or "license" for more information.</div><div style="margin:0px;font-size:11px;font-family:Menlo">>>> import ctypes</div><div style="margin:0px;font-size:11px;font-family:Menlo">>>> lib = ctypes.CDLL('libCoinMP.dylib')</div><div style="margin:0px;font-size:11px;font-family:Menlo">Traceback (most recent call last):</div><div style="margin:0px;font-size:11px;font-family:Menlo"> File "<stdin>", line 1, in <module></div><div style="margin:0px;font-size:11px;font-family:Menlo"> File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/__init__.py", line 351, in __init__</div><div style="margin:0px;font-size:11px;font-family:Menlo"> self._handle = _dlopen(self._name, mode)</div><div style="margin:0px;font-size:11px;font-family:Menlo">OSError: dlopen(libCoinMP.dylib, 6): Symbol not found: _CbcOrClpRead_mode</div><div style="margin:0px;font-size:11px;font-family:Menlo"> Referenced from: /usr/local/lib/libCoinMP.dylib</div><div style="margin:0px;font-size:11px;font-family:Menlo"> Expected in: flat namespace</div><div style="margin:0px;font-size:11px;font-family:Menlo"> in /usr/local/lib/libCoinMP.dylib</div></div><div style="margin:0px;font-size:11px;font-family:Menlo"><br></div><div style="margin:0px">However, when I “make test” everything runs correctly.</div><div style="margin:0px"><br></div><div style="margin:0px">Output from “nm” reports the symbol is undefined:</div><div style="margin:0px"><br></div><div style="margin:0px"><div style="margin:0px;font-size:11px;font-family:Menlo">U _CbcOrClpRead_mode</div><div style="margin:0px;font-size:11px;font-family:Menlo"><br></div><div style="margin:0px">I am getting similar errors for the other libraries, e.g.:</div><div style="margin:0px"><br></div><div style="margin:0px"><div style="margin:0px;font-size:11px;font-family:Menlo">Python 3.4.1 (default, May 19 2014, 13:10:29) </div><div style="margin:0px;font-size:11px;font-family:Menlo">[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin</div><div style="margin:0px;font-size:11px;font-family:Menlo">Type "help", "copyright", "credits" or "license" for more information.</div><div style="margin:0px;font-size:11px;font-family:Menlo">>>> import ctypes</div><div style="margin:0px;font-size:11px;font-family:Menlo">>>> ctypes.CDLL('libClp.dylib')</div><div style="margin:0px;font-size:11px;font-family:Menlo">Traceback (most recent call last):</div><div style="margin:0px;font-size:11px;font-family:Menlo"> File "<stdin>", line 1, in <module></div><div style="margin:0px;font-size:11px;font-family:Menlo"> File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/__init__.py", line 351, in __init__</div><div style="margin:0px;font-size:11px;font-family:Menlo"> self._handle = _dlopen(self._name, mode)</div><div style="margin:0px;font-size:11px;font-family:Menlo">OSError: dlopen(libClp.dylib, 6): Symbol not found: __ZN18CoinMessageHandler13checkSeverityEv</div><div style="margin:0px;font-size:11px;font-family:Menlo"> Referenced from: /usr/local/lib/libClp.dylib</div><div style="margin:0px;font-size:11px;font-family:Menlo"> Expected in: flat namespace</div><div style="margin:0px;font-size:11px;font-family:Menlo"> in /usr/local/lib/libClp.dylib</div><div style="margin:0px;font-size:11px;font-family:Menlo"><br></div><div style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px">Running Mac OS X 10.9.5, with current CoinMP from SVN.</span></div><div style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px"><br></span></div><div style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px">Kind regards,</span></div><div style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px"><br></span></div><div style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px">Josh</span></div></div></div></div><br></div></div>_______________________________________________<br>
Coin-discuss mailing list<br>
<a href="mailto:Coin-discuss@list.coin-or.org" target="_blank">Coin-discuss@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/coin-discuss" target="_blank">http://list.coin-or.org/mailman/listinfo/coin-discuss</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
<br>_______________________________________________<br>
Coin-discuss mailing list<br>
<a href="mailto:Coin-discuss@list.coin-or.org">Coin-discuss@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/coin-discuss" target="_blank">http://list.coin-or.org/mailman/listinfo/coin-discuss</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Stuart Mitchell</div><div>PhD Engineering Science</div><div><span>Extraordinary </span><span>Freelance Programmer and Optimisation Guru</span></div><div><a href="http://www.stuartmitchell.com" target="_blank">www.stuartmitchell.com</a></div>
</div>