The tutorial has been moved in: https://github.com/ami-iit/ami-commons/blob/master/doc/casadi-ipopt-hsl.md
Click me if you are interested in the original tutorial
This guide should help you to install CasADi with IPOPT and HSL support.
- Install some dependencies
sudo apt-get install build-essential gfortran liblapack-dev libmetis-dev libopenblas-dev
mkdir -p ~/robot-code/CoinIpopt && cd ~/robot-code/CoinIpopt
- Get
coinbrew
wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew
chmod u+x coinbrew
- Run
./coinbrew Ipopt
and follow the instruction to fetch IPOPT and all the dependencies (Today the latest version of IPOPT is3.13.4
) mkdir install
- Build ipot
./coinbrew build Ipopt --prefix=install --test --no-prompt --verbosity=3
(have a ☕) - Obtain an archive with HSL source code from http://www.hsl.rl.ac.uk/ipopt/. (I'm currently using
coinhsl-2019.05.21
) - Unzip the folder
coinhsl-2019.05.21.zip
into~/robot-code/CoinIpopt/ThirdParty/HSL/
and rename itcoinhsl
. cd ~/robot-code/CoinIpopt
- Build ipopt
./coinbrew build Ipopt --prefix=install --test --no-prompt --verbosity=3
(have a ☕) - Run
./coinbrew install Ipopt --no-prompt
- cd
~/robot-code/CoinIpopt/install/lib
ln -s libcoinhsl.so libhsl.so
- Add to the
.bashrc
the following linesexport IPOPT_DIR=~/robot-code/CoinIpopt/install export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${IPOPT_DIR}/lib/pkgconfig export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${IPOPT_DIR}/lib # ipopt this is required for casadi export PATH=${PATH}:${IPOPT_DIR}/lib # this may speed up ipopt export OMP_NUM_THREADS=1
- Clone CasADi
cd ~/robot-code && git clone https://github.com/casadi/casadi.git
mkdir -p casadi/build && cd casadi/build
- Run
cmake -DWITH_IPOPT:BOOL=ON -DWITH_HSL:BOOL=ON -DINCLUDE_PREFIX:PATH=include -DCMAKE_PREFIX:PATH=lib/cmake/casadi -DLIB_PREFIX:PATH=lib -DBIN_PREFIX:PATH=bin ..
make
andmake install
- Enjoy CasADi with IPOPT and HSL solvers 🚀
Thanks for this article!I really want to know how to install this combination under the windows?