2

Hello everyone. I have a little problem : I am working with openmdao and pyOptSparseDriver. It is working for some solvers (SLSQP, PSQP for instance) so there is no problem about that installation.

Now i'd like to try the same with IPOPT, but the code is not given with pyoptsparse. I followed the COIN-OR documentation to install IPOPT (http://www.coin-or.org/Ipopt/documentation/node10.html), and everything SEEMS ok (i don't know how to check it). Now i have a COIN-OR folder on my desk and i don't know how to make pyoptsparse take IPOPT from it (it is the line "from . import pyoptcore" that crashes), from pyIPOPT/pyIPOPT.py. Can anyone help me ? Thank you by advance

2 Answers 2

1

we're using IPOPT with OpenMDAO through the pytoptsparse package, and installed it as a standalone library, like you've done. To get that to work you need to set the IPOPT_DIR environment variable pointing to the location you installed IPOPT before running the install of pyoptsparse.

So assuming you installed IPOPT in e.g. /usr/local/IPOPT:

$ export IPOPT_DIR=/usr/local/IPOPT
$ cd /path/to/pyoptsparse/
$ python setup.py install

this should result in pyoptsparse compiling the python wrapper for IPOPT and produce the file pyoptcore.so that will be placed in Python's site-packages/pyoptsparse/pyIPOPT.

On our cluster we had to modify the pyoptsparse/pyIPOPT/setup.py file slightly since we compiled everything with Intel, but if you compile with gfortran the official version of pyoptsparse should work for you.

Alternatively, you can do like Justin suggests, which is essentially the instructions you find in the pyoptsparse docs.

Sign up to request clarification or add additional context in comments.

6 Comments

The command python setup.py install seems to have no effect. When in the shell, the command os.getenv('IPOPT_DIR') gives the good path (export worked). Looking at pyIPOPT/setup.py, i wonder if the function configuration (returning the config) is called ...
you may need to remove the build directory first to do a clean install of pyoptsparse. for debugging you can also try to comment out all other optimisers in pyoptsparse/setup.py (bitbucket.org/mdolab/pyoptsparse/src/…). you can try to add some print statements in pyoptsparse/pyIPOPT/setup.py file to see if its called and detects your IPOPT installation correctly.
Okay, so i started all over from downloading a new mdolab-pyoptsparse*.zip I go this error after a gcc call: /usr/bin/ld: cannot find -lcoinhsl Isn't HSL optional ? I dowloaded MUMPS and the doc seems to explain that it is enough for solving the linear systems...
the pyoptsparse pyIPOPT setup.py file requires that lib to be there (bitbucket.org/mdolab/pyoptsparse/src/…). Did you otherwise follow the IPOPT installation instructions in the pyoptsparse docs? They remommend configuring with $ ./configure --disable-linear-solver-loader. you can build that from the docs directory with make html.
I was not following the doc but as i was looking over the files setup.py i was doing about the same. I started all over for pyoptsparse and IPOPT. What is the command --disable-linear-solver-loader supposed to do ? I expected "Copy ma27ad.f from the pyOptSparse bitbucket page into the Ipopt/ThirdParty/HSLold/ directory" to replace HSL. I guess i'll have to examine all these license-getting things to get HSL ?
|
0

you have to put the ipopt source code into the src folder of pyopt-sparse and then recompile the package.

1 Comment

What do you mean by source code ? There are 6 different folders in Ipopt/src. Putting them in pyIPOPT/src did not work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.