TurtleBot3 Simulation With ROS Noetic on Fedora: Could not find a package configuration file provided by "gazebo_ros"
I'm following this tutorial.
The build fails with
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /root/catkin_ws/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_989a3/fast && /usr/bin/gmake -f CMakeFiles/cmTC_989a3.dir/build.make CMakeFiles/cmTC_989a3.dir/build
gmake[1]: Entering directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_989a3.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_989a3.dir/src.c.o -c /root/catkin_ws/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_989a3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_989a3.dir/link.txt --verbose=1
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_989a3.dir/src.c.o -o cmTC_989a3
/usr/bin/ld: CMakeFiles/cmTC_989a3.dir/src.c.o: in function `main':
src.c:(.text+0x2d): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x39): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x45): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x56): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_989a3.dir/build.make:107: cmTC_989a3] Error 1
gmake[1]: Leaving directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_989a3/fast] Error 2
Source file was:
#include <pthread.h>
void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/catkin_ws/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_c1118/fast && /usr/bin/gmake -f CMakeFiles/cmTC_c1118.dir/build.make CMakeFiles/cmTC_c1118.dir/build
gmake[1]: Entering directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c1118.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_c1118.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_c1118
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c1118.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_c1118.dir/CheckFunctionExists.c.o -o cmTC_c1118 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_c1118.dir/build.make:107: cmTC_c1118] Error 1
gmake[1]: Leaving directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_c1118/fast] Error 2
as wel as:
-- Could not find the required component 'gazebo_ros'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /root/ros_catkin_ws/install_isolated/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "gazebo_ros" with
any of the following names:
gazebo_rosConfig.cmake
gazebo_ros-config.cmake
Add the installation prefix of "gazebo_ros" to CMAKE_PREFIX_PATH or set
"gazebo_ros_DIR" to a directory containing one of the above files. If
"gazebo_ros" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most ...
"Gazebo 11" and
gazebo_ros
are two different things.The latter depends on the former, but the former does not have any dependency on the latter.
gazebo_ros is part of the
gazebo_ros_pkgs
metapackage, and brings in Gazebo support for ROS.If you've installed Gazebo yourself, following the dependencies on the
gazebosim
website, it could well be you have Gazebo 11 working, but you don't have thegazebo_ros
package, which is what the error message is about.How does one get the
gazebo_ros
package on Fedora 32? I only see it for Debian/Ubuntu.Aren't you already building everything from source?
You'd build it from sources as well then.
I don't know how you manage your source checkout right now.
I am following the build instructions here but again, they say Ubuntu/Debian. I'd prefer an RPM.
And there's no
noetic
version mentioned on that page.I tried to insert noetic in the tutorial but I get:
You'll have to follow the Install from source instructions and translate the instructions to how you'd do those things on Fedora.
Those aren't available.
Or at least not publicly afaik. You may want to post a comment on RPM Packaging Support in ros_buildfarm to let ppl know there are users interested in the RPM packaging/packages.
In general the workflow would be something like this:
git clone
thegazebo_ros_pkgs
repository into a Catkin workspacerosdep
to install all dependencies. Ifrosdep
doesn't recognise your Gazebo installation, try usingskip-keys
to make it ignore dependencies you are sure are presentIf that is successful, you now have
gazebo_ros_pkgs
and related packages.See #q252478 for an overview of the steps.
Yes that's what I did, I ran
rosdep check --from-paths . --ignore-src --rosdistro noetic
then got:I don't think I should use the
skip-keys
option on that, correct? Is there a way to getlibgazebo11-dev
on Centos/Fedora?