Difference between revisions of "Linux:Installation from sources old"

From Wiki for iCub and Friends
Jump to: navigation, search
m
 
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[Image:linux-all.jpg|right|150px]] The page contains instructions for compiling YARP and the iCub software. We recommend you get the required dependencies from the binary packages.  
+
'''These instructions only apply for YARP<=2.3.23 and iCub<=1.1.13 software versions'''
 +
 
 +
''See [[Linux:Installation from sources]] for new instructions''
 +
 
 +
[[Image:linux-all.jpg|right|150px]] 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 =
 
= 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 step on [[Linux:Installation from binaries|this page]] to configure the sources.list.
+
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 [[Linux:Installation from binaries|this page]] to configure the sources.list.
  
 
Install only the package icub-common:
 
Install only the package icub-common:
Line 17: Line 21:
 
If you want to install all packages yourself, this is the list of packages you have to install ([[Linux: dependencies]]).
 
If you want to install all packages yourself, this is the list of packages you have to install ([[Linux: dependencies]]).
  
= Getting Subversion =
+
= 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.
 +
 
 +
== Getting git ==
 +
 
 +
Install git:
 +
 
 +
  sudo apt-get install git
 +
 
 +
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]].
 +
 
 +
== Getting Subversion ==
  
 
Install subversion:
 
Install subversion:
Line 38: Line 58:
  
 
   cd /home/user
 
   cd /home/user
  svn co https://yarp0.svn.sourceforge.net/svnroot/yarp0/trunk/yarp2
 
  
This will create a directory called yarp2 with all the sources.
+
Using subversion:
 +
  svn co https://github.com/robotology/yarp/trunk yarp
 +
 
 +
or (preferred) using  GIT, cloning the repository from one of these addresses:
 +
* (git read-only)    git://github.com/robotology/yarp.git
 +
* (ssh read+write)    git@github.com:robotology/yarp.git
 +
* (https read+write)  https://github.com/robotology/yarp.git
 +
 
 +
for example:
 +
  cd /home/user
 +
  sudo apt-get install git
 +
  git clone https://github.com/robotology/yarp.git
 +
 
 +
This will create a directory called yarp with all the sources.
 +
 
 +
* Set the YARP_ROOT environment variable in your .bashrc to point to /home/user/yarp.
 +
 
  
* Set the YARP_ROOT environment variable in your .bashrc to point to /home/user/yarp2.
 
  
 
Get the iCub sources
 
Get the iCub sources
Line 57: Line 91:
 
   mkdir iCub
 
   mkdir iCub
  
   svn co https://svn.code.sf.net/p/robotcub/code/trunk/ iCub/main
+
   svn co https://svn.code.sf.net/p/robotcub/code/trunk/iCub/main iCub/main
   svn co https://svn.code.sf.net/p/robotcub/code/trunk/ iCub/contrib
+
   svn co https://svn.code.sf.net/p/robotcub/code/trunk/iCub/contrib iCub/contrib
  
 
This will create only the directories ''iCub/main'' and ''iCub/contrib'' with all the sources.
 
This will create only the directories ''iCub/main'' and ''iCub/contrib'' with all the sources.
Line 87: Line 121:
 
Makefiles generation is an iterative process, hit "c" until the option "Generate" becomes available. Then hit "g" and quit.  
 
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).
+
Note 1: By default CMake will use /usr/local as default installation path. Read instructions here if you want to do otherwise ([[Pick a different installation directory]]).
  
 
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 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).
Line 139: Line 173:
 
Leave all other options to default (unless you know what you are doing).
 
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).
+
Note 1: By default CMake will use /usr/local as default installation path. Read instructions here if you want to do otherwise ([[Pick a different installation directory]]).
  
 
=== Compile iCub ===  
 
=== Compile iCub ===  
  
   cd $ICUB_DIR
+
   cd /home/user/iCub/main/build
 
   make
 
   make
 
   sudo make install
 
   sudo make install
 +
 +
Important, do:
  
 
   make install_applications
 
   make install_applications

Latest revision as of 19:09, 10 September 2013

These instructions only apply for YARP<=2.3.23 and iCub<=1.1.13 software versions

See Linux:Installation from sources for new 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

Install CMake:

 sudo apt-get install cmake cmake-curses-gui

the second package installs the curses based interface (ccmake).

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.

Getting git

Install git:

 sudo apt-get install git

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.

Getting Subversion

Install subversion:

 sudo apt-get install 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

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

 cd /home/user

Using subversion:

 svn co https://github.com/robotology/yarp/trunk yarp 

or (preferred) using GIT, cloning the repository from one of these addresses:

for example:

 cd /home/user
 sudo apt-get install git
 git clone https://github.com/robotology/yarp.git

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

  • Set the YARP_ROOT environment variable in your .bashrc to point to /home/user/yarp.


Get the iCub sources

You can download the whole repository from svn. In the same directory /home/user (or elsewhere):

 svn co https://svn.code.sf.net/p/robotcub/code/trunk/iCub

This will create a directory iCub with all the sources.

Notice that this may take some time. Alternatively you can download individual modules (i.e. main and contrib or firmware)

 cd /home/user
 mkdir iCub
 svn co https://svn.code.sf.net/p/robotcub/code/trunk/iCub/main iCub/main
 svn co https://svn.code.sf.net/p/robotcub/code/trunk/iCub/contrib iCub/contrib

This will create only the directories iCub/main and iCub/contrib with all the sources.

Compile YARP

Create YARP makefiles

Pick up a build directory. E.g. $YARP_ROOT/build and run CMake.

 mkdir $YARP_ROOT/build
 cd $YARP_ROOT/build
 ccmake $YARP_ROOT

(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: By default CMake will use /usr/local as default installation path. Read instructions here if you want to do otherwise (Pick a different installation directory).

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 $YARP_ROOT/build
 make
 sudo make install

Compile iCub

In the following we will call ICUB_REPOSITORY the top directory of the repository (i.e. the iCub containing the files AUTHORS, README and ChangeLog).

Pick application directory

The first step in the compilation process is to decide where you want to store applications (scripts and configuration files).

  • Select a directory that will store applications. A common option is to use the root of the repository, i.e. the directory ICUB_REPOSITORY. Set the ICUB_ROOT environment variable to point to this directory, for example if you downloaded the repository in /home/user:
 export ICUB_ROOT=/home/user/iCub

It is a good idea to append the previous line to your ~/.bashrc.

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_gazecontrollerclient      ON
 ENABLE_icubmod_debug_InterfaceClient     ON

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

Note 1: By default CMake will use /usr/local as default installation path. Read instructions here if you want to do otherwise (Pick a different installation directory).

Compile iCub

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

Important, do:

 make install_applications

Check your installation

Now you are ready to check your installation.