Windows: installation from sourcesNew

From Wiki for iCub and Friends
Jump to: navigation, search
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 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. You can download the sources from any of the available snapshots, or from subversion repository.

  • Snapshots of the sources are available 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 the code (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.

Using GIT, clone the repository from one of these addresses:

for example:

 cd /home/user
 git clone https://github.com/robotology/yarp.git
  • Set the environment variable YARP_ROOT to point to the root of the sources (the directory that contains the file ChangeLog). This is optional but recommended.

Get the iCub sources. Similarly you can download the sources from any of the available snapshots, or from subversion.

  • Snapshots of the sources are available here: Downloads. Download the zip file and unpack it.
  • SVN. Use file manager to browse to the location where you would like to download the code. Right click on an empty region of the window and select "SVN checkout" from the contextual menu.

You can download the whole repository from svn.

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

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

No password or username will be required. 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)

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

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

in this case append iCub/main to the checkout directory in svn.

Repeat the same process for:

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

checkout directory iCub/contrib.

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

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 containing 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 "main" inside the iCub repository.
  • Choose a directory that will store the binaries and the project files, e.g. "build" inside the source directory (ICUB_REPOSITORY/main/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
  • If you installed iCub to a different install prefix than YARP's, you need to set the YARP_DATA_DIRS environment variable to %YARP_DIR%/share/yarp;%ICUB_DIR/share/iCub

Check your installation

Now you are ready to check your installation.