CompileWindows

From Wiki for RobotCub and Friends

Jump to: navigation, search

Important: we assume here that you have completed the previous steps in the manual (see Section 6.1 "Prepare Your System" in the manual's main page).

Working on:

Vista (the worst possible situation)
Visual Studio 8 

For other compilers, e.g. Visual Studio express, additional documentation is required. Note: Visual Studio express requires the installation of the Windows Platform SDK. Visual Studio 8 comes pre-packed with the Platform SDK.

Contents

Compiling YARP

Create the YARP Makefiles

Run CMake. Point the source code directory ("Where is the source code" entry in the gui) to %YARP_ROOT% (where you put the YARP source files). Pick the directory in which you would like to generate project files ("Where to build the binaries" entry in the gui). We call this directory YARP_DIR. The most common situation to use YARP_DIR=YARP_ROOT, this is the assumption in this documentation.

Choose the following options:

  • CMAKE_BUILD_TYPE, set to "Release" in case you'd like to optimize
  • CREATE_GUIS, set to ON
  • CREATE_LIB_MATH, set to ON

Important: CREATE_GUIS and CREATE_LIB_MATH require you have installed the libraries gtk and gsl (see PrepareWindows)

Create the makefiles by hitting configure several times and then ok.

Installation: CMake automatically creates an install rule for target/project. In the documentation we assume you install binaries in %YARP_ROOT%/bin and %YARP_ROOT%/lib. The compiler will build executables and libraries there, so you don't need to perform the installation. You can instruct CMake so that it generates make/project files that install to other places, for example %YARP_DIR%/bin and %YARP_DIR%/lib. You can do this by running cmake again and setting the variable:

  • CMAKE_INSTALL_PREFIX to %YARP_DIR%

When you do make install all binaries will be copied to %YARP_DIR%/bin and %YARP_DIR%/lib.

Of course you can customize the installation directory as you wish, however the remainder of the documentation assumes the above configuration.

  • 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 %YARP_DIR% and compile it.

Example

Now we're ready to run a simple Yarp code to test the installation so far. You might want to prepare a yarp.conf file in the conf directory similar to this one:

127.0.0.1 10000
// start network description, don't forget to separate "Node=" 
// and names with space
[NETWORK_DESCRIPTION]
[END]

which tells Yarp (the server) to start on the localhost and respond to port 10000. This allows Yarp applications to find the name server (see next chapter).

You can then try running the server. On a terminal window, type:

yarpserver

and you should see:

yarp: Port /root active at tcp://127.0.0.1:10000 Name server can be browsed at http://127.0.0.1:10000/ yarp: Bootstrap server listening at mcast://224.2.1.1:10001

if you type on a web browser http://127.0.0.1:10000 you get information about the name server (registered ports, info, etc.).

For the time being we can just check functionality by running a simple example. On another terminal type:

yarp read /portread

on a third terminal:

yarp write /portwrite

and on yet another terminal:

yarp connect /portwrite /portread

you'll see the effect on the name server:

yarp: registration name /portwrite ip 127.0.0.1 port 10012 type tcp
yarp: registration name /portread ip 127.0.0.1 port 10002 type tcp

Now, anything typed on the yarp write will be sent and printed on the read side.

Options

If you need to compile devices that provide interface to the hardware you can follow this link Compilation on the pc104

Compile the iCub software

Generate makefiles

First you need to generate make files. Run cmake. Point both the source code and binary directories ("Where is the source code" and "Where you put the source files" entries in the gui) to %ICUB_ROOT%. Important: the iCub software does not allow to build binaries in a different directories.

You don't need particular options. If you want to compile using optimization just set:

  • CMAKE_BUILD_TYPE to "Release"

Other options are:

  • CREATE_GUIS_GTK
  • CREATE_GUIS_GTKMM
  • CREATE_GUIS_QT

These options are recommended, because they enable compilation of some useful GUIs. Important: these options can be enabled only if you have installed the required libraries: gtk, gtkmm and qt (see PrepareWindows).

  • Similarly to YARP, by default make will build executables and libraries in %ICUB_ROOT%/bin and %ICUB_ROOT%/lib. You can customize where "make install" will copy these files by setting: CMAKE_INSTALL_PREFIX to something you like.

If you need to compile optional devices (for example devices that provide interface to the hardware) you can follow these links:

CompileDevices

CompileiCubDevices

iCubModulesList

Compile

Open the project files in %ICUB_ROOT%, compile and install the executables.

Personal tools