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

Building cv_bridge with catkin fails

asked 2013-01-15 07:42:19 -0600

J.M.T. gravatar image

updated 2013-01-15 07:57:36 -0600

KruseT gravatar image

Trying to build cv_bridge fails with this error:

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/Users/tatsch/ros_catkin_ws/install_isolated/env_cached.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/tatsch/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make -j4 in '/Users/tatsch/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make install in '/Users/tatsch/ros_catkin_ws/build_isolated/camera_calibration_parsers'
<== Finished processing package [97 of 153]: 'camera_calibration_parsers'
==> Processing catkin package: 'cv_bridge'
==> Building with env: '/Users/tatsch/ros_catkin_ws/install_isolated/env_cached.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/tatsch/ros_catkin_ws/build_isolated/cv_bridge'
==> make -j4 in '/Users/tatsch/ros_catkin_ws/build_isolated/cv_bridge'
Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/libcv_bridge.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
[ 50%] Built target cv_bridge
Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
Undefined symbols for architecture x86_64:
  "_PyErr_SetString", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyExc_TypeError", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyImport_ImportModule", referenced from:
      init_module_cv_bridge_boost() in module.cpp.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<int const&>::operator()(int const&) const in module.cpp.o
  "_PyInt_Type", referenced from:
      boost::python::to_python_value<int const&>::get_pytype() const in module.cpp.o
  "_PyObject_AsWriteBuffer", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_PyObject_CallObject", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyObject_GetAttrString", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyString_AsString", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_Py_BuildValue", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in module.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib] Error 1
make[1]: *** [src/CMakeFiles/cv_bridge_boost.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'cv_bridge': 
  Command '/Users/tatsch/ros_catkin_ws/install_isolated/env_cached.sh make -j4' returned non-zero exit status 2
Command failed, exiting.

OpenCV compiled successfully before, but /Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib is indeed empty. In which step should it get filled or do I have to do it manually? Can someone give me a hint?

edit retag flag offensive close merge delete

Comments

Can post the output from ./src/catkin/bin/catkin_make_isolated -j1

WilliamWoodall gravatar image WilliamWoodall  ( 2013-01-15 08:02:19 -0600 )edit

It looks like boost python is missing some symbols from the Python libraries. Are you using the system python or have you installed python from a mpkg or from brew?

WilliamWoodall gravatar image WilliamWoodall  ( 2013-01-15 08:03:42 -0600 )edit

Yeah, -j4 just tends to interleave errors and build logs, -j1 is easier to read and tell what is generating the error.

WilliamWoodall gravatar image WilliamWoodall  ( 2013-01-15 09:44:04 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
4

answered 2013-01-16 10:37:08 -0600

WilliamWoodall gravatar image

I have made a pull request against the vision_opencv to fix this. It should be merged and released in a few days time.

In the mean time, a patch:

diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index 03a02b8..6c8a69f 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -20,6 +20,7 @@ include_directories(SYSTEM ${PYTHON_INCLUDE_PATH}
 add_library(${PROJECT_NAME}_boost module.cpp)
 target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES}
                                             ${catkin_LIBRARIES}
+                                            ${PYTHON_LIBRARIES}
                                             ${PROJECT_NAME}
 )
edit flag offensive delete link more

Comments

No problem, glad it helps.

WilliamWoodall gravatar image WilliamWoodall  ( 2013-01-16 20:29:12 -0600 )edit
0

answered 2013-01-15 10:54:45 -0600

Martin Llofriu gravatar image

I have the same error here. I attach the -j1 output (I am not allowed to comment).

==> Processing catkin package: 'cv_bridge'
==> Creating build directory: 'build_isolated/cv_bridge'
==> Building with env: '/Users/mllofriu/ros_catkin_ws/install_isolated/env.sh'
==> cmake /Users/mllofriu/ros_catkin_ws/src/cv_bridge -DCATKIN_DEVEL_PREFIX=/Users/mllofriu/ros_catkin_ws/devel_isolated/cv_bridge -DCMAKE_INSTALL_PREFIX=/Users/mllofriu/ros_catkin_ws/install_isolated
==> make -j1 in '/Users/mllofriu/ros_catkin_ws/build_isolated/cv_bridge'
Scanning dependencies of target cv_bridge
[ 50%] Building CXX object src/CMakeFiles/cv_bridge.dir/cv_bridge.cpp.o
Linking CXX shared library /Users/mllofriu/ros_catkin_ws/devel_isolated/cv_bridge/lib/libcv_bridge.dylib
ld: warning: directory not found for option '-L/Users/mllofriu/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
[ 50%] Built target cv_bridge
Scanning dependencies of target cv_bridge_boost
[100%] Building CXX object src/CMakeFiles/cv_bridge_boost.dir/module.cpp.o
Linking CXX shared library /Users/mllofriu/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib
ld: warning: directory not found for option '-L/Users/mllofriu/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
Undefined symbols for architecture x86_64:
  "_PyErr_SetString", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyExc_TypeError", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyImport_ImportModule", referenced from:
      init_module_cv_bridge_boost() in module.cpp.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<int const&>::operator()(int const&) const in module.cpp.o
  "_PyInt_Type", referenced from:
      boost::python::to_python_value<int const&>::get_pytype() const in module.cpp.o
  "_PyObject_AsWriteBuffer", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_PyObject_CallObject", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyObject_GetAttrString", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyString_AsString", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_Py_BuildValue", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in module.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/mllofriu/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib] Error 1
make[1]: *** [src/CMakeFiles/cv_bridge_boost.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'cv_bridge': 
  Command '/Users/mllofriu/ros_catkin_ws/install_isolated/env.sh make -j1' returned non-zero exit status 2
Command failed, exiting.
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-01-15 07:42:19 -0600

Seen: 3,368 times

Last updated: Jan 16 '13