Information

Documentation

Get OpenRDK at SourceForge.net. Fast, secure and Free Open Source software downloads

edit SideBar

Cross-Building OpenRDK

OpenRDK can be cross-compiled for several platforms. Currently it can be compiled to run on:

  • any standard Linux distribution on x86 platform;
  • Atom processor and Geode processor on OpenEmbedded distribution (for Nao robots with Geode or Atom);
  • a generic ARM processor (currently supported ARM7 and ARM9).

In this section, the build system for different platforms will be explained. As in CMake Cross Compiling page, we will use the term target to indicate the target platform where you would like to run OpenRDK and the term host to indicate the platform where you will compile the software.

To enable the cross compilation, you should have a Toolchain file like explained in the CMake Cross Compiling page.

First, run cmake passing the toolchain file:

  $ cmake -DCMAKE_TOOLCHAIN_FILE=<path-to-the-toolchain-file> <path-to-OpenRDK/src>

We are assuming that OpenRDK sources are specified in <path-to-OpenRDK>.

Tips'n'help: The complete toolchain file can be specified just once, the first time cmake is run. Any other configuration can be performed using the cache and the command:

  $ cmake .

OpenRDK provide complete Toolchain file support for some architecture, like Geode, Atom and Arm9. Below you can find more detailed instructions about the supported architecture.

Then, you can compile the OpenRDK as explained in Building.

The results of compilation will be located in the same directories as normal compilation.

In the bin directory are placed all the binaries for running OpenRDK applications. These are cross-compiled, thus they are not supposed to be run in the host system where you compiled them.

In the lib directory you will find all the built libraries that are required for running OpenRDK on the target system.

Tips'n'help: to run your program on the target system, you should add the library dir to your LD_LIBRARY_PATH:

  $ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${your-library-dir-here}

Geode and Atom Platform

This platform is mainly supported for Nao robots, and therefore, in order to cross-compile you need the SDK provided by Aldebaran company. More in details you need this packages

  • the Nao SDK (any version) (Linux, Win, Mac)
  • the Cross compilation Tools (any version) (Linux-only)

Currently they can be found in the RoboCup area of the Aldebaran website, and thus you need a valid account there.

  1. First of all, point your browser to the RoboCup Area of Aldebaran website and go to the "Download Center":->
    -> Software-> Download -> All Downloads 
    
  2. Download the main packages above
  3. Uncompress them somewhere on your PC (Note: it is better to keep sdk and cross tool chain in the same directory to avoid searching for them in your hard-drive):->
    $ sudo mkdir -p /usr/local/opt/
    $ sudo chown -R <your-user.your-main-group> /usr/local/opt (this is to allow your user to write $ in the created dir)
    $ cd /usr/local/opt/
    $ tar zxvf <path-where-your-downloaded-it>/NaoQiRobocup-1.X.X-Linux.tar.gz
    $ ln -s NaoQiRobocup-1.X.X-Linux nao-sdk   (this will be clear later)
    $ tar jxvf <path-where-your-downloaded-it>/nao-ctc-1.X.X.tar.bz2
    $ ln -s /usr/local/opt/nao-ctc-1.X.X nao-ctc   (convenient shortcut)
    
  4. Download cross compiled libraries addons: ctc-geode-addons (for Geode platform) or ctc-atom-addons (for Atom platform) (this step is necessary for compiling some specialized modules within the OpenRDK software)
  5. Uncompress it in some convenient directory:->
    $ cd /usr/local/opt/
    $ tar zxvf <path-where-your-downloaded-it>/oe-ctc-addons-X.X.X.tar.gz
    $ ln -s /usr/local/opt/oe-ctc-addons-X.X.X nao-ctc-addons   (convenient shortcut)
    
  6. Set some global variables (and maybe put them in your .bashrc):->
    $ export AL_DIR=/usr/local/opt/nao-sdk
    $ export OE_CROSS_DIR=${AL_DIR}/../nao-ctc
    $ export OE_CROSS_ADDONS_DIR=${AL_DIR}/../nao-ctc-addons
    

These variables are searched by OpenRDK: they contain the cross-compiler, includes and libraries. If you defined symlink nao-sdk to real ${AL_DIR}, in case of upgrade of NaoQi framework you will just update the symlink rather than re-edit your .bashrc.

Configure the building for using the Geode toolchain:

  $ cmake -DCMAKE_TOOLCHAIN_FILE=<path-to-OpenRDK>/src/build_tools/cmake/Toolchain-geode.cmake  <path-to-OpenRDK>

or configure the building for using the Atom toolchain:

  $ cmake -DCMAKE_TOOLCHAIN_FILE=<path-to-OpenRDK>/src/build_tools/cmake/Toolchain-atom.cmake  <path-to-OpenRDK>

Now, you are ready to compile the code for the Geode platform. Refer to the Building section.

Remember that, to compile the Nao modules, COMPILE_NAO_SECTIONS should be turned on in the using 'ccmake .' .

  $ ccmake .

  ...
  COMPILE_NAO_SECTIONS               ON
  ...

ARM Platform

This platform can be found in many embedded motherboard, such as the BeagleBoard or the DIOPSIS.

  1. First of all, you need a compiler for ARM processor. Our suggestion is to use the Lite version of Code Sourcery G++ Compiler. You can find it here.
  2. Download the compiler: e.g. Sourcery G++ Lite 2009q3-68 for ARM EABI
  3. Install it somewhere on your PC (Note: you can put it in /usr/local/opt). You should set some convenient short-cut->
    $ ln -s <installation-directory> ctc-armel
    
  4. We provide an addons for the needed libraries here.

However, if you need more libraries, you can download the compiled packages for armel architecture from Debian repository or cross-compile them by youself. Put it in your preferred directory: e.g. /usr/local/opt/ctc-armel-addons.

  1. Set some global variables (and maybe put them in your .bashrc):->
    $ export ARM9_CROSS_DIR=/usr/local/opt/ctc-armel
    $ export ARM9_CROSS_ADDONS_DIR=/usr/local/opt/ctc-armel-addons
    

These variables are searched by OpenRDK: they contain the cross-compiler, includes and libraries. If you defined symlink ctc-armel to real Code Sourcery Compiler installation directory, in case of upgrade of the compiler you will just update the symlink rather than re-edit your .bashrc.

Configure the building for using the Arm9 toolchain:

  $ cmake -DCMAKE_TOOLCHAIN_FILE=<path-to-OpenRDK>/src/build_tools/cmake/Toolchain-arm9.cmake  <path-to-OpenRDK>

Now, you are ready to compile the code for the Arm9 platform. Refer to the Building section.

You maybe interested in following this tutorial.

© 2004-2009 RoCoCo Laboratory Powered by PmWiki
Edit - History - Printable View - Recent Changes - Search
Page last modified on May 10, 2012, at 03:57 PM