Difference between revisions of "Installing IPOPT"

From Wiki for iCub and Friends
Jump to: navigation, search
(Binary distributions)
Line 25: Line 25:
 
Ipopt can be easily installed via [https://docs.brew.sh/Installation homebrew]:
 
Ipopt can be easily installed via [https://docs.brew.sh/Installation homebrew]:
 
   brew install ipopt
 
   brew install ipopt
 
== Compiling IpOpt ==
 
You can compile the library yourself. Visit the [https://projects.coin-or.org/Ipopt IpOpt] web site, download the source code archive (we support releases from 3.5.4 onward) and '''follow the documentation to compile it carefully'''.
 
Among all the possible sparse symmetric linear solvers IpOpt can rely on, we suggest to use MUMPS: it is fully open source and it turns to be suitable for our needs.
 
Moreover, if you are a linux user, make sure that the package '''gfortran''' is installed.
 
 
'''Hint''': to check whether IpOpt is working along with iKin framework, compile and execute the examples located under the [https://github.com/robotology/icub-tutorials/tree/master/src/iKin 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 under Linux:
 
 
  1) do "sudo apt-get install gfortran" (if you do not have it yet)
 
  2) download [http://www.coin-or.org/download/source/Ipopt IpOpt source code] and put it wherever you like; call this location IPOPT_DWN_DIR
 
  3) "cd $IPOPT_DWN_DIR/ThirdParty/Blas" and launch "./get.Blas"
 
  4) "cd $IPOPT_DWN_DIR/ThirdParty/Lapack" and launch "./get.Lapack"
 
  5) "cd $IPOPT_DWN_DIR/ThirdParty/MUMPS" and launch "./get.Mumps"
 
  6) "cd $IPOPT_DWN_DIR/ThirdParty/Metis" and launch "./get.Metis"
 
  7) "cd $IPOPT_DWN_DIR/ThirdParty/ASL" and launch "./get.ASL"
 
  8) create a build directory wherever you like; call this location IPOPT_DIR and export it from within .bashrc
 
  9) "cd $IPOPT_DIR" and launch "$IPOPT_DWN_DIR/configure"
 
  10) launch "make"
 
  11) launch "make test"
 
  12) launch "make install"
 
 
Should you experience problems while downloading third-party code (e.g. Blas, Lapack), please replace the '''ftp''' protocol with '''http''' for the source address within the corresponding scripts (e.g. get.Blas, get.Lapack). For example: ftp://www.netlib.org/[...] becomes http://www.netlib.org/[...].
 
 
If, for any reason, the MUMPS package cannot be downloaded straightaway through the script, you need then to sign in [http://mumps.enseeiht.fr/index.php?page=dwnld here] to receive the link to the archive via e-mail. Select options "Real, Symmetric" while submitting your request. Once got it (it takes a few minutes to receive the link), put the archive in "$IPOPT_DWN_DIR/ThirdParty/MUMPS" and proceed with the operations reported within the get.Mumps script (i.e. gunzip, tar, rm, mv).
 

Revision as of 12:05, 12 June 2020

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

IpOpt can be installed as iCub dependency, as stand-alone binaries, or compiled by getting the sources directly from the web. See below.


iCub dependency

Visit the iCub Software Installation page and follow the guide for installing from sources: this way you will get IpOpt installed as a dependency.

Let us enforce that INSTALLING IPOPT AS A DEPENDENCY IS THE RECOMMENDED SOLUTION, which minimizes how package maintenance impacts your system.


Install from binaries distribution

Windows

Ipopt can be easily installed via vcpkg:

 ./vcpkg.exe --overlay-ports=<repo_parent_directory>/robotology-vcpkg-binary-ports install ipopt-binary:x64-windows

Linux

Just type:

 sudo apt install coinor-libipopt-dev

macOS

Ipopt can be easily installed via homebrew:

 brew install ipopt