Difference between revisions of "Windows: installation from sources"

From Wiki for iCub and Friends
Jump to: navigation, search
Line 1: Line 1:
[[Image:win-logo.jpg|right|50px]] 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.
+
[[Image:win-logo.jpg|right|50px]] Instructions on this page allow 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 Dependencies =
 
= Getting Dependencies =
  
* Download and execute the iCub installer (available from [[Downloads]]). Disable the iCub tick and proceed with the installation.
+
* Download and execute the Robotology installer available from [[Downloads]]. Pick up the binaries containing only the dependencies. When prompted with the dialog below, '''do not change the destination directory''' as the archive still contains a few packages that are not fully relocatable.
 
 
 
[[image:robotology-installer-1.png]]
 
[[image:robotology-installer-1.png]]
 
 
* Pick installation directory: all dependencies will be installed in separate folders in this directory:
+
* Keep the following checkbox ticked if you want the installer to update the environment variables.
 
 
 
 
 
[[image:robotology-installer-2.png]]
 
[[image:robotology-installer-2.png]]
 
 
'''Alternatively''', you can compile all dependencies yourself following the procedure here: [[PrepareWindows]] (notice however that this can be tedious, time consuming and error prone).
+
'''Alternatively''', you can compile all dependencies yourself following the procedure outlined at https://github.com/robotology/robotology-superbuild (notice however that this can be tedious, time-consuming and error-prone).
 +
 
 +
= Getting MS C++ Redistributable =
 +
 
 +
* Unless you already have the Microsoft Visual Studio installed on your machine, make sure that you have at least the [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads '''Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019'''] available. In particular, pick up the [https://aka.ms/vs/16/release/vc_redist.x64.exe 64-bits version].
  
 
= Getting CMake =  
 
= Getting CMake =  

Revision as of 11:49, 28 February 2020

Win-logo.jpg
Instructions on this page allow 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 Dependencies

  • Download and execute the Robotology installer available from Downloads. Pick up the binaries containing only the dependencies. When prompted with the dialog below, do not change the destination directory as the archive still contains a few packages that are not fully relocatable.

Robotology-installer-1.png

  • Keep the following checkbox ticked if you want the installer to update the environment variables.

Robotology-installer-2.png

Alternatively, you can compile all dependencies yourself following the procedure outlined at https://github.com/robotology/robotology-superbuild (notice however that this can be tedious, time-consuming and error-prone).

Getting MS C++ Redistributable

Getting CMake

If you follow YARP's installation instructions (Install from sources) you should have installed CMake.

Getting revision control system client

To download sources from our repositories you need to set up a revision control system client (git). If you follow YARP's installation instructions (Install from sources) you should have installed a git client.

Compile YARP

Follow instructions here: http://wiki.icub.org/yarp/specs/dox/user/html/install_yarp_windows.html, select Install from sources

Importantly, for use with the iCub robot when compiling YARP make sure that:

 CREATE_OPTIONAL_CARRIERS, set to ON 
 ENABLE_yarpcar_bayer, set to ON

Getting the iCub sources

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

for example:

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

Be careful and make sure to check out the correct tag matching the version of YARP installed on your system as per Software Versioning Table:

 cd /home/user/icub-main
 git checkout <tag>  

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.

Clone the icub-contrib-common repository from one of these addresses:

   (git read-only) git://github.com/robotology/icub-contrib-common.git
   (ssh read+write) git@github.com:robotology/icub-contrib-common.git
   (https read+write) https://github.com/robotology/icub-contrib-common.git 

for example:

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

Make sure to check out the correct tag as per Software Versioning Table:

cd /home/user/icub-contrib-common
git checkout <tag>

Configure ICUBcontrib

  • Run CMake.
  • Point the entry "Where is the source code" of the gui to C:/iCub/icub-contrib-common.
  • 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.
  • It is suggested to set the CMAKE_PREFIX_PATH environment variable to point to the installation directory (e.g. C:\Program Files\ICUBcontrib).
  • 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.