Create MOOS-IvP Package
NOTE: This tutorial was written specifically for MOOS-IvP. MOOS is a requirement for MOOS-IvP, and as such will be covered here as well. Just keep this in mind.
NOTE: At the time of this writing (02/13/10), the latest release of MOOS-IvP (4.0.1) is not compatible with the recipes written here due to the lack of install rules. Chris Gagner graciously added these rules to trunk at revision 2490, so that's what we'll be using here (specifically, revision 2490).
NOTE: If you don't want to write your own recipe for MOOS and/or MOOS-IvP, the ones written by Kyle Fazzari are available via anonymous SVN checkout:
$ svn co https://svn.origo.ethz.ch/bitbake-recipes/moos recipes/moos
$ svn co https://svn.origo.ethz.ch/bitbake-recipes/moos-ivp recipes/moos-ivp
It's worth saying that the root of the SVN repository above (https://svn.origo.ethz.ch/bitbake-recipes) includes recipes other than MOOS and MOOS-IvP that are specific to another project. You're welcome to them if you so desire, but be forwarned that they may change at any time.
You must have the OpenEmbedded build environment. This tutorial is available.
Creating BitBake Recipes
-
Check out the trunk of MOOS-IvP:
$ svn co https://oceanai.mit.edu/svn/moos-ivp-aro/trunk/ ~/moos-ivp
-
Remove unneeded files:
You can save space by choosing a MOOS version and using it rather than how it appears upon checkout. Remove the symbolic link and simply rename the latest MOOS folder (in revision 2490 it's "MOOS-2300-Dec0309) to "MOOS".
At this point, remove everything else until all that remains are the following directories:
-
Remove .svn directories (no need to have these in the recipes):
$ cd ~/moos-ivp
$ find . -name ".svn" -exec rm -rf {} \;
-
Archive MOOS into a tarball:
$ cd ~/moos-ivp
$ tar cvf moos.tar MOOS/
-
Place the tarball just created into a directory tree with the following structure:
moos
|
---------> files
|
---------> moos.tar
-
Create a new file named moos_VERSION.bb. Since I assume the directory was named "MOOS-2300-Dec0309" because it was SVN revision 2300, mine is called moos_svn.2300.bb. Regardless, replace with your version and place it in the tree created above so the tree now looks like the following:
moos
|
---------> moos_VERSION.bb
---------> files
|
---------> moos.tar
-
Insert the following into moos_VERSION.bb (replacing with your version):
# Package name
PN = "moos"
# Package version
PV = "VERSION"
# Package release
PR = "r0"
# Package description
DESCRIPTION = "MOOS and associated programs"
# Run-time dependencies (+= so we retain any additions made outside this recipe)
RDEPENDS += "libstdc++"
# File location (inside "files" directory)
SRC_URI = "file://moos.tar"
# Inherit cmake so we don't need to explicitly write all the rules ourselves
inherit cmake
# Invokation flags to cmake (essentially taken from build-moos.sh supplied in the MOOS-IvP repository).
# Note that these may change depending on how you want MOOS installed. The images being used for our
# Gumstix don't include X, so no graphical tools are needed.
EXTRA_OECMAKE = "\
-DFLTK_DIR=/usr/lib \
-DFLTK_INCLUDE_DIR=/usr/include \
-DPYTHON_INCLUDE_PATH=/usr/include/python2.5 \
-DBUILD_CONTROL_AND_NAV=ON \
-DBUILD_INSTRUMENTS=ON \
-DDB_HAS_HTTP=ON \
-DBUILD_TOOLS=ON \
-DBUILD_OCEAN_SIM=ON \
-DBUILD_NAVIGATION=OFF \
-DBUILD_HELM=OFF \
-DBUILD_NEWMAT=OFF \
-DBUILD_GRAPHICAL_TOOLS=OFF \
-DBUILD_MATLAB_TOOLS=OFF \
-DMATLAB_DIR= \
-DBUILD_LAND_INSTRUMENTS=OFF \
-DBUILD_OCEAN_INSTRUMENTS=OFF \
-DBUILD_UMVS=ON \
-DBUILD_UPB=ON \
-DCMAKE_CXX_FLAGS=-fPIC \
"
# Tell cmake where to work (since we tarballed MOOS, cmake needs to work inside that directory)
OECMAKE_SOURCEPATH = "${WORKDIR}/MOOS"
-
You have now finished with the MOOS recipe.
-
Fix code issue on which the OpenEmbedded cross-compiler toolchain chokes:
Thanks to the help supplied by Chris Gagner, it was discovered that the OE cross-compiler toolchain has a problem with MOOS-IvP's lib_geometry's XYSegList class; namely the fact that add_vertex(double, double, double) is an inline function. Thankfully it's an easy fix: remove the "inline" keyword from the function definition in moos-ivp/ivp/src/lib_geometry/XYSegList.cpp.
-
Archive the contents of the moos-ivp directory into a tarball:
$ cd ~/moos-ivp
$ tar cvf moos-ivp.tar *
-
Place the tarball just created into a directory tree with the following structure:
moos-ivp
|
---------> files
|
---------> moos-ivp.tar
-
Create a new file named moos-ivp_VERSION.bb. So if we were actually using release 4.0.1, this file would be named moos-ivp_4.0.1.bb. As it is, mine is called moos-ivp_svn.2490.bb. Regardless, replace with your version and place it in the tree created above so the tree now looks like the following:
moos-ivp
|
---------> moos-ivp_VERSION.bb
---------> files
|
---------> moos-ivp.tar
-
Insert the following into moos_VERSION.bb (replacing with your version):
# Package name
PN = "moos-ivp"
# Package version
PV = "VERSION"
# Package release
PR = "r0"
# Package description
DESCRIPTION = "pHelmIvP and associated programs"
# Build-time dependencies (+= so we retain any additions made outside this recipe)
DEPENDS += "moos"
# Run-time dependencies (+= so we retain any additions made outside this recipe)
RDEPENDS += "libstdc++"
# File location (inside "files" directory)
SRC_URI = "file://moos-ivp.tar"
# Inherit cmake so we don't need to explicitly write all the rules ourselves
inherit cmake
# Invokation flags to cmake (essentially taken from build-ivp.sh supplied in the MOOS-IvP repository).
# Note that these may change depending on how you want MOOS-IvP installed. The images being used for our
# Gumstix don't include X, so no graphical tools are needed.
EXTRA_OECMAKE = "\
-DIVP_BUILD_GUI_CODE=OFF \
-DIVP_LIB_DIRECTORY="${WORKDIR}/lib" \
-DIVP_BIN_DIRECTORY="${WORKDIR}/bin" \
"
# Tell cmake where to work
OECMAKE_SOURCEPATH = "${WORKDIR}/ivp/src"
-
You have now finished with the MOOS-IvP recipe.
During the course of this tutorial you created two new directory trees: moos (in the moos section, step 2) and moos-ivp (in the moos-ivp section, step 3). Both of these directories need to be placed where BitBake will find them, and the recommended location is (if you followed the tutorial linked in the Prerequisite section) ~/overo-oe/user.collection/recipes/, so the final tree would look something like:
overo-oe
|
---------> org.openembedded.dev
---------> user.collection
|
---------> recipes
|
---------> moos
|
---------> moos_VERSION.bb
---------> files
|
---------> moos.tar
---------> moos-ivp
|
---------> moos-ivp_VERSION.bb
---------> files
|
---------> moos-ivp.tar
Building Recipes Into Packages
If you did the above steps correctly, BitBake can now find your new recipes. For instance, if you were to issue the command
$ bitbake moos
MOOS would be built into a .ipk package for the opkg package manager on the Gumstix. You could also include it on image builds so that it would be on the Gumstix by default if programmed with your image.
Also, if you were to issue the command
$ bitbake moos-ivp
Both MOOS and MOOS-IvP would be built into .ipk packages (since MOOS-IvP depends on MOOS) for the opkg package manager on the Gumstix. Again, you could also include it on image builds so that it would be on the Gumstix by default if programmed with your image.
|