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

Failed to process package 'opencv2'

asked 2014-05-31 08:18:04 -0600

lockandfire gravatar image

updated 2014-07-22 19:32:32 -0600

demmeln gravatar image

Dear All,

I am trying to install ROS hydro to mac os x 10.9.3 mavericks using desktop-install configuration. I am following the instructions of Homebrew.

Package dependences were resolved successfully. I used

sudo ./src/catkin/bin/catkin_make_isolated --install-space /opt/ros/hydro --install -DCMAKE_BUILD_TYPE=Release

to put files to the same place as Ubuntu, the one I am using on another PC. However, I met this message and failed:

make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_cocoa.mm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /System/Library/Frameworks/QTKit.framework/Headers/QTKit.h:51:0,
                 from /Users/Altrouge/ros_catkin_ws/src/opencv2/modules/highgui/src/cap_qtkit.mm:34:
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:123:46: error: expected ')' before '(' token
 - (void)modernizeWithCompletionHandler:(void (^)(void))handler AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
                                              ^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:123:46: error: expected identifier before '(' token
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:123:46: error: expected ';' before '(' token
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:156:18: error: unknown property attribute before ',' token
 @property (atomic, readonly) NSError *                      error                   AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
                  ^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:156:18: error: expected ')' before ',' token
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:156:1: note: 'assign' can be unsafe for Objective-C objects; please state explicitly if you need it
 @property (atomic, readonly) NSError *                      error                   AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
 ^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:162:18: error: unknown property attribute before ',' token
 @property (atomic, assign) QTMovieModernizerStatus          status                   AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
                  ^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:162:18: error: expected ')' before ',' token
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qtkit.mm.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX shared library ../../lib/libopencv_photo.dylib
[ 55%] Built target opencv_photo
make: *** [all] Error 2
<== Failed to process package 'opencv2': 
  Command '/opt/ros/hydro/env.sh make -j4 -l4' returned non-zero exit status 2

Reproduce this error by running:
==> cd /Users/Altrouge/ros_catkin_ws/build_isolated/opencv2 && /opt/ros/hydro/env.sh make -j4 -l4

Command failed, exiting.

I am wondering which part is wrong. Thank you.

edit retag flag offensive close merge delete

Comments

Hello. After lots of googles, I found there are two ways to solve the problem. 1. downgrade opencv and gcc by brew <--- tested, problem remained. 2. use clang to compile opencv <---- not tested yet. The building command is automatic. How can I specify cmake just for this package? Thanks

lockandfire gravatar image lockandfire  ( 2014-06-01 21:38:08 -0600 )edit

I am facing the same problem. I disabled QTKit in the CMakeLists.txt but it doesn't solve the problem. Did you find a solution?

WafaJ gravatar image WafaJ  ( 2014-06-03 12:19:45 -0600 )edit

Not yet. I find some info that might be useful but do not know how to modify CMakeList.txt: 'The issue is that .... is an Objective-C 2 construct and is compiled as Objective-C++. ... You'll have to try the clang compiler. '

lockandfire gravatar image lockandfire  ( 2014-06-04 10:44:50 -0600 )edit

I finally buit opencv by doing $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ Now having a problem to build orocos_kdl

WafaJ gravatar image WafaJ  ( 2014-06-04 15:11:45 -0600 )edit

Thank you! Although I still have this problem ... btw will this change the building environment of the whole ros packages or just that of opencv2 ?

lockandfire gravatar image lockandfire  ( 2014-06-04 23:20:56 -0600 )edit

Did you guys find an answer for this? Might be helpful for people like me

goshawk gravatar image goshawk  ( 2014-07-09 10:29:31 -0600 )edit

I succeed by setting $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ and use $ sudo ./src/catkin/bin/catkin_make_isolated --install-space /opt/ros/hydro --install -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++. And now orocos_kdl failed.

lockandfire gravatar image lockandfire  ( 2014-07-12 02:36:38 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-07-12 02:54:41 -0600

lockandfire gravatar image

I my case, set environment variables CC and CXX only does not help. So use

-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++

to specify c and cxx compiler for catkin_make will solve this problem.

And for orocos_kdl building error, I followed

http://answers.ros.org/question/15276...

that git clone the latest version. It works.

edit flag offensive delete link more

Comments

Thank you!!! The orocos_kdl error got solved, like you said by using the source of the last version of the git for this package. :) After some other errors, I managed to build ros using some tips from here : http://answers.ros.org/question/94771/building-ros-on-osx-109-solution/

WafaJ gravatar image WafaJ  ( 2014-07-22 18:52:13 -0600 )edit

I wounder why you needed to make it explcitely use clang in the first place. On Mavericks that should be the default. Anyway... I'm trying to track OS X related long running issues on this meta issue: https://github.com/ros/rosdistro/issues/4663.

demmeln gravatar image demmeln  ( 2014-07-22 19:37:19 -0600 )edit

The patch for orocos_kdl has recently been released. The depending patches for robot_model and robot_state_publisher are still pending.

demmeln gravatar image demmeln  ( 2014-07-22 19:38:01 -0600 )edit

To demmeln: In fact I am wondering why, too. If I remove -DCMAKER_C/CXX_COMPILER, catkin_make_isolated failed in opencv2 and it is obviously due to compiler can not parse 'in' in 'for' loop. And today I find another confusing error. Without sudo , build fails in octomap.

lockandfire gravatar image lockandfire  ( 2014-07-23 00:10:54 -0600 )edit
1

Could you maybe open a new question for that error and provide the output of `env` before you start the compilation. Maybe somewhere you are telling your environment to use some other compiler? Have you tried this with the latest releases of all packages (i.e. new workspace and running

demmeln gravatar image demmeln  ( 2014-07-24 06:00:43 -0600 )edit

rostinstall_generator again)?

demmeln gravatar image demmeln  ( 2014-07-24 06:00:45 -0600 )edit

To demmeln: thanks4u comment. I update sources and they work right now. I think the title is due to some issue in CMakelist.txt. In the previous version, even if I use CC and CXX to specify clang, catkin will return :"Check for working CXX compiler: /usr/bin/c++". But now, it's clang++

lockandfire gravatar image lockandfire  ( 2014-07-24 07:51:39 -0600 )edit

Good to know.

demmeln gravatar image demmeln  ( 2014-07-24 10:21:48 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2014-05-31 08:18:04 -0600

Seen: 1,629 times

Last updated: Jul 12 '14