Windows: installation from sources

From Wiki for iCub and Friends
Revision as of 12:35, 10 February 2014 by Randaz (talk | contribs) (Using GIT)
Jump to: navigation, search

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

See Windows: installation from sources old for older instructions

Win-logo.jpg
Instructions in this page allows you to build YARP and iCub on Windows from sources. This allows getting the most recent version of the code from the repositories or a specific snapshot.The following sections will guide you step by step in the installation process.


Getting all dependencies

We recommend you follow the procedure described below, which will install precompiled binaries for all the required dependencies.

  • Download the iCub and YARP installers according to the compiler you use from this page.
  • Execute the YARP installer. Disable the YARP tick and proceed with the installation:

Binaries-no-yarp.jpg

  • Pick installation directory: all dependencies will be installed in separate folders in this directory:

Binaries-no-yarp2.jpg

  • Execute the iCub installer. Disable the iCub tick and proceed with the installation.

Binaries-icub-noicub.jpg

  • Pick installation directory: all dependencies will be installed in separate folders in this directory:

Binaries-icub-noicub2.jpg

Alternatively you can compile all dependencies yourself following the procedure here: PrepareWindows (notice however that this can be tedious, time consuming and error prone).

Getting CMake

Install CMake, this program will be required to build YARP and iCub

Getting revision control system client

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 (preferred) or subversion.

The iCub software can be obtained using subversion.

Getting git

There are some competing git solutions for Windows. Among them we recommend

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

This step is required only if you want to get the sources from our subversion repository. If you plan to use a snapshot you can skip this step.

Get a svn client for Windows, tortoisesvn is a good option, available from http://tortoisesvn.net/.
If you install this graphical client, remember to enable the "command line client tool" like shown in the picture.

Tortoise 2.jpeg


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 one of the following.

Snapshots

You can download the sources from any of the available snapshots.

Snapshots of the sources are available for YARP and iCub here: Downloads. Download the zip file and unpack it.

Using Subversion

Use file manager to browse to the location where you would like to download YARP (e.g. c:\yarp). Right click on an empty region of the window and select "SVN checkout" from the contextual menu.

Type the following string in the entry "URL of repository":

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

No password or username will be required.


Now for icub-main use file manager to browse to the location where you would like to download the code (e.g. c:\icub-main). Right click on an empty region of the window and select "SVN checkout" from the contextual menu.

Type the following string in the entry "URL of repository":

   https://github.com/robotology/icub-main/trunk

No password or username will be required.

Using GIT

Clone the YARP repository from one of these addresses:

for example:

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

Clone the icub-main repository from one of these addresses:

for example:

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

Compile YARP

Important: we assume here that you have completed all previous steps.

Create the YARP project files

  • Run CMake. In Windows this is a GUI.
  • Point the entry "Where is the source code" of the gui to the root directory where you have downloaded YARP (the directory YARP_ROOT, see above).
  • Choose a directory that will store the binaries and the project files. Usually this directory is %YARP_ROOT%/build. This is YARP's build directory.
  • Click on the button "Configure". Select the compiler you would like to use. CMake will normally select the correct compiler (WIN64 is not supported yet). Make sure the compiler matches the precompiled binaries you have installed.
  • Choose the following options:
 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
  • Project files generation is an iterative process, hit "Configure" until the button "Generate" becomes available. Then hit "Generate" and quit. Note: CMake uses red bars to highlight new options, these are not necessarily errors and can be ignored.

Note 1: You can optionally change CMAKE_INSTALL_PREFIX, this is the directory where you would like to install YARP (default is C:\Program Files\YARP).

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

Now we are ready to compile. Open the YARP visual studio project file in the build directory. In this order:

  • Select Debug configuration and build the target INSTALL.
  • Select Release configuration and build the target INSTALL.

Configure your environment

  • Set the environment variable YARP_DIR so that it points to the installation directory you have chosen (e.g. C:/Program Files/YARP).
  • Append C:/Program Files/YARP/bin to your PATH

Compile iCub

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

Generate project files

  • Run CMake.
  • Point the entry "Where is the source code" of the gui to the directory called "iCub-main".
  • Choose a directory that will store the binaries and the project files, e.g. "build" inside the source directory (ICUB_REPOSITORY/build). This is iCub's build directory.
  • Enable the following variables:
 ENABLE_icubmod_cartesiancontrollerclient ON
 ENABLE_icubmod_cartesiancontrollerserver ON
 ENABLE_icubmod_gazecontrollerclient      ON
  • Click on the button "Configure". Select the compiler you would like to use. CMake will normally select the correct compiler (WIN64 is not supported yet). Make sure the compiler matches the one you used to compile YARP.
  • Leave all options to default.
  • Hit "Configure" until the button "Generate" becomes available. Then hit "Generate" and quit. Note: CMake uses red bars to highlight new options, these are not necessarily errors and can be ignored.

Note 1: You can optionally change CMAKE_INSTALL_PREFIX, this is the directory where you would like to install iCub (default is C:\Program Files\iCub). If you do so, you will then need to set up the environment accordingly (see Configure your environment below).

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

Compile

Now we are ready to compile. Open the iCub visual studio project file in the build directory. In this order:

  • Select Debug configuration and build the target INSTALL
  • Select Release configuration and build the target INSTALL.

Configure your environment

  • Set the environment variable ICUB_DIR so that it points to CMAKE_INSTALL_PREFIX (e.g. C:\Program Files\iCub).
  • Append %ICUB_DIR%/bin to your PATH, e.g. C:\Program Files\iCub\bin
  • You need to set the YARP_DATA_DIRS environment variable to %YARP_DIR%/share/yarp;%ICUB_DIR%/share/iCub

Setup ICUBcontrib (optional)

If you wish to develop new software for iCub and share it in the contrib repository, you need to set up the ICUBcontrib meta-package, which allows to properly configure your modules/libraries so that they share the same installation prefix.

Checkout the contrib repository from sourceforge using svn.

Go to the directory in which you want to download the contrib directory i.e. (C:/).

Right click and select SVN Checkout, type this link in the field URL of the repository:

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

and this in the field Checkout directory:

 C:/iCub/contrib

This will create a directory iCub which contains the contrib directory with all the sources.

  • Run CMake.
  • Point the entry "Where is the source code" of the gui to C:/iCub/contrib/src/ICUBcontrib.
  • Choose a directory that will store the project files, e.g. "build" inside the source directory.
  • You can optionally change the CMAKE_INSTALL_PREFIX entry, this is the directory where you would like to install all modules/libraries.
  • Hit "Generate" and quit.
  • Open the ICUBcontrib Visual Studio solution file in the build directory.
  • Select Release configuration and build the target INSTALL.

Configure your environment

  • Set the environment variable ICUBcontrib_DIR so that it points to CMAKE_INSTALL_PREFIX (e.g. C:\Program Files\ICUBcontrib).
  • Append %ICUBcontrib_DIR%/bin to your PATH
  • If you installed ICUBcontrib to a different install prefix than YARP's, you need to extend the YARP_DATA_DIRS environment variable so that it matches:
 %YARP_DIR%/share/yarp;%ICUB_DIR/share/iCub;%ICUBcontrib_DIR%/share/ICUBcontrib

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

Check your installation

Now you are ready to check your installation.