ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

OpenNI compilation error, Diamondback, version mobile, ARM

asked 2011-02-22 02:01:24 -0500

tom gravatar image

updated 2016-10-24 09:03:23 -0500

ngrennan gravatar image

Hi,

I'm trying to build the openNI stack on BeagleBoard-xM (ARM). I have Ubuntu 10.04 and installed Diamondback variant mobile before, roscore runs fine. As I wanted to add Kinect support I proceeded as described here, with the only difference, I cloned the git source into my ros folder instead of using rosinstall (and updated ROS_PACKAGE_PATH accordingly, the same worked fine for me yesterday on my desktop PC, x386). But when I run rosmake ni --rosdep-install I'm getting the following error:

[rosmake-0] Starting >>> openni [ make ]                                        
[ rosmake ] All 26 linespenni: 7.5 sec ]             [ 1 Active 25/61 Complete ]
{-------------------------------------------------------------------------------
  ### Patching the main Makefile for OpenNI...
  /home/user/ros_mobile/ni/openni
  ### Patching the output library for OpenNI...
  /home/user/ros_mobile/ni/openni
  ### Patching the output library for all library Modules...
  /home/user/ros_mobile/ni/openni
  ### Patching the output location for all samples...
  /home/user/ros_mobile/ni/openni
  ### Patching the output location for all tools...
  /home/user/ros_mobile/ni/openni
  ### Patching the location of modules.xml...
  /home/user/ros_mobile/ni/openni
  ### Patching the location of SamplesConfig.xml...
  /home/user/ros_mobile/ni/openni
  cd build/openni/Platform/Linux-x86/Build && make core samples && cd -
  make[1]: Entering directory `/home/user/ros_mobile/ni/openni/build/openni/Platform/Linux-x86/Build'
  make -C OpenNI 
  make[2]: Entering directory `/home/user/ros_mobile/ni/openni/build/openni/Platform/Linux-x86/Build/OpenNI'
  g++ -MD -MP -MT "./lib/openNI.d lib/openNI.o" -c -O3 -msse2 -malign-double -fPIC -fvisibility=hidden -I../../../../Include -I../../../../Source -I../../../../Source/External/TinyXml -DXN_EXPORTS -o lib/openNI.o ../../../../Source/OpenNI/openNI.cpp
  cc1plus: error: unrecognized command line option "-msse2"
  cc1plus: error: unrecognized command line option "-malign-double"
  make[2]: *** [lib/openNI.o] Error 1
  make[2]: Leaving directory `/home/user/ros_mobile/ni/openni/build/openni/Platform/Linux-x86/Build/OpenNI'
  make[1]: *** [OpenNI] Error 2
  make[1]: Leaving directory `/home/user/ros_mobile/ni/openni/build/openni/Platform/Linux-x86/Build'
-------------------------------------------------------------------------------}

The first thing I noticed is the assumption there I'm using a x386 platform (where does it come from?), but then again, it's just a folder name. g++ --version returns:

g++ --version
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3

EDIT: I suppose removing those flags -msse2 and -malign-double could help, but I don't know how to do it. Those, AFAIK, are not available on all platforms.

I hope someone can help, Tom.

edit retag flag offensive close merge delete

Comments

2

The Beagle Board compiler doesn't have sse acceleration nor the -malign-double option. Unfortunately these are currently hard coded into the openni package. You can comment these lines in openni/include/ni/CommonMakefile to get it to compile. CFLAGS += -malign-double CFLAGS += -msse2

tfoote gravatar image tfoote  ( 2011-02-22 03:37:39 -0500 )edit
Thanks for the hint Tully. Is changing this in one file enough? grep -rl -e LDFLAGS+= -e CFLAGS+= -e mmse -e malign-double ~/ros/ni/* returns many occurences, some of those -msse2 flags are hard coded, not defined as part of the $CFLAGS variable. I'll try my best and let know.
tom gravatar image tom  ( 2011-02-22 04:53:53 -0500 )edit
You're right you may need to change the sed lines in the openni/Makefile after turning off the -msse2 export
tfoote gravatar image tfoote  ( 2011-02-22 05:14:52 -0500 )edit
I had the same problem when I tried to install openni on an ARM system. If you do end up removing all of those flags and it works, I'd be interested in exactly what your changes were.
Eric Perko gravatar image Eric Perko  ( 2011-02-22 18:35:09 -0500 )edit
Getting rid of those flags in multiple (around 15) Makefiles worked fine. I'll post an info if I manage to build the whole ni stack on the ARM board.
tom gravatar image tom  ( 2011-02-23 19:44:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-02-24 21:09:27 -0500

tom gravatar image

updated 2011-02-24 21:11:46 -0500

I promised to let know what the necessary changes were to be able to build openNi on an ARM based board, so here it is. My solution is still pretty dirty and I haven't documented it yet. I'll write everything down exactly when I come to building a toolchain and cross-compiling, hopefully some one at Willow Garage can assist me in working out a clean, systematic solution (or can simply produce one :) ).

Basically what I did was:

  1. Run grep -rl -e LDFLAGS+= -e CFLAGS+= -e mmse -e malign-double ~/ros/ni/* (or the folder where the ni stack is installed. You'll have to delete all mmse[2-3] and malign-double occurences in the Makefiles. I ended up editing around 15 files, or so. But probably, as I am a noob in the world of ROS, someone fit with ROS build can find a quicker solution (like I don't remember executing make clean before executing grep, lame, I know)
  2. Downloaded and installed hdf5 debian packages from PPA (https://launchpad.net/ubuntu/+source/hdf5/1.8.4-patch1-2ubuntu3/+buildjob/2266122)
  3. Installed gcc-4.5 and g++-4.5 from PPA to get rid of a nasty compiler error. The logger library inside flann uses va_lists and this bug crashes the installation otherwise.

I guess that's all. Hope it helps.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-02-22 02:01:24 -0500

Seen: 2,065 times

Last updated: Feb 24 '11