Difference between revisions of "Linux:Installation from sources"

From Wiki for iCub and Friends
Jump to navigation Jump to search
m (Added mention of yarp autocomplete)
Line 113: Line 113:
   sudo make install
   sudo make install
   sudo ldconfig
   sudo ldconfig
=== Configure YARP autocomplete ===
If you want to install autocomplete support for YARP command line tools, you can
copy the yarp_completion script to your bash_completion directory:
  sudo cp /home/user/yarp/scripts/yarp_completion /etc/bash_completion.d/yarp


= Compile iCub =
= Compile iCub =
Line 122: Line 128:
Run CMake to generate makefiles:
Run CMake to generate makefiles:


   cd  /home/user/iCub-main
   cd  /home/user/icub-main
   mkdir build
   mkdir build
   cd build
   cd build
Line 144: Line 150:
== Compile iCub ==
== Compile iCub ==


   cd  /home/user/iCub-main/build
   cd  /home/user/icub-main/build
   make
   make
   sudo make install
   sudo make install

Revision as of 12:18, 20 February 2015

These instructions only apply to YARP > 2.3.23 and iCub > 1.1.13 software versions

See Linux:Installation from sources old for older instructions

Linux-all.jpg

The page contains instructions for compiling YARP and the iCub software. We recommend you get the required dependencies from the binary packages.

Getting all dependencies

Most of the dependencies are already available in the Linux distributions, in some cases (e.g. ipopt or ode in some distributions) we provide our own packages. Follow the steps on this page to configure the sources.list.

Install only the package icub-common:

sudo apt-get install icub-common

If you want to install all packages yourself, this is the list of packages you have to install (Linux: dependencies).

Setting up revision control systems

To download sources from our repositories you need to set up a revision control system client (subversion and/or git).

YARP can be obtained using git or subversion.

The iCub software can be obtained using subversion.

Both git and subversion comes with the icub-common metapackage, so you don't have to install them explicitly.

Learning git

To get sources you don't need to understand git in detail (just follow our instructions). However you can follow this link if you are willing to learn more Learning more about git.

Learning Subversion

If you are not familiar with svn we suggest at least you learn the basics. Some instructions are available from the sourceforge website:

  https://sourceforge.net/apps/trac/sourceforge/wiki/Subversion

A lot of more details (including a quick introduction) can be found instead here:

  http://svnbook.red-bean.com/

Important: if you are a developer and are planning to commit to the repository don't forget to configure svn. Follow this link: Subversion_client_flags.

Getting the YARP and iCub sources

Pick a directory where you would like to install the sources, e.g. /home/user

Choose one of these addresses:

For example:

 cd /home/user
 git clone https://github.com/robotology/yarp.git

This will create a directory called yarp with all the sources.

Similarly for iCub-main choose one of these addresses:

For example:

 cd /home/user
 git clone https://github.com/robotology/icub-main.git

This will create a directory icub-main with all the sources.

If the above does not work for you there are alternative ways: Getting sources using subversion or directly from the snapshots

Compile YARP

Create YARP makefiles

Pick up a build directory. E.g. /home/user/yarp/build and run CMake.

 mkdir /home/user/yarp/build
 cd /home/user/yarp/build
 ccmake ../

(ccmake is an interactive version of cmake)

Hit 'c' to configure. Choose the following options:

CMAKE_BUILD_TYPE to "Release" 
CREATE_GUIS, set to ON
CREATE_LIB_MATH, set to ON
CREATE_OPTIONAL_CARRIERS, set to ON 
ENABLE_yarpcar_bayer_carrier, set to ON

(leave default values as they are unless you know better)

Makefiles generation is an iterative process, hit "c" until the option "Generate" becomes available. Then hit "g" and quit.

Note 1: You can optionally change CMAKE_INSTALL_PREFIX, this is the directory where you would like to install YARP (default is /usr/local). If you do so, you will then need to:

  • In CMake set INSTALL_WITH_RPATH variable to ON to allow YARP programs to find the corresponding YARP libraries if they are not in your system's library path (alternatively you can tweak LD_LIBRARY_PATH)
  • Set up the environment accordingly (see Configure your environment below).

Note 2: CREATE_GUIS and CREATE_LIB_MATH require you have installed the libraries gtk and gsl (you have, if you have followed the instructions above).

Note 3: Do not select other options unless you know what you are doing.

Note 4: Depending on the hardware on your system you might want to compile additional device drivers. This is done for example on the pc104. Instruction for doing this are reported elsewhere.

Compile YARP

If you have completed the previous step you have makefiles ready in your build directory.

 cd /home/user/yarp/build
 make
 sudo make install
 sudo ldconfig

Configure YARP autocomplete

If you want to install autocomplete support for YARP command line tools, you can copy the yarp_completion script to your bash_completion directory:

 sudo cp /home/user/yarp/scripts/yarp_completion /etc/bash_completion.d/yarp

Compile iCub

Create iCub makefiles

Pick a build directory to store makefiles and binaries, e.g. /home/user/iCub-main/build

Run CMake to generate makefiles:

 cd  /home/user/icub-main
 mkdir build
 cd build
 ccmake ../

Hit 'c' to configure the project.

Select options:

 CMAKE_BUILD_TYPE to "Release"
 ENABLE_icubmod_cartesiancontrollerclient ON
 ENABLE_icubmod_cartesiancontrollerserver ON
 ENABLE_icubmod_debug_InterfaceClient     ON
 ENABLE_icubmod_gazecontrollerclient      ON
 

Leave all other options to default (unless you know what you are doing).

Note 1: You can optionally change CMAKE_INSTALL_PREFIX, this is the directory where you would like to install iCub (default is /usr/local). If you set it to a different prefix than YARP's, you will then need to set up the environment accordingly (see Configure your environment below).

Compile iCub

 cd  /home/user/icub-main/build
 make
 sudo make install

Setup ICUBcontrib (optional)

First you need to download the sources. These are available only on subversion from sourceforge.

 cd /home/user/
 git clone https://github.com/robotology/icub-contrib-common.git

First set up the ICUBcontrib meta-package, which allows to properly configure your modules/libraries so that they share the same installation prefix.

 cd /home/user/icub-contrib-common/
 mkdir build && cd build
 ccmake ../

At this stage you must change CMAKE_INSTALL_PREFIX entry here to the path of your liking, preferably in your home; hit 'g' to generate the project. If you do not change the CMAKE_INSTALL_PREFIX you will need to constantly use sudo for any subsequent action, eg: run module with administrative rights.

Finally,

 make install

Once you have installed the ICUBcontrib package you can compile the other modules individually.

Configure your environment

If you installed YARP and/or iCub or ICUBcontrib to non-default directories, you need to set your environment.

  • Se the ICUBcontrib_DIR env var to point to the installation directory.
  • Append $ICUBcontrib_DIR/bin to your PATH.
  • Set the CMAKE_PREFIX_PATH env var to point to the installation directory $ICUBcontrib_DIR.
  • Modify the variable YARP_DATA_DIRS accordingly, i.e.:
 YARP_DATA_DIRS=<YARP_INSTALL_PREFIX>/share/yarp:<ICUB_INSTALL_PREFIX>/share/iCub:<ICUBCONTRIB_INSTALL_PREFIX>/share/ICUBcontrib

Check your installation

Now you are ready to check your installation.