Ask Your Question
1

Problem libOpenni2 for hydro installation with homebrew

asked 2015-01-19 04:59:47 -0500

kpax77 gravatar image

updated 2015-08-11 11:11:48 -0500

130s gravatar image

Hi everybody,

I try to install ROS Hydro on my mac with homebrew following this tutorial http://wiki.ros.org/hydro/Installatio... And I face a problem. For the installation of openni2_camera, I have the following error.

-- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.28")
-- checking for module 'libopenni2'
--   package 'libopenni2' not found
CMake Error at /opt/local/share/cmake-3.0/Modules/FindPkgConfig.cmake:341 (message):
  A required package was not found
Call Stack (most recent call first):
  /opt/local/share/cmake-3.0/Modules/FindPkgConfig.cmake:395 (_pkg_check_modules_internal)
  CMakeLists.txt:9 (pkg_check_modules)


-- Configuring incomplete, errors occurred!

Of course I installed openni2 via hombrew but it seems like it doesn't create any libopenni2.pc which is a problem.

Any ideas about it ?

Thank you.

UPDATE

This is the result of brew info openni2

openni2: stable 2.2.0.33, HEAD
http://structure.io/openni
/usr/local/Cellar/openni2/2.2.0.33 (149 files, 6,8M) *
  Built from source
From: https://github.com/homebrew/homebrew-science/blob/master/openni2.rb
==> Dependencies
Required: libusb ✔
==> Options
--universal
    Build a universal binary
--with-docs
    Build documentation using javadoc (might fail with Java 1.8)
--HEAD
    Install HEAD version
==> Caveats
Add the recommended variables to your dotfiles.
 * On Bash, add them to `~/.bash_profile`.
 * On Zsh, add them to `~/.zprofile` instead.

export OPENNI2_INCLUDE=/usr/local/include/ni2
export OPENNI2_REDIST=/usr/local/lib/ni2
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2015-01-19 23:02:29 -0500

updated 2015-01-21 03:33:45 -0500

Hi there,

The Hydro version of openni2_camera does not handle well libopenni2 on mac. You should edit the file openni2_camera/CMakeLists.txt and change this line:

pkg_check_modules(PC_OPENNI2 REQUIRED libopenni2)

for this:

pkg_check_modules(PC_OPENNI2 libopenni2)
if (NOT PC_OPENNI2_FOUND)
  pkg_check_modules(PC_OPENNI2 REQUIRED openni2)
endif()

(This patch is already present on Indigo)

UPDATE

According to the result of brew info openni2, could you try to add the following two lines to your ~/.bash_profile file

export OPENNI2_INCLUDE=/usr/local/include/ni2
export OPENNI2_REDIST=/usr/local/lib/ni2

then restart your terminal. If it doesn't work try uninstalling openni2 (you currently installed it from the formula https://github.com/homebrew/homebrew-... ) and try installing it again, but this time using the formula at https://github.com/ros/homebrew-deps/... .

edit flag offensive delete link more

Comments

Thank you. I did it and I have the same problem now it doesn't find openni2.

kpax77 gravatar image kpax77  ( 2015-01-20 04:30:37 -0500 )edit

Can you post the result of the command "brew info openni2"?

Martin Peris gravatar image Martin Peris  ( 2015-01-20 19:28:56 -0500 )edit

Now it almost compiled everything but it doesn't find the linux/usbdevice_fs.h:

/Users/skynet/ros_catkin_ws/src/openni2_camera/src/usb_reset.c:40:10: fatal error: 'linux/usbdevice_fs.h' file not found #include <linux usbdevice_fs.h=""> ^ 1 error generated.

kpax77 gravatar image kpax77  ( 2015-01-21 10:16:08 -0500 )edit

This worked for Indigo installation on my OSX 10.10 too. Key for me was restarting the terminal after doing export OPENNI2_*.

130s gravatar image 130s  ( 2015-08-11 11:22:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-01-19 04:59:47 -0500

Seen: 1,305 times

Last updated: Aug 11 '15