Skip to content
Christoph Rösmann edited this page Mar 17, 2020 · 3 revisions

IPOPT

Official IPOPT page: https://github.com/coin-or/Ipopt

Ubuntu

Install via APT Repository

If you are running Ubuntu, you can install IPOPT using the official package repositories. But note, here you get the default IPOPT configuration with MUMPS linear solver. If you want to compile IPOPT with HSL linear solvers, please follow the steps below to compile IPOPT from source.

sudo apt install coinor-libipopt-dev

Build from source

First install the following packages:

sudo apt-get install gcc g++ gfortran cmake liblapack-dev pkg-config unzip git

Now download and compile Ipopt from source

cd somefolder
git clone --single-branch --branch stable/3.13 https://github.com/coin-or/Ipopt.git 

Download ThirdParty software (invoke line by line)

cd Ipopt/ThirdParty
cd Blas && ./get.Blas && cd ..
cd Lapack && ./get.Lapack && cd ..
cd Metis && ./get.Metis && cd ..
cd Mumps && ./get.Mumps && cd ..

You can add more powerful linear solvers that are utilized by Ipopt, e.g. from the HSL Mathematical Software Library. They provide free academic license. Add the files to the Ipopt/ThirdParty/HSL folder.

unzip path-to-coinhslzip/coinhsl.zip -d HSL/

Now build IPOPT:

cd /somefolder/Ipopt
mkdir build
cd build 
../configure --prefix=/usr/local ADD_FFLAGS=-fPIC ADD_CFLAGS=-fPIC ADD_CXXFLAGS=-fPIC
make
sudo make install

If you invoke cmake on the control_box_rst package, you should see "IPOPT found". Afterward, you can use the SolverIpopt solver class in your program. In case you compiled Ipopt with HSL, you can now select for example the linear solver ma57. If you use IPOPT and HSL for your published work, make sure to cite the according to their websites!

MacOS

Follow the instructions of compiling Ipopt from source in Ubunutu. You might install the gfortran compiler using homebrew.

If you configure your project using CMake it should notify you whether Ipopt is found or not.

Clone this wiki locally