Error building Foxy: relocation R_X86_64_PC32 against symbol `_PyRuntime' (Focal)
I'm installing ROS2 Foxy, and when a run the command:
> cd ~/ros2_foxy/
> colcon build --symlink-install
I had the error:
Starting >>> rosidl_typesupport_c
Finished <<< rviz_rendering [4.45s]
Starting >>> rmw_connext_cpp
Finished <<< rmw_connext_cpp [0.81s]
Starting >>> rosidl_generator_cpp
Finished <<< rosidl_typesupport_c [1.95s]
Starting >>> rosidl_typesupport_cpp
Finished <<< rosidl_generator_cpp [1.93s]
Starting >>> rosidl_generator_py
Finished <<< rosidl_typesupport_cpp [2.12s]
Starting >>> launch_xml
--- stderr: rosidl_generator_py
/usr/bin/ld: /usr/local/lib/libpython3.8.a(_warnings.o): relocation R_X86_64_PC32 against symbol `_PyRuntime' 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/rosidl_generator_py_custom__python.dir/build.make:256: rosidl_generator_py/rosidl_generator_py/librosidl_generator_py_custom__python.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:329: CMakeFiles/rosidl_generator_py_custom__python.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< rosidl_generator_py [2.51s, exited with code 2]
Aborted <<< launch_xml [2.77s]
Summary: 117 packages finished [1min 33s]
1 package failed: rosidl_generator_py
1 package aborted: launch_xml
1 package had stderr output: rosidl_generator_py
191 packages not processed
What can I do to solve this error??
How did you install python3.8? I think you don't use apt.
Also, it is recommended to attach the error as text, not as an image.
Did you download from apt on ros2?
what happen after you type this in terminal
/source /opt/ros/foxy/setup.bash
?also whats the output of
python3 --version
?When I update the Ubuntu 18 to Ubuntu 20, the python3 it was install.
source /opt/ros/foxy/setup.bash
=>bash: /opt/ros/foxy/setup.bash: No such file or directory
python3 --version
=>Python 3.8.10
bash: /opt/ros/foxy/setup.bash: No such file or directory
THis means you don't have foxy installed. Try re-install foxy
@Jose-Araujo: could you clarify why you want to build Foxy from source? There isn't really any immediate need when you are running Ubuntu
20.04
. Or is this nonamd64
?@kak13:
I'm sort-of assuming @Jose-Araujo knows that. His build is failing, that would seem to be the main problem here.
Additionally, the default
install
location for a from-source build would be$colcon_ws/install
, not/opt/ros
.I must be confused with colcon build then.
I assume that colcon build relies on /opt/ros/foxy/setup.bash to continue the colcon build.
My bad, Jose haha
@gvdhoom: so I follow this instructions https://docs.ros.org/en/foxy/Installa.... The recommended it's that https://docs.ros.org/en/foxy/Installa...
Well, what is your purpose?
You could have a good reason for wanting to compile everything from sources, but if you can't think of any, you'd probably be better of with an installation using
apt
. So that would indeed be the second link you shared.