Cross Compile Player with Openembedded and BitBake

From The Player Project

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Woolerystixmaker (talk) to last revision by Rmattes)
Line 142: Line 142:
[ custom essay writing]

Revision as of 22:57, 29 August 2011

The following is a simple guide on how to cross compile player using bitBake and Openembedded(OE) tools.

The author of this guide is new to Openembedded, bitBake and cross compiling in general so please feel free to edit, update or correct. The guide was tested on the Overo Gumstix with an iRobot Create and a Hokuyo Urg Laser.

Special thanks to Ash Charles, Geoffrey Biggs and Rich Mattes who helped me getting this working.



This guide is intended for Player users who want to have the latest version of Player on their OpenEmbedded systems. This guide has been tested on the BeagleBoard using the Angstrom distribution (which is based on OpenEmbedded), and on the Gumstix Overo using the OpenEmbedded distribution. The guide should apply to most any OpenEmbedded environment.

Setting up the build environment

If you're using a Gumstix Overo, follow the directions at for setting up the Overo environment

Beagleboard users should first refer to the Getting Angstrom Running guide to get the feel for how to get Angstrom running. To set up the build environment, refer to the OpenEmbedded and Git guide.

More information on OpenEmbedded can be found in the Openembedded Manual

For more information on the BitBake tool, view the BitBake manual at

Compiling custom programs

Gumstix tutorial (note slightly outdated and designed for the verdex, take note of the following changes:

  • Ipkg is now opkg
  • Directory structure is differerent
  • packages is now recipes
  • gumstix-oe is now overo-oe
  • com.gumstix.collection and org.openembedded.snapshot have been combined into
  • arm5 is now arm7

OpenEmbedded Manual (very useful resource)

If you want Gearbox with your player, you must install Gearbox first here

Player Recipe

The following recipe will cross-compile player and package it. You will need to save it as a .bb file in your recipes directory, which you should have created from the setting up a build environment.

For the BeagleBoard, create a folder in openembedded/recipes directory of the buildroot, named "player". Then, save the following recipe into a file named ""

For the Gumstix, create a folder in the gumstix-oe/recipes/ directory, named "player". Then, save the following recipe into a file named ""

DESCRIPTION = "Cross-platform robot device interface and server"
LICENSE = "GPLv2+ and LGPLv2+"
DEPENDS = "libtool jpeg"
PN = "player"
PV = 3.1.0
PR = "r0"
SRC_URI = "svn://;module=trunk;rev=HEAD;proto=https"

inherit pkgconfig

do_configure () {

do_compile() {


do_install() {

	oe_runmake install DESTDIR=${D}


FILES_${PN} = "/usr/bin/player \ 
	/usr/bin/playerinterfacegen \
	/usr/bin/playerxdrgen \ 
	/usr/include/* \ 
	/usr/lib/* \ 

The recipe above has several important sections.

  • DEPENDS = "" This recipe uses a very simple config of player that does not require any dependencies, if you wanted for example to add playerv, you would first turn the cMake variable for playerv to on( -DBUILD_UTILS_PLAYERV=ON) then you would add the relevant dependency (DEPENDS = "gtk+"). Read more in the OpenEmbedded Manual
  • PN Package Name. This name should reflect the name of the project being packaged.
  • PV Package Version. This is the version number of the project being built.
  • PR Package Revision number. Each time the package is rebuilt with the same PV (for example, a bugfix or security update), this revision is incremented.
  • inherit pkgconfig Very important Explanation
  • do_configure() Run configuration. In Player's case, CMake is the configuration system. Many other projects use autotools, etc. The above cmake options disable all of the optional components of Player, and install the server with no client library or drivers included. To add a driver, utility, or other option, just find the relevant CMake variable and change it (i.e. -DBUILD_SHARED_LIBS=ON or -DENABLE_DRIVER_BLOBTRACKER=ON)
  • do_compile() Runs "make." This is where BitBake compiles the project
  • do_install() Installs the targets to the ${D} (destination directory, which is a directory within your build environment)
  • FILES_${PN} Tells bitBake what files to package. If adding other utilities or clients, be sure to add the filenames to this section.

Building Player

Once the recipe is in the proper place, run the command "bitbake player" after setting up your build environment. BitBake should fire up and attempt to compile Player and its dependancies. If everything goes well, BitBake will let you know with a message saying it completed successfully.

Checking the logs

If you want to confirm that CMake is working correctly, and that there are no build errors, you can check the build logs. Each step (do_compile, do_configure) creates its own logfile that you can review. On the gumstix, assuming you followed the directions to set up the buildroot in ~/overo-oe, you can find the log files in ~/overo-oe/tmp/work/armv7a-angstrom-linux-gnueabi/<recipe name>/tmp/ For the BeagleBoard, if you checked out the buildroot in ~/OE, you can find the logs in ~/OE/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/<recipe name>/tmp/

Installing the Packages

To install the packages, copy the .ipk files generated by the build process to your embedded machine (either via SSH or directly to the memory card). Then, use the opkg command on the embedded machine to install the .ipk file.

Alternately, you can add Player to a system image. For example, the BeagleBoard environment has several images like "x11-image" and "basic-image". These are essentially bitbake files, and can be found in openembedded/recipes/images/. You can add player to the IMAGE_INSTALL section, and run "bitbake <imagename>" to create a system image with Player included.

To add Gearbox support to Player (i.e. for the hokuyo_aist driver), follow the Cross Compile Player with Gearbox guide.

Personal tools