Installing IPOPT

From Wiki for iCub and Friends
Jump to navigation Jump to search

IpOpt is an open-source tool from COIN-OR for nonlinear constrained optimization. It is required to install it in order to enable IpOpt-based feauters of iKin library.

IpOpt can be compiled by getting the sources directly from the web, or it can be installed from binaries. Binary releases are available for Windows and Linux, see below.

Remember to set the environment variable IPOPT_DIR pointing to the local directory where you have installed the libraries.

Compiling IpOpt

You can compile the library yourself. Visit the IpOpt web site, download the source code archive and follow the documentation to compile it carefully. Among all the possible sparse symmetric linear solvers IpOpt can rely on, we suggest to use the HSL Subroutines: you will be asked to register to HSL Programs in order to get the source code for MA27 and MC19 routines (or even MA57+METIS, i.e. the succesor of MA27). These routines are mandatory, i.e. without them you will be able to compile IpOpt (since it employs a runtime Linear Solver Loader) but it will not work. Moreover, if you are a linux user, make sure that the package gfortran is installed, since it is required for compiling HSL Subroutines.

Hint: to check whether IpOpt is working along with iKin framework, compile and execute the examples located under the iKin tutorials directory: if the IpOpt banner is displayed when the examples are launched then IpOpt is correctly configured.

Hereafter a simple list is given resuming all the basic steps you need to compile IpOpt:

 1) apt-get install gfortran (if you do not have it yet)
 2) download IpOpt source code and put it wherever you like; call this location IPOPT_DWN_DIR
 3) go under $IPOPT_DWN_DIR/ThirdParty/Blas and launch the "./get.Blas" script
 4) go under $IPOPT_DWN_DIR/ThirdParty/Lapack and launch the "./get.Lapack" script
5a) put the ma27ad.f and mc19ad.f under $IPOPT_DWN_DIR/ThirdParty/HSL (if you rely on HSL)
5b) go under $IPOPT_DWN_DIR/ThirdParty/MUMPS and launch the "./get.Mumps" script (if you rely on MUMPS)
 6) go under $IPOPT_DWN_DIR/ThirdParty/Metis and launch the "./get.Metis" script (if you rely on MUMPS or MA57)
 7) create a build directory wherever you like; call this location IPOPT_DIR and export it from within .bashrc
 8) go under $IPOPT_DIR and launch "$IPOPT_DWN_DIR/configure"
 9) launch "make"
10) launch "make test"
11) launch "make install"
12) if (IpOpt rel)<3.9.0 then put "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPT_DIR/lib" in .bashrc
13) if (IpOpt rel)>=3.9.0 then put "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPT_DIR/lib/coin:$IPOPT_DIR/lib/coin/ThirdParty" in .bashrc

Binary distributions

  • Windows. Users of MSVC8/9 can download a precompiled version of IpOpt; this version is compatible with YARP (compiled with Multi-threaded DLL switch enabled and packed using lib command):
  • Linux. Compiling IpOpt on Linux is easy. If you really want to download precompiled versions pick the version that matches your system, some are available from the IpOpt official web site, some are provided by us, see here: