0
$\begingroup$

Rosanswers logo

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.


Originally posted by lockandfire on ROS Answers with karma: 276 on 2014-05-31

Post score: 5


Original comments

Comment by lockandfire on 2014-06-01:
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

Comment by WafaJ on 2014-06-03:
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?

Comment by lockandfire on 2014-06-04:
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. '

Comment by WafaJ on 2014-06-04:
I finally buit opencv by doing $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ Now having a problem to build orocos_kdl

Comment by lockandfire on 2014-06-04:
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 ?

Comment by goshawk on 2014-07-09:
Did you guys find an answer for this? Might be helpful for people like me

Comment by lockandfire on 2014-07-12:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/152766/installing-hydro-on-os-x-108-error-compiling-orocos_kdl/

that git clone the latest version. It works.


Originally posted by lockandfire with karma: 276 on 2014-07-12

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by WafaJ on 2014-07-22:
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/

Comment by demmeln on 2014-07-22:
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.

Comment by demmeln on 2014-07-22:
The patch for orocos_kdl has recently been released. The depending patches for robot_model and robot_state_publisher are still pending.

Comment by lockandfire on 2014-07-23:
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.

Comment by demmeln on 2014-07-24:
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

Comment by demmeln on 2014-07-24:
rostinstall_generator again)?

Comment by lockandfire on 2014-07-24:
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++

Comment by demmeln on 2014-07-24:
Good to know.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.