1. w4orocos: build system

2. w4orocos: configuration →

Contents
1.1 Overview
1.2 Orocos Toolchain
1.3 Demonstration OROCOS application
1.4 Configuration
1.5 WrmOS build options
1.6 Building for WrmOS
1.7 Building for localhost (GNU Linux)

1.1 Overview [up]


w4orocos looks like usual WrmOS application. Project consist from 2 main parts:

  • lib/orocos Orocos Toolchain with additional supporting of WrmOS and SPARC;
  • app/orocos — demonstration OROCOS application.

w4orocos has make based building system. At the same time for building lib/orocos and app/orocos are using its own CMake based build system.

w4orocos is a WrmOS project — it run on top of WrmOS. But also w4orocos allows build and run OROCOS application for local host (GNU Linux). For this feature root Makefile has additional rules. These rules have prefix localhost-.
See Building for localhost (GNU Linux) for details.

1.2 Orocos Toolchain [up]


File structure

Orocos Toolchain located in lib/orocos. This directory contains only one file:

Makefile Library makefile.

While building w4orocos download Orocos Toolchain sources and build it as static library.

Build dependencies

Orocos toolchain has CMake based build system. Also OROCOS use for building another utilities and packages catkin, ruby and other. The simplest way to install all utilities and packages is installing of ROS. Unfortunately ROS:

  • is very big and require a lot of disk space;
  • my be unfit for installing on OS different from Ubuntu.

If ROS installation is unsuitable way, you can install all OROCOS dependencies manually.

During OROCOS building the following steps are taken:

  1. Clone orocos_toolchain super-repository from github;
  2. Clone sub-repositories — log4cpp, ocl, orogen, rtt, rtt_typelib, typelib, utilrb;
  3. Clone fork of RTT with supported WrmOS and SPARC and override original RTT;
  4. Build all components: as static library for WrmOS target, and as static and dynamic libraries for GNU Linux target;

1.3 Demonstration OROCOS application [up]


File structure

Demonstration application located in app/orocos. This directory contains the following files:

Makefile WrmOS application makefile.
demo.oro/ Directory with OROCOS application.
demo.oro/CMakeLists.txt OROCOS application build script.
demo.oro/src/components.hpp OROCOS application components header file.
demo.oro/src/components.cpp OROCOS application components source file.
demo.oro/src/main.cpp OROCOS application entry point source for executable application.
demo.oro/src/start.ops OROCOS application entry point script to run application by deployer.

What the application does

Demonstration application create 4 components (controller, servo, encoder, shaft) and communicate each other via different OROCOS API. This activities emulate work of real robot and demonstrate OROCOS capabilities.

For WrmOS demo-application may be built only as executable file. WrmOS runs it on target board and starts to execute  main() function from main.cpp.

For GNU Linux demo-application may be built as static executable and as shared library. Shared library allows run OROCOS components dynamically by deployer application. Script file start.ops contains the same actions as main.cpp, but script language.

During demo-application building the following steps are taken:

  1. Build components.cpp.
  2. For static executable: build main.cpp and link executable file.
  3. For shared library:  link shared library with components.

1.4 Configuration [up]


WrmOS part of configuration

w4orocos looks like usual WrmOS application. Therefore its configuration is usual configuration of WrmOS project.

Project parameters include:

  • target system parameters (CPU, memory, base system devices, system clock frequency, ...);
  • libraries build parameters (debug flags);
  • kernel build parameters (debug flags, UART, timer, MMU);
  • application build parameters (debug flags);
  • applications list;
  • Alpha run-time configuration.

See WrmOS configuration and w4orocos configuration clauses for detail.

OROCOS part of configuration

OROCOS configuration parameters is specifying in lib/orocos/Makefile.
See the orocos.org for detail.

1.5 WrmOS build options [up]


Build options are command line or shell environment variables. Generally build starts by such command:

make build P=cfg/prj/orocos-qemu-leon3.prj W=../wrmos B=../build/orocos-qemu-leon3 -j V=1

Build system supports the next options:

target mandatory can be build, clean or rebuild (clean & build)
P=project-file-name.prj mandatory specifies project file
B=build-dir-name mandatory specifies build directory, all build files will be here
W=wrmos-dir-name mandatory specifies original WrmOS source directory
V=0|1 optional verbose flag, may be 0 or 1, allows hide detail of building (V=0, by default) or print it (V=1)
-j optional make parameter, allows to do parallel building and make it faster

1.6 Building for WrmOS [up]


w4orocos is external WrmOS project. It can be build from both 1) the original WrmOS source directory and 2) the w4orocos project directory.

From WrmOS source directory building starts by command:

cd wrmos
make build P=../w4orocos/cfg/prj/orocos-qemu-leon3.prj B=../build/orocos-qemu-leon3 E=../w4orocos -j

From w4orocos project directory building starts by command:

cd w4orocos
make build P=cfg/prj/orocos-qemu-leon3.prj W=../wrmos B=../build/orocos-qemu-leon3 -j

It is assumed that directories wrmos and w4orocos are near.

Intermediate build files (generated headers, objects, ELFs) will be in build directory that was specified. The main building result is bootloader executable file:

../build/orocos-qemu-leon3/ldr/bootloader.elf

or bootloader disk image:

../build/orocos-qemu-leon3/ldr/bootloader.img

This file may be loaded on target board or run on QEMU virtual machine:

qemu-system-sparc -M leon3_generic -display none -serial stdio \
                  -kernel ../build/orocos-qemu-leon3/ldr/bootloader.elf

1.7 Building for localhost (GNU Linux) [up]


w4orocos may be build for local host machine with GNU Linux. For this feature root Makefile contains additional rules:

localhost-full Build and run OROCOS and demo-application as static executable and as shared library by deployer. OROCOS library will contains the full set of components.
localhost-min Build and run OROCOS and demo-application as static executable. OROCOS library will contains the minimal set of components.
localhost-clean Clean OROCOS library and demo-application.
localhost-distclean Clean OROCOS library and demo-application and remove downloaded sources.
localhost-get-sources Download sources from external repositories.
localhost-build-full Build OROCOS and demo-application as static executable and as shared library by deployer. OROCOS library will contains the full set of components.
localhost-build-min Build OROCOS and demo-application as static executable. OROCOS library will contains the minimal set of components.
localhost-build-orocos-full Build OROCOS as static and as shared library. OROCOS library will contains the full set of components.
localhost-build-orocos-min Build OROCOS as static library. OROCOS library will contains the minimal set of components.
localhost-build-demo Build demo-application.
localhost-clean-orocos Clean OROCOS library.
localhost-clean-demo Clean demo-application.
localhost-run-deployer Run deployer and execute script start.ops.
localhost-run-executable Run static linked executable.

For example, to build and run OROCOS and demo-application as static executable and after that run demo-components by deployer use this command:

make localhost-full B=../build/orocos.loc -j

See additional information in the article Running w4orocos.

2. w4orocos: configuration →