Slamtec / rplidar_ros

BSD 2-Clause "Simplified" License
485 stars 527 forks source link

catkin_make errors #132

Closed r8drfn89 closed 10 months ago

r8drfn89 commented 11 months ago

I have done everything I can to install the ROS dependencies and now I am getting this error when trying to run catkin_make

~ /ros_catkin_ws/src $ catkin_make Base path: /home/astro-scout/ros_catkin_ws/src The specified source space "/home/astro-scout/ros_catkin_ws/src/src" does not exist

deyouslamtec commented 11 months ago

please run catkin_make in ~ /ros_catkin_ws

r8drfn89 commented 11 months ago

505B669C-E777-4F92-BE74-BEEC5214DB35 @deyouslamtec This is the error after running catkin_make in ~ros_catkin_ws

r8drfn89 commented 11 months ago

I even have the empy installed B2465365-BBA4-4BEF-8175-8100DBD6F015

r8drfn89 commented 11 months ago

76C06A52-CB0C-495D-89E5-D16673186335

r8drfn89 commented 11 months ago

@deyouslamtec I tried this catkin_make -DPYTHON_EXECUTABLE=/usr/bin/pyhton3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m and it gave me this message. 9DA22C25-2B24-46E5-A028-B390723908AB

So I tried doing what it recommended catkin_make_isolated -DPYTHON_EXECUTABLE=/usr/bin/pyhton3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m and it gives this error 5EDD04E8-77D0-411A-AE2F-F62020F4F7EF

r8drfn89 commented 11 months ago

@deyouslamtec do you understand what is going on?

deyouslamtec commented 11 months ago

Can you tell me your device information and OS version?

r8drfn89 commented 11 months ago

@deyouslamtec I am currently using ubuntu 20.04 on the raspberry pi 4 armhf. I was able to get further in the catkin_make process than before but now I am facing other errors. Here is the output from the /home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeError.log"

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: /home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_fc22e/fast && /usr/bin/make -f CMakeFiles/cmTC_fc22e.dir/build.make CMakeFiles/cmTC_fc22e.dir/build make[1]: Entering directory '/home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_fc22e.dir/src.c.o /usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_fc22e.dir/src.c.o -c /home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp/src.c Linking C executable cmTC_fc22e /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fc22e.dir/link.txt --verbose=1 /usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_fc22e.dir/src.c.o -o cmTC_fc22e /usr/bin/ld: CMakeFiles/cmTC_fc22e.dir/src.c.o: in function main': src.c:(.text+0x36): undefined reference topthread_create' /usr/bin/ld: src.c:(.text+0x3e): undefined reference to pthread_detach' /usr/bin/ld: src.c:(.text+0x48): undefined reference topthread_join' collect2: error: ld returned 1 exit status make[1]: [CMakeFiles/cmTC_fc22e.dir/build.make:87: cmTC_fc22e] Error 1 make[1]: Leaving directory '/home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp' make: [Makefile:121: cmTC_fc22e/fast] Error 2

Source file was:

include

void test_func(void data) { return data; }

int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(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: /home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_2a1be/fast && /usr/bin/make -f CMakeFiles/cmTC_2a1be.dir/build.make CMakeFiles/cmTC_2a1be.dir/build make[1]: Entering directory '/home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_2a1be.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_2a1be.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c Linking C executable cmTC_2a1be /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2a1be.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_2a1be.dir/CheckFunctionExists.c.o -o cmTC_2a1be -lpthreads /usr/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status make[1]: [CMakeFiles/cmTC_2a1be.dir/build.make:87: cmTC_2a1be] Error 1 make[1]: Leaving directory '/home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp' make: [Makefile:121: cmTC_2a1be/fast] Error 2

Determining if the function trunc exists failed with the following output: Change Dir: /home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_0442e/fast && /usr/bin/make -f CMakeFiles/cmTC_0442e.dir/build.make CMakeFiles/cmTC_0442e.dir/build make[1]: Entering directory '/home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_0442e.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=trunc -o CMakeFiles/cmTC_0442e.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c

: warning: conflicting types for built-in function ‘trunc’; expected ‘double(double)’ [-Wbuiltin-declaration-mismatch] /usr/share/cmake-3.16/Modules/CheckFunctionExists.c:7:3: note: in expansion of macro ‘CHECK_FUNCTION_EXISTS’ 7 | CHECK_FUNCTION_EXISTS(void); | ^~~~~~~~~~~~~~~~~~~~~ /usr/share/cmake-3.16/Modules/CheckFunctionExists.c:1:1: note: ‘trunc’ is declared in header ‘’ +++ |+#include 1 | #ifdef CHECK_FUNCTION_EXISTS Linking C executable cmTC_0442e /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0442e.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=trunc -rdynamic CMakeFiles/cmTC_0442e.dir/CheckFunctionExists.c.o -o cmTC_0442e /usr/bin/ld: CMakeFiles/cmTC_0442e.dir/CheckFunctionExists.c.o: in function `main': CheckFunctionExists.c:(.text+0xa): undefined reference to `trunc' collect2: error: ld returned 1 exit status make[1]: *** [CMakeFiles/cmTC_0442e.dir/build.make:87: cmTC_0442e] Error 1 make[1]: Leaving directory '/home/ubuntu/ros_catkin_ws/build/CMakeFiles/CMakeTmp' make: *** [Makefile:121: cmTC_0442e/fast] Error 2 ![2F418E8B-9955-49CB-99F2-4A35323E3C9B](https://github.com/Slamtec/rplidar_ros/assets/137663045/96ddb676-3206-4c52-b005-0ab2ed4ca807) ![77CE0042-B9C4-4930-B07F-725A37F61183](https://github.com/Slamtec/rplidar_ros/assets/137663045/a177aabc-e52c-4235-abdb-e8a77af19739)
r8drfn89 commented 10 months ago

@deyouslamtec I got it to work by getting a new sd card and installing the 64bit version of Ubuntu 20.04 onto my raspi 4. Then I used http://wiki.ros.org/noetic/Installation/Ubuntu again, along with your video. It helped a lot and it now works. Thanks for all of your help.