Skip to content

Latest commit

 

History

History
102 lines (75 loc) · 3.94 KB

IPOPT.rst

File metadata and controls

102 lines (75 loc) · 3.94 KB

IPOPT

IPOPT (Interior Point OPTimizer) is an open source interior point optimizer, designed for large-scale nonlinear optimization. The source code can be found here. The latest version we support is 3.13.2.

Installation

IPOPT must be installed separately, then linked to pyOptSparse when building. For the full installation instructions, please see their documentation. OpenMDAO also has a very helpful script which can be used to install IPOPT with other linear solvers. Here we explain a basic setup using MUMPS as the linear solver, together with METIS adapted from the OpenMDAO script.

  1. Download the tarball and extract it to $IPOPT_DIR which could be set to for example $HOME/packages/Ipopt.

  2. Install METIS, which can be used to improve the performance of the MUMPS linear solver.

    # build METIS
    cd $IPOPT_DIR
    git clone https://github.com/coin-or-tools/ThirdParty-Metis.git
    cd ThirdParty-Metis
    ./get.Metis
    ./configure --prefix=$IPOPT_DIR
    make
    make install
  3. Install MUMPS

    # build MUMPS
    cd $IPOPT_DIR
    git clone https://github.com/coin-or-tools/ThirdParty-Mumps.git
    cd ThirdParty-Mumps
    ./get.Mumps
    ./configure --with-metis --with-metis-lflags="-L${IPOPT_DIR}/lib -lcoinmetis" \
         --with-metis-cflags="-I${IPOPT_DIR}/include -I${IPOPT_DIR}/include/coin-or -I${IPOPT_DIR}/include/coin-or/metis" \
         --prefix=$IPOPT_DIR CFLAGS="-I${IPOPT_DIR}/include -I${IPOPT_DIR}/include/coin-or -I${IPOPT_DIR}/include/coin-or/metis" \
         FCFLAGS="-I${IPOPT_DIR}/include -I${IPOPT_DIR}/include/coin-or -I${IPOPT_DIR}/include/coin-or/metis"
    make
    make install
  4. Build IPOPT

    # build IPOPT
    cd $IPOPT_DIR
    mkdir build
    cd build
    ../configure --prefix=${IPOPT_DIR} --disable-java --with-mumps --with-mumps-lflags="-L${IPOPT_DIR}/lib -lcoinmumps" \
         --with-mumps-cflags="-I${IPOPT_DIR}/include/coin-or/mumps"
    make
    make install
  5. You must add the IPOPT library path to the LD_LIBRARY_PATH variable for things to work right. This could be done for example by adding the following to your .bashrc:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPT_DIR/lib

    Furthermore, the environment variable $IPOPT_DIR must be set correctly in order to link to pyOptSparse. Alternatively, you can manually define the variables $IPOPT_LIB and $IPOPT_INC for the lib and include paths separately.

  6. Now clean build pyOptSparse. Verify that IPOPT works by running the relevant tests.

Note

To get IPOPT working with pyOptSparse when using another linear solver, several things must be changed.

  1. The setup.py file located in pyoptsparse/pyIPOPT must be updated accordingly. In particular, the libraries= line must be changed to reflect the alternate linear solver. For example, for HSL you need to replace coinmumps and coinmetis with coinhsl.
  2. The option linear_solver in the options dictionary must be changed. The default value can be changed in pyIPOPT.py so that this option does not need to be manually set in every run script.

Options

Please refer to the IPOPT website for complete listing of options. The following are the options which are set by default within pyOptSparse. All other options take the default value with IPOPT unless specified by the user.

.. optionstable:: pyoptsparse.pyIPOPT.pyIPOPT.IPOPT
   :filename: IPOPT_options.yaml


Informs

.. optionstable:: pyoptsparse.pyIPOPT.pyIPOPT.IPOPT
   :type: informs

API

.. currentmodule:: pyoptsparse.pyIPOPT.pyIPOPT

.. autoclass:: IPOPT
   :members: __call__