Skip to content Skip to sidebar Skip to footer

Using IPOPT With Openmdao (or Pyoptsparse) In Python

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 t

Solution 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.


Solution 2:

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


Post a Comment for "Using IPOPT With Openmdao (or Pyoptsparse) In Python"