Ask Your Question
2

OpenNI compilation error, Diamondback, version mobile, ARM

asked Feb 22 '11

tom gravatar image tom flag of Poland
849 5 27 51

updated Jul 08 '11

Martin Günther gravatar image Martin Günther flag of Germany
2928 17 39 63
http://www.inf.uos.de/mgu...

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.

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
2

answered Feb 22 '11

tfoote gravatar image tfoote flag of United States
11130 27 85 172
http://www.ros.org/

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
link delete flag offensive edit

Comments

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 (Feb 22 '11)edit
You're right you may need to change the sed lines in the openni/Makefile after turning off the -msse2 export tfoote (Feb 22 '11)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 (Feb 23 '11)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 (Feb 24 '11)edit
0

answered Feb 25 '11

tom gravatar image tom flag of Poland
849 5 27 51

updated Feb 25 '11

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.

link delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: Feb 22 '11

Seen: 737 times

Last updated: Feb 25 '11