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

How to compile openni_ros with SSE2 only support?

asked 2011-03-10 06:27:01 -0500

Pi Robot gravatar image

updated 2016-10-24 08:59:03 -0500

ngrennan gravatar image


I have the latest Debian Diamondback packages installed on an older laptop (Sony Vaio VGN-TX750P) which makes a nice light brain for an iRobot Create. I am having trouble getting a Kinect to work with the openni_ros stack. I understand the Debian packages are compiled for SSE3 support and this laptop has only SSE2. So I downloaded the openni_ros source from and ran a "rosmake --rosdep-install". The build completed without errors, but when trying to run "roslaunch openni_camera openni_node.launch" in debug mode, the node is dying with an "Illegal Instruction" error which I have come to learn usually means the package is still assuming SSE3 support.

Does anyone know how to tell the build process for openni_ros to only expect SSE2?

Thanks! patrick

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-03-10 06:42:51 -0500

Eric Perko gravatar image

You'll have to modify at least the CMakeLists.txt file in the openni_camera package.

See the line

add_definitions (-Wno-missing-field-initializers -O4 -DNDEBUG -mfpmath=sse -msse4 -fopenmp)

You'll have to remove at least the -msse4 flag (and replace it with -msse2? Not 100% sure about that).

Also... not sure what is up with -O4... Pretty sure it doesn't do anything more than -O3 (which is often advised against anyways as it contains sometimes unstable optimizations).

edit flag offensive delete link more


Brilliant! That did the trick. I used -msse2 instead of -msse4 and -O3 instead of -O4 and now openni_node.launch fires up perfectly. Many thanks!
Pi Robot gravatar image Pi Robot  ( 2011-03-10 08:57:54 -0500 )edit
Sounds nice, I'll try it out. Now, I've seen in $ROS_ROOT/core/rosbuild/public.cmake there is a HAS_SSE3_EXTENSIONS macro, which is being used in some packages. Why not use it in openni_camera as well? Same could go to PCL.
tom gravatar image tom  ( 2011-03-11 01:45:39 -0500 )edit
@tom: Probably just not being used. I suggest you file a bug ticket (after a quick check for any duplicate tickets) for any packages you find not using such macros (though I'm not sure if there is one to detect SSE4, which openni_camera is using). Something like could be useful.
Eric Perko gravatar image Eric Perko  ( 2011-03-11 07:43:30 -0500 )edit
I issued a new ticket #4870 for openni_camera in module ni (there is no openni_kinect module in Trac yet). Please check if my description is good enough and maybe correct/enhance it. Cheers.
tom gravatar image tom  ( 2011-03-14 21:40:12 -0500 )edit

answered 2011-11-07 22:42:41 -0500

Deby85 gravatar image

Hi everybody, I have the same problem described above, but I'm using ROS electric on Ubuntu 11.04. Checking flags on my system I found that it supports sse, sse2, ssse3 and when I try to use openni_launch with the command

rosrun image_view image_view image:=/camera/ir/raw

it returns the following error:

Illegal Instruction

I've looked for what suggested by Eric Perko into CMakeList of openni_launch package, but I haven't found it. Could somebody help me?

Thanks in advance,


edit flag offensive delete link more


See Updating your system to the most recent OpenCV package should solve this.
Patrick Mihelich gravatar image Patrick Mihelich  ( 2011-11-12 09:35:21 -0500 )edit

Question Tools



Asked: 2011-03-10 06:27:01 -0500

Seen: 1,165 times

Last updated: Nov 07 '11