Archive for December, 2009

Player/Stage/Cold Leopards

December 16th, 2009

So, guess what, a blog post that’s not only useful, but totally not to do with VCS!  And you didn’t think it was possible…

Instead, today we’ll be installing the Player/Stage robotics server and simulation platform on MacOS 10.6.2 Snow Leopard.

Player

Use macports to install the basic tools of the trade; cmake and pkgconfig.  Don’t use it to install libtool, make sure you’re using the version supplied with the XCode tools (use “which libtool” to verify this.

Unpack the player source (I used 3.0.1), make a “build” subdirectory, change to it and run
export CXXFLAGS="-arch x86_64"
cmake ../
ccmake ../

In the ccmake menu, set “CMAKE_OSX_ARCHITECTURES” to “x86_64″.  Player doesn’t seem to automatically install to the SDK so either you can install it to, eg, “/usr” and copy it to the SDK later or just set the install path to the SDK path with “usr” tacked on the end.

If any of the later stages fail, you might find you need to disable the python bindings as well.

Press ‘c’ to configure and ‘g’ to generate.  If ‘g’ doesn’t come up immediately, keep pressing ‘c’ until it does (or until it gives a sensible error).  For some reason it doesn’t always work first time.

Once done,
make
sudo make install

If you’ve installed to your SDK then move on, otherwise
sudo cp /usr/lib/libplayer* <SDK DIR>/usr

Stage

I’ve heard tell that macports can install a 64-bit version of FLTK for you.  If that works in your case, go for it.  For myself, I had to compile FLTK manually.  The only version I can get to compile on 10.6.2 is the SVN snapshot of the 1.3.x branch.  2.0.x won’t work, neither do earlier versions from the 1.y branch.

Unpack that and
./configure --prefix=<your favorite prefix>
make
sudo make install

I found I had to change src/fl_draw_pixmap.cxx::339 to add an explicit cast, from:
U32* colors = d.byte1[*p++];
to
U32* colors = (U32*)d.byte1[*p++];
Once again, if you didn’t use your SDK as your prefix,
sudo cp /usr/lib/libfltk* <SDK PATH>/usr
Now Stage is ready to be built.  Make sure CXXFLAGS is still set to force a 64-bit build (otherwise just export it again), unpack Stage, make a build subdir, change to it and run
cmake ../
ccmake ../

Once again, set architecture and install paths, configure, generate and exit.  If the configuration doesn’t find the player installation, make sure that PKG_CONFIG_PATH includes the player installation location’s pkgconfig dir; eg if you installed to /usr, make sure PKG_CONFIG_PATH includes /usr/lib/pkgconfig.

Once Stage configuration is complete,
make
sudo make install

For some reason, Stage doesn’t give the player plugin the right name.  If running Player fails having not found the libstageplugin, you’ll need to
sudo ln -s /usr/lib/stageplugin.so /usr/lib/libstageplugin.so
(assuming you installed to /usr/lib)

You should be good!  Well, worked for me, YMMV.

G’luck :-)

Posted in Uncategorized | Comments (0)