Building cv_bridge with catkin fails
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?
Can post the output from
./src/catkin/bin/catkin_make_isolated -j1
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?
Yeah, -j4 just tends to interleave errors and build logs, -j1 is easier to read and tell what is generating the error.