Difference between revisions of "Installing IPOPT"

From Wiki for iCub and Friends
Jump to: navigation, search
(Compiling IpOpt)
(Windows)
 
(45 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[https://projects.coin-or.org/Ipopt IpOpt] is an open-source tool from [http://www.coin-or.org COIN-OR] for nonlinear constrained optimization. It is required to install it in order to enable IpOpt-based feauters of [http://eris.liralab.it/iCub/main/dox/html/group__iKin.html iKin] library.
+
[https://projects.coin-or.org/Ipopt IpOpt] is an open-source tool from [http://www.coin-or.org COIN-OR] project for nonlinear constrained optimization. It is required to install it in order to enable IpOpt-based features of [http://eris.liralab.it/iCub/main/dox/html/group__iKin.html 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.
+
IpOpt can be installed as iCub dependency, as stand-alone binaries, or compiled by getting the sources directly from the web. See below.
  
Remember to set the environment variable '''IPOPT_DIR''' pointing to the local directory where you have installed the libraries.
 
  
== Compiling IpOpt ==
+
== iCub dependency ==
You can compile the library yourself. Visit the [https://projects.coin-or.org/Ipopt 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.
+
Visit the [[ICub Software Installation|iCub Software Installation]] page and follow the guide for installing from sources: this way you will get IpOpt installed as a dependency.
  
Hereafter a simple list is given resuming all the basic steps you need to compile IpOpt:
+
Let us enforce that '''INSTALLING IPOPT AS A DEPENDENCY IS THE RECOMMENDED SOLUTION''', which minimizes how package maintenance impacts your system.
  
  1) do "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) "cd $IPOPT_DWN_DIR/ThirdParty/Blas" and launch the "./get.Blas" script
 
  4) "cd $IPOPT_DWN_DIR/ThirdParty/Lapack" and launch the "./get.Lapack" script
 
  5a) if you rely on HSL: put ma27ad.f and mc19ad.f in $IPOPT_DWN_DIR/ThirdParty/HSL
 
  5b) if you rely on MUMPS: "cd $IPOPT_DWN_DIR/ThirdParty/MUMPS" and launch the "./get.Mumps" script
 
  6) if you rely on MUMPS/MA57: "cd $IPOPT_DWN_DIR/ThirdParty/Metis" and launch the "./get.Metis" script
 
  7) create a build directory wherever you like; call this location IPOPT_DIR and export it from within .bashrc
 
  8) "cd $IPOPT_DIR" and launch "$IPOPT_DWN_DIR/configure"
 
  9) launch "make"
 
  10) launch "make test"
 
  11) launch "make install"
 
12a) if rel(IpOpt)<3.9.0 put "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPT_DIR/lib" in .bashrc
 
12b) if rel(IpOpt)>=3.9.0 put "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPT_DIR/lib/coin:$IPOPT_DIR/lib/coin/ThirdParty" in .bashrc
 
  
== Binary distributions ==
+
== Install from binaries distribution==
  
* 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):
 
** [http://eris.liralab.it/iCub/downloads/packages/windows Windows distribution]
 
  
* 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:
+
=== Windows ===
** [http://www.coin-or.org/download/binary/Ipopt/ Linux distribution].
+
Ipopt can be easily installed via [https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019#installation vcpkg].
** [http://eris.liralab.it/iCub/downloads/packages/linux Linux distribution (more)].
+
 
 +
Firstly get [https://github.com/robotology/robotology-vcpkg-binary-ports robotology-vcpkg-binary-ports], then:
 +
  ./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 [https://docs.brew.sh/Installation homebrew]:
 +
  brew install ipopt

Latest revision as of 12:08, 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.

Firstly get robotology-vcpkg-binary-ports, then:

 ./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