Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 727fa15453fcace956b835e2377d4269 > files > 815

player-doc-3.0.2-5.fc14.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html>
<!-- $Id: header.html 8799 2010-06-28 04:12:42Z jpgr87 $ -->

<HEAD>


<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=utf-8">
<meta name="keywords" content="stage, robot, simulation, player, player/stage">
<link href="doxygen.css" rel="stylesheet" type="text/css">

<style type="text/css">

.floatright { float: right; margin: 0 0 1em 1em; }

body {
  font-family: sans-serif;
  #font-family: Geneva, Verdana, Helvetica, Arial, sans-serif;
  background-color: #FFF;
  color:#000;
}


a:link { 
	color: #A00;
}

a:visited { 
	color: #800;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }


.timestamp { text-align:right; background-color: #DDD; font-size:75%;}

h1 { 
  font-size:160%; 
}

h2 {
  font-size:110%;
  #color: #FFF;
  #background-color: #666;
  #padding:3px;
}

h3 { text-align:left; }

img {
  border: 0;
}

ul.menu { 
    position:relative;
    left:-2.5em;
    margin-bottom:0px;
    margin-top:0px;
}

ul.menu1 { 
    position:relative;
    left:-2.1em;
    margin-bottom:0px;
    margin-top:0px;
}

li.menu { 
    list-style-type: none;
    position:relative;
    #left:-0.5em;
}


#sidebar { position: absolute; left:0px; padding:2em; top:0em; width:12em;}

#content { position: absolute; left:12em; top:0em; padding-left:3em; padding-right:3em; padding-bottom:2em; margin-top:1em; margin-right:2em; }

div.box { background-color:#EEE; border: 1px solid #000; padding: 0.5ex 0.4em 0.5ex 0.6em; margin:1em;  }
div.title { font-weight:bold; background-color:#eee; margin-bottom:2px;}

div.topbar { position: absolute; top:0px; left:9em; margin:1em; }

</style>

<TITLE>Player Manual</TITLE>

</HEAD>

<body>

<div id="sidebar"> 

<h2 style="text-align:center;">
<a href="index.html">
<img width=140 src="http://playerstage.sourceforge.net/images/player_button_v3.png" alt="Player logo"><br></a>
</h2>



<div class="box">
<div class=title>Player</div>

<ul class=menu>
<li class=menu><a href="index.html">Frontpage</a>
<li class=menu><a href="modules.html">Contents</a>
</ul>
</div>

<div class="box">
<div class=title>User</div>

<ul class=menu>
<li class=menu><a href="install.html">Installation</a>
<li class=menu><a href="start.html">Quick start</a>
<li class=menu><a href="supported_hardware.html">Supported&nbsp;devices</a>
<li class=menu><a href="group__tutorials.html">Tutorials</a>
<li class=menu><a href="group__utils.html">Utilities</a>
<li class=menu><a href="group__clientlibs.html">Client&nbsp;libraries</a>
<li class=menu><a href="http://playerstage.sourceforge.net/wiki/Basic_FAQ">FAQ</a>
<li class=menu><a href="help.html">Help</a>

</ul>
</div>

<div class=box>
<div class="title">Developer</div>
<ul class=menu>
<li class=menu><a href="architecture.html">Architecture</a>
<li class=menu><a href="group__libplayercore.html">libplayercore</a>
<ul class=menu1>
<li class=menu><a href="group__interfaces.html">interfaces</a></li>
</ul>
<li class=menu><a href="group__libplayerdrivers.html">libplayerdrivers</a>
<ul class=menu1>
<li class=menu><a href="group__drivers.html">drivers</a></li>
</ul>
<li class=menu><a href="group__libplayercommon.html">libplayercommon</a>
<li class=menu><a href="group__libplayerutils.html">libplayerutils</a>
<li class=menu><a href="group__libplayersd.html">libplayersd</a>
<li class=menu><a href="group__libplayertcp.html">libplayertcp</a>
<li class=menu><a href="group__libplayerxdr.html">libplayerxdr</a>
<li class=menu><a href="todo.html">TODO</a>
</ul>
</div>

<div class=box>
<!-- <a href="http://sourceforge.net"><img border=0 src="http://sourceforge.net/sflogo.php?group_id=42445&type=1"></a> -->
<div class="title">Online</div>
<a href="http://playerstage.sourceforge.net">Homepage</a><br>
<a href="http://sourceforge.net/project/showfiles.php?group_id=42445">Download</a><br>
<a href="http://sourceforge.net/projects/playerstage">Project</a><br>
<a href="http://sourceforge.net/tracker/?group_id=42445">Bugs</a><br>
<a href="http://sourceforge.net/mail/?group_id=42445">Help</a>
</div>


</div>

<div id="content" >
<!-- Generated by Doxygen 1.7.1 -->
<div class="header">
  <div class="headertitle">
<h1>Cross-compiling<br/>
<small>
[<a class="el" href="group__tutorials.html">Tutorials</a>]</small>
</h1>  </div>
</div>
<div class="contents">

<p>How to build Player for embedded systems.  
<a href="#_details">More...</a></p>
<table class="memberdecls">
</table>
<p>How to build Player for embedded systems. </p>
<h2><a class="anchor" id="Introduction"></a>
Introduction</h2>
<p>While Player is most often used on laptop- or workstation-class machines, it is also intended to run on less powerful embedded systems. Over the years, Player has been used on a variety of such systems, including the iPaq, Intel Stayton, nanoEngine, and Gumstix. These systems are not powerful enough to run a compiler, and they generally have a different architecture from your desktop machine (e.g., ARM instead of x86), which means that you need to <em>cross-compile</em> programs to run on them.</p>
<p>This document gives some guidance to help in cross-compiling Player. Beware that cross-compiling is fairly complicated, and that the information given here is by no means a complete treatment of the subject.</p>
<h2><a class="anchor" id="anexample"></a>
An example to work with</h2>
<p>When cross-compiling, the <em>build</em> system is the one where the compiling is happening, and the <em>host</em> system is the one where the compiled program will eventually run. Throughout this document, we'll assume that you your build system is <b>x86-linux</b> (e.g., a Linux workstation or laptop) and that your host system is <b>arm-linux</b> (e.g., a Gumstix). This is probably the most common setup. If your situation is different, then just mentally translate the system-specific names used below.</p>
<h2><a class="anchor" id="Prerequisites"></a>
Prerequisites</h2>
<p>First, you need an x86-linux to arm-linux <em>toolchain</em>. There are a variety of ways to get a toolchain, including building it yourself from scratch. Unless you're looking to grow hair on your chest, I suggest getting a pre-built toolchain.</p>
<p>The toolchain <b>must include C++ support</b>, since much of Player is written in C++.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>(Gumstix): In <code>gumstix-buildroot/Makefile</code>, set <code>INSTALL_LIBSTDCPP:=true</code>.</dd></dl>
<p>Player uses XDR for data marshaling, so the toolchain also must have a full RPC implementation that includes all the xdr_*() functions, in particular xdr_float() and xdr_double().</p>
<dl class="note"><dt><b>Note:</b></dt><dd>(uClibc): Set <code>UCLIBC_HAS_FULL_RPC=y</code> in the uClibc .config file.</dd>
<dd>
(Gumstix): To effect the above change, set <code>UCLIBC_HAS_FULL_RPC=y</code> in <code>gumstix-buildroot/uClibc.config</code>.</dd></dl>
<p>Your toolchain will have a <code>bin</code> directory where the cross-compiling executable tools, such as <b>arm-linux-gcc</b> and <b>arm-linux-ld</b> reside. Add this directory to your PATH.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>(Gumstix) : These tools are in <code>gumstix-buildroot/build_arm_nofpu/staging_dir/bin</code>.</dd></dl>
<h2><a class="anchor" id="Configuration"></a>
Configuration</h2>
<p>We'll use the builtin autotools support for cross-compilation. Basic configuration of Player goes like this: </p>
<div class="fragment"><pre class="fragment">$ ./configure --build=x86-linux --host=arm-linux
</pre></div><p> The configure script will automatically look for the <b>arm-linux-</b> tools, which should already be in your PATH.</p>
<p>The above configuration will build the default configuration of Player, which means that all drivers that can be built will be included. If you're looking to minimize the footprint of Player for your embedded system, you can enable just the drivers you'll need. For example, when I build Player to control a Roomba that is equipped with a Hokuyo URG laser, I configure it like so: </p>
<div class="fragment"><pre class="fragment">$ ./configure --build=x86-linux --host=arm-linux --disable-alldrivers --enable-roomba --enable-urglaser
</pre></div><p> Then only the <a class="el" href="group__driver__roomba.html">roomba</a> and driver_urglaser drivers will be included. If you're only using your own plugin drivers, then you wouldn't need to --enable any drivers at all.</p>
<p>The default configuration also uses shared libraries if possible. This can complicate transferring Player to the embedded system because you have to copy a bunch of supporting files. I usually disable shared library support: </p>
<div class="fragment"><pre class="fragment">$ ./configure --build=x86-linux --host=arm-linux --disable-shared --disable-alldrivers --enable-roomba --enable-urglaser
</pre></div><p> Then I get a <b>player</b> binary that is statically linked and self-contained.</p>
<h2><a class="anchor" id="Compilation"></a>
Compilation</h2>
<p>Assuming configuration went well, all you need to do is: </p>
<div class="fragment"><pre class="fragment">$ make
</pre></div><p> One final step to save space is to strip the symbol/debug information out of the binary: </p>
<div class="fragment"><pre class="fragment">$ arm-linux-strip server/player
</pre></div><p> Then you're done: scp the binary to the embedded system and start playing with it. </p>
</div>
<!-- render the modification time of the source file -->


<div class="timestamp">
<hr>

<table style="width:100%;">
<tr>
<td style="text-align:left;">
Last updated 12 September 2005 21:38:45
<!--
<td style="text-align:right;">
<a href="http://validator.w3.org/check/referer"><img style="vertical-align:middle;border:0;width:88px;height:31px"
          src="http://www.w3.org/Icons/valid-html401"
          alt="Valid HTML 4.01!"></a>

 <a href="http://jigsaw.w3.org/css-validator/">
  <img style="vertical-align:middle;border:0;width:88px;height:31px"
       src="http://jigsaw.w3.org/css-validator/images/vcss"
       alt="Valid CSS!">
 </a>
-->
</tr>
</table>
</div>


</tr>
</table>

</BODY>
</HTML>