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

Openni rosmake failing on OSX

asked 2011-03-05 10:26:19 -0500

Eponymous gravatar image

updated 2011-03-05 18:40:41 -0500

tfoote gravatar image

Edited to add: I see that I need to install the original branch of ni, not the master, so I've done that now. MacPorts won't install libusb-devel for me, so that's the latest problem.

OS X 10.6.6 Snow Leopard. openni from as in the wiki.

rosmake --pre-clean openni --rosdep-install

This results in an error (I've replaced the actual path with ~):

[ rosmake ] rosdep successfully installed all system dependencies                                                                                                                  
[rosmake-0] Starting >>> openni [ make clean ]                                                                                                                                     
[rosmake-0] Finished <<< openni [PASS] [ 0.06 seconds ]                                                                                                                            
[ rosmake ] Starting >>> tools/rospack                                                                                                                                             
[ rosmake ] Finished <<< tools/rospack                                                                                                                                             
[rosmake-0] Starting >>> openni [ make ]                                                                                                                                           
[ rosmake ] All 19 linespenni: 0.7 sec ]                                                                                                                  [ 1 Active 0/1 Complete ]
  ### Patching the main Makefile for OpenNI...
  ### Patching the output library for OpenNI...
  ### Patching the output library for all library Modules...
  ### Patching the output location for all samples...
  ### Patching the output location for all tools...
  ### Patching the location of modules.xml...
  ### Patching the location of SamplesConfig.xml...
  cd build/openni/Platform/Linux-x86/Build && make core samples && cd -
  make -C OpenNI 
  make[2]: *** libnCFLAGS+=-O3: Is a directory.  Stop.
  make[1]: *** [OpenNI] Error 2

Some troubleshooting: Obviously something is not being escaped properly and the wrong things are being interpreted as directory names. I find two cases where libnCFLAGS+=-O3 and also -msse2nBIN_DIR= are being created as subdirs within ~/ros/ni/openni/build/openni/Platform/Linux-x86/Build/OpenNI/:

  1. pre—clean (which also generates similar errors as above)
  2. the last cited command in the error output: cd build/openni/Platform/Linux-x86/Build && make core samples && cd -

In both cases the -msse... dir also replicates the path /User/username/ros/ni/openni/

This gets beyond my capabilities, but it looks to me like make is having the problem in both cases. Any help?

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted

answered 2011-03-06 12:39:58 -0500

Nick gravatar image

updated 2011-03-06 12:41:40 -0500

This looks like a problem that has historically been common with ros & openni.

The problem is that OSX sed works very differntly from ubuntu sed. The former is the BSD sed flavor, the latter is the GNU sed flavor. In BSD sed, there is basically no way to encode an "endline" (\n) character. In BSD sed, \n means "literally an n" which is why you get all of these weird n characters everywhere.

The solution is to install gsed (gnu sed) using macports (sudo port install gsed), and then to set a SED_EXE variable in all of the bash patch scripts. It can be set to sed by default, but on darwin platforms should be set to gsed.

Then do a global replace in the script from sed to $SED_EXE or something like that.

Finally, once you have patched the patches, send your patch to the good folks at WG, so it helps the rest of us =)

edit flag offensive delete link more


Nick, Many thanks for the reply. I will take a shot at what you suggest. (PS This "comment" format I am now using is woefully inadequate for this forum.)
Eponymous gravatar image Eponymous  ( 2011-03-06 14:04:25 -0500 )edit
Sure, good luck and let me know if you have difficulties.
Nick gravatar image Nick  ( 2011-03-06 15:11:42 -0500 )edit

answered 2011-07-06 03:39:37 -0500

stevefturner gravatar image

Replacing sed with GSed in OSX 10.6 appears to work for me in getting compilation going. I also had to execute: sudo port install libusb-devel +universal otherwise linking fails.

edit flag offensive delete link more

answered 2011-03-23 18:29:47 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

hi, Eponymous, did you make the kinect demo work on OSX? I am trying pretty much the same thing without any luck figuring out the openni compile failure...... Have you solve this problem?

edit flag offensive delete link more


No, because the ni stack is deprecated now, so I'm waiting on the openni_kinect gang to get it going on OS X. I saw somewhere that that might be out later this month or April. Sorry.
Eponymous gravatar image Eponymous  ( 2011-03-24 02:37:02 -0500 )edit

Question Tools


Asked: 2011-03-05 10:26:19 -0500

Seen: 354 times

Last updated: Jul 06 '11