ros / homebrew-hydro

Hydro packages and dependencies repository for Homebrew
2 stars 7 forks source link

can't install openni2_camera on Yosemite #26

Closed Napoleon-BlownApart closed 9 years ago

Napoleon-BlownApart commented 9 years ago

Trying to install ROS Hydro through Homebrew. Whilst resolving ROS dependencies, I received an error:

user@home:[ 6:55]:~/ros/hydro/ros_catkin_ws$ rosdep install --from-paths src --ignore-src --rosdistro hydro -y
ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
openni2_camera: No definition of [libopenni2-dev] for OS [osx]

After looking up Problem libOpenni2 for hydro installation with homebrew, I followed the suggestion to modify the openni2_camera CMakeLists.txt file. This didn't fix the problem, but I noticed the OP said they installed openni2. So I tried installing openni2 myself; but without success:

user@home:[ 7:32]:~$ brew install openni2
==> Installing openni2 from ros/homebrew-hydro
==> Downloading https://launchpad.net/~v-launchpad-jochen-sprickerhof-de/+archiv
Already downloaded: /Library/Caches/Homebrew/openni2-2.1.0.4.tar.gz
==> Downloading https://gist.github.com/NikolausDemmel/7901983/raw/3746869662473
######################################################################## 100.0%
==> Patching
patching file ThirdParty/GL/glh/glh_linear.h
==> make
#include <libusb-1.0/libusb.h>
         ^
1 error generated.
make[1]: *** [../Bin/Intermediate/x64-Release/libXnLib.a/XnLinuxUSB.o] Error 1
make: *** [ThirdParty/PSCommon/XnLib/Source] Error 2

READ THIS: http://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/ros/homebrew-hydro/issues

So, here I am....

Some background info about my setup:

  1. Since I have macports installed, and have a huge number of important packages installed through it, I moved my /opt/local/ folder to ~/macports. I cannot simply uninstall it by deleting everything.
  2. I have a number of dynamic & static libraries as well as header files in my /usr/local/lib and /usr/local/include folders that I also can't simply delete
  3. In my /opt/local/includes (which I moved to ~/macports as indicated above) I have the libusb-1.0 folder and the libusb.h header in it. The install failed before and after I moved the macports folder out.
  4. I am trying to install ROS onto my Retina MacBook Pro 2014 15" with Yosemite (10.10.2) installed.

Cheers, Nap

I can't resist making a comment about Macports and Homebrew. I am disappointed with their sloppy organisation. Both should be based in a folder named after their product, and of all the possible locations they could choose, both have made the worst choice possible. This is a man made problem, not a technical problem.

wjwwood commented 9 years ago

Looks like the formula for openni2 might be missing an implicit dependency on libusb. Having libusb in your ~/macports folder is not sufficient for the build of openni2 to find it. Can you try installing libusb first, then openni2? Like so:

$ brew install libusb
$ brew install openni2

If that works then I can modify the openni2 formula to have a dependency on libusb.


I would recommend using Macports or Homebrew, but not both. There are Macports instructions for ROS, but I don't use Macports, so I'm not familiar with the particulars or the state of those instructions.


Homebrew uses /usr/local/lib which is where "user built" libraries should go. I'm not sure why you feel you need to delete non Homebrew libraries and header files which are in /usr/local/{lib,include}, but it shouldn't be necessary. And on the other hand Macports puts all of their stuff in /opt which is safely off your path by default. So I'm not sure where you would have liked either of them to put things but they each take a different approach and both have their own merits and problems. I actually think that Homebrew is quite well organized, but I guess we'll have to disagree about that.

Napoleon-BlownApart commented 9 years ago

@wjwwood : Thank you sir. Perfect!! Back to solving the openni2_camera problem, its still complaining about libopenni2-dev, but I'm going to look further into the post I quoted above.

brew doctor was advising me to remove stuff. I understand it's not necessary, but having Homebrew use /usr/local rather than /usr/local/homebrew pollutes the folder. (The same goes for Macports in /opt/local instead of /opt/local/macports.)

Napoleon-BlownApart commented 9 years ago

@wjwwood Any chance of providing libopenni2-dev? That is what I'm missing now from the package.xml of openni2_camera

According to rosindex.github.io/d/libopenni2-dev/ , it is not available for OSX (any version).

I've modified the package.xml's build and run dependency to use openni2 instead. It still complained, but I've used the '-r' switch to continue with the rest of the install. I'll come back to this when its done.

wjwwood commented 9 years ago

It will be available after this is merged: https://github.com/ros/rosdistro/pull/7397 and you then do rosdep update.

wjwwood commented 9 years ago

Also, I guess that means installing libusb first worked?

wjwwood commented 9 years ago

I added it in anticipation of that being a yes: https://github.com/ros/homebrew-hydro/commit/471d40ceeba4f6ea46ecca50328b7b59e4637d38