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

build fails at camera_calibration_parsers; how do I recompile with -fPIC

asked 2019-03-23 16:20:16 -0500

ml@mariochiari.net gravatar image

updated 2019-03-24 12:13:19 -0500

Linux 4.19.12-301.fc29.x86_64 Fedora 29

When I try to run

./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

I get the following error, at package 182 off 237

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/root/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/root/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make -j8 -l8 in '/root/ros_catkin_ws/build_isolated/camera_calibration_parsers'
[  0%] Built target geometry_msgs_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] Built target sensor_msgs_generate_messages_cpp
[  0%] Built target geometry_msgs_generate_messages_py
[  0%] Built target sensor_msgs_generate_messages_eus
[  0%] Built target geometry_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target sensor_msgs_generate_messages_py
[  0%] Built target roscpp_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_py
[  0%] Built target geometry_msgs_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target roscpp_generate_messages_cpp
[  0%] Built target sensor_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_nodejs
[  0%] Built target rosgraph_msgs_generate_messages_py
[  0%] Built target geometry_msgs_generate_messages_eus
[  0%] Built target std_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target roscpp_generate_messages_nodejs
[  0%] Built target roscpp_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_eus
[ 50%] Built target camera_calibration_parsers
[ 75%] Linking CXX shared library /root/ros_catkin_ws/devel_isolated/camera_calibration_parsers/lib/python2.7/site-packages/camera_calibration_parsers/camera_calibration_parsers_wrapper.so
[ 87%] Built target convert
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libboost_python.a(from_python.o): relocation R_X86_64_PC32 against symbol 'PyExc_TypeError' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/camera_calibration_parsers_wrapper.dir/build.make:142: /root/ros_catkin_ws/devel_isolated/camera_calibration_parsers/lib/python2.7/site-packages/camera_calibration_parsers/camera_calibration_parsers_wrapper.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:521: CMakeFiles/camera_calibration_parsers_wrapper.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
<== Failed to process package 'camera_calibration_parsers': 
  Command '['/root/ros_catkin_ws/install_isolated/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2

Reproduce this error by running:
==> cd /root/ros_catkin_ws/build_isolated/camera_calibration_parsers && /root/ros_catkin_ws/install_isolated/env.sh make -j8 -l8

Command failed, exiting.

I am a newbie, and I have not a clue about how to fix it. Thanks for your help

mario

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-03-24 16:16:29 -0500

ahendrix gravatar image

I don't think you actually need to "recompile with -fPIC", as the error suggests. (It suggests that you recompile libboost_python.a, but you probably got that library from a precompiled package).

It looks like the linking step for camera_calibration_parsers_wrapper.so is trying to create a dynamically linked library, but is linking in a static library: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libboost_python.a that can't be used to create a dynamic library. I would focus my debugging effort on determining if there is dynamic version (.so instead of .a) of that library installed, or if there is a Fedora package that you can install for it. If there's a package that isn't installed, I would try installing it (and then clean your workspace and retry the build from the beginning). If the dynamic library is already installed, or installing it doesn't help, I would go through the cmake documentation to figure out why it was trying to link against the static version instead of the dynamic version.

edit flag offensive delete link more

Comments

Thanks for your reply. It seems I have

/usr/lib64/libboost_python.a
/usr/lib64/libboost_python.so.1.66.0
/usr/lib64/libboost_python3.a
/usr/lib64/libboost_python3.so
/usr/lib64/libboost_python3.so.1.66.0

Is there a further Fedora package I am missing? I am not sure how to check what you suggest. Note, I have been able to install ROS by Docker but I would like to fix above too.

ml@mariochiari.net gravatar image ml@mariochiari.net  ( 2019-03-25 06:21:36 -0500 )edit

I would expect to see a /usr/lib64/libboost_python.so , so it seems like there is a package missing. The last RPM-based distro I used was RHEL5, so my rpm search skills are pretty rusty, but it looks like you might be missing boost-python2-devel (or some more generic boost devel package that depends on it).

ahendrix gravatar image ahendrix  ( 2019-03-25 12:09:11 -0500 )edit

YES, thanks so much, that installs /usr/lib64/libboost_python.so and fixes it. Later I needed bullet-devel too.

ml@mariochiari.net gravatar image ml@mariochiari.net  ( 2019-03-25 14:40:02 -0500 )edit

Question Tools

Stats

Asked: 2019-03-23 16:20:16 -0500

Seen: 626 times

Last updated: Mar 24 '19