<div dir="ltr"><div><div><div>Miles,<br><br></div>Thanks. Using the &#39;--enable-dependency-linking&#39; 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(&#39;libCoinMP.dylib&#39;, ctypes.RTLD_GLOBAL)<br>lib.CoinInitSolver(&#39;&#39;)<br>lib.CoinGetVersionStr.restype = ctypes.c_char_p<br>print(lib.CoinGetVersionStr())<br>lib.CoinCreateProblem.restype = ctypes.c_int<br>hprob = lib.CoinCreateProblem(&#39;test&#39;)<br>cstr = ctypes.c_char_p(bytes(&#39;pack1.mps&#39;, &#39;utf-8&#39;))<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">&lt;<a href="mailto:miles.lubin@gmail.com" target="_blank">miles.lubin@gmail.com</a>&gt;</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 &#39;--enable-dependency-linking&#39; argument to configure.</div><div><br></div><div>Miles</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Oct 10, 2014 at 5:57 PM, Joshua Arnott <span dir="ltr">&lt;<a href="mailto:josh@snorfalorpagus.net" target="_blank">josh@snorfalorpagus.net</a>&gt;</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 class="h5"><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 &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</div><div style="margin:0px;font-size:11px;font-family:Menlo">&gt;&gt;&gt; import ctypes</div><div style="margin:0px;font-size:11px;font-family:Menlo">&gt;&gt;&gt; lib = ctypes.CDLL(&#39;libCoinMP.dylib&#39;)</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 &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</div><div style="margin:0px;font-size:11px;font-family:Menlo">  File &quot;/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/__init__.py&quot;, 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 &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</div><div style="margin:0px;font-size:11px;font-family:Menlo">&gt;&gt;&gt; import ctypes</div><div style="margin:0px;font-size:11px;font-family:Menlo">&gt;&gt;&gt; ctypes.CDLL(&#39;libClp.dylib&#39;)</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 &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</div><div style="margin:0px;font-size:11px;font-family:Menlo">  File &quot;/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/__init__.py&quot;, 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>