[Ipopt] ipopt with python
Vyacheslav Kungurtsev
vyacheslav.kungurtsev at esat.kuleuven.be
Fri Nov 21 10:52:07 EST 2014
OK. I tried this, but the error from pyipopt remains.
Thanks
~Vyacheslav
On Fri, Nov 21, 2014 at 4:44 PM, Tony Kelman <kelman at berkeley.edu> wrote:
> I don’t know the Python interfaces to Ipopt very well. One thing you
> might try is configuring Ipopt with --enable-dependency-linking, I think
> that can be necessary to dlopen Ipopt shared libraries including their
> dependencies from Python or Julia or other languages. You won’t have dll’s
> on Ubuntu, you’ll have .so shared libraries.
>
> -Tony
>
>
> *From:* Vyacheslav Kungurtsev <vyacheslav.kungurtsev at esat.kuleuven.be>
> *Sent:* Friday, November 21, 2014 7:32 AM
> *To:* Tony Kelman <kelman at berkeley.edu>
> *Cc:* ipopt at list.coin-or.org
> *Subject:* ipopt with python
>
> Hello,
>
> Somehow after the weekend I tried again and ipopt installed just fine and
> the examples ran OK. I have no idea what happened.
>
>
>
> Now I am trying to run ipopt with python, and having trouble with both
> pyipopt and cyipopt
>
> With pyipopt:
>
>
> the error appears as:
>
> ~/pyipopt/examples$ python hs071.py
> Traceback (most recent call last):
> File "hs071.py", line 6, in <module>
> import pyipopt
> File "/usr/local/lib/python2.7/
> dist-packages/pyipopt/__init__.py", line 16, in <module>
> from pyipoptcore import *
> ImportError:
> /usr/local/lib/python2.7/dist-packages/pyipopt/pyipoptcore.so: undefined
> symbol: _ZTVN10__cxxabiv117__class_type_infoE
>
>
> Indeed, it so happens that:
>
> $ nm /usr/local/lib/python2.7/dist-
> packages/pyipopt/pyipoptcore.so | grep
> _ZTVN10__cxxabiv117__class_type_infoE
> U _ZTVN10__cxxabiv117__class_type_infoE
>
>
> the symbol arises from libstdc++ and I have tried adding it to setup.py as
> such:
> extra_link_args=['-libstdc++']
> ,
>
> or
>
> extra_link_args=['-libstdc++', + IPOPT_LIB],
>
> or
>
> libraries=[
> ...
> 'coinmetis','libstdc++',
> ...
>
> and in all cases setup.py installs with no error, but the import error
> remains when I try to run the example.
>
> Do you have any suggestions? Am I linking it improperly in the setup file?
>
>
>
> With cyipopt the setup.py requires:
> these
> IPOPT_ICLUDE_DIRS=['include_mt/coin', np.get_include()]
> IPOPT_LIBS=['Ipopt39', 'IpoptFSS']
> IPOPT_LIB_DIRS=['lib_mt/x64/release']
> IPOPT_DLL=['Ipopt39.dll', 'IpoptFSS39.dll']
> to be set correctly. I am not quite sure how to find the proper
> directories. Would I even have dll files given that I am running ubuntu?
>
> Sorry if the question is rather basic.
>
>
> some info about my computer, if it helps:
> Ubuntu 14.04
> gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
> g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2
>
>
>
>
> Thank you
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20141121/5a416942/attachment-0001.html>
More information about the Ipopt
mailing list