tum-vision / lsd_slam

LSD-SLAM
GNU General Public License v3.0
2.6k stars 1.23k forks source link

Build on Raspberry Pi 2 Model B fails - boost mutex problem #154

Open gogobd opened 8 years ago

gogobd commented 8 years ago

Hello, every 01!

I am trying to compile LSD-SLAM on a Raspberry Pi 2. I got ROS installed and all dependencies mentioned are available now. I changed the CMakeList.txt in lsd_slam_core to get past some issues, but unfortunately I run into a problem I can't understand. Here's my session:

Linux raspberrypi 4.1.6-v7+ #810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

pi@raspberrypi ~ $ cd rosbuild_ws/
pi@raspberrypi ~/rosbuild_ws $ source setup.bash
pi@raspberrypi ~/rosbuild_ws $ cd package_dir/
pi@raspberrypi ~/rosbuild_ws/package_dir $ git clone https://github.com/tum-vision/lsd_slam.git lsd_slam
Cloning into 'lsd_slam'...
remote: Counting objects: 490, done.
remote: Total 490 (delta 0), reused 0 (delta 0), pack-reused 490
Receiving objects: 100% (490/490), 1.11 MiB | 648 KiB/s, done.
Resolving deltas: 100% (254/254), done.
pi@raspberrypi ~/rosbuild_ws/package_dir $ cd lsd_slam/
pi@raspberrypi ~/rosbuild_ws/package_dir/lsd_slam $ vi ./lsd_slam_core/CMakeLists.txt
pi@raspberrypi ~/rosbuild_ws/package_dir/lsd_slam $ git diff
diff --git a/lsd_slam_core/CMakeLists.txt b/lsd_slam_core/CMakeLists.txt
index 758ce0b..8a4cfff 100644
--- a/lsd_slam_core/CMakeLists.txt
+++ b/lsd_slam_core/CMakeLists.txt
@@ -35,11 +35,11 @@ gencfg()
 # SSE flags
 rosbuild_check_for_sse()
 add_definitions("-DUSE_ROS")
-add_definitions("-DENABLE_SSE")
+#add_definitions("-DENABLE_SSE")

 # Also add some useful compiler flag
 set(CMAKE_CXX_FLAGS
-   "${CMAKE_CXX_FLAGS} ${SSE_FLAGS} -march=native  -std=c++0x"
+   "${CMAKE_CXX_FLAGS} ${SSE_FLAGS} -std=c++0x"
 ) 

 # Set source files
pi@raspberrypi ~/rosbuild_ws/package_dir/lsd_slam $ rosmake lsd_slam
[ rosmake ] rosmake starting...                                                                                                                                 
[ rosmake ] Packages requested are: ['lsd_slam']                                                                                                                
[ rosmake ] Logging to directory /home/pi/.ros/rosmake/rosmake_output-20150924-055837                                                                           
[ rosmake ] Expanded args ['lsd_slam'] to:
['lsd_slam_core', 'lsd_slam_viewer']                                                                                 
[rosmake-0] Starting >>> catkin [ make ]                                                                                                                        
[rosmake-0] Finished <<< catkin ROS_NOBUILD in package catkin
 No Makefile in package catkin                                                                    
[rosmake-0] Starting >>> genmsg [ make ]                                                                                                                        
[rosmake-2] Starting >>> cpp_common [ make ]                                                                                                                    
[rosmake-1] Starting >>> cmake_modules [ make ]                                                                                                                 
[rosmake-3] Starting >>> rosgraph [ make ]                                                                                                                      
[rosmake-0] Finished <<< genmsg ROS_NOBUILD in package genmsg
 No Makefile in package genmsg                                                                    
[rosmake-0] Starting >>> genlisp [ make ]                                                                                                                       
[rosmake-0] Finished <<< genlisp ROS_NOBUILD in package genlisp.0 sec ] [ rosgraph: 0.0 sec ] [ genlisp: 0.0 sec ]                    [ 4 Active 2/42 Complete ]
 No Makefile in package genlisp                                                                 
[rosmake-3] Finished <<< rosgraph ROS_NOBUILD in package rosgraph
 No Makefile in package rosgraph                                                              
[rosmake-3] Starting >>> genpy [ make ]                                                                                                                         
[rosmake-0] Starting >>> gencpp [ make ]                                                                                                                        
[rosmake-1] Finished <<< cmake_modules ROS_NOBUILD in package cmake_modules
 No Makefile in package cmake_modules                                               
[rosmake-1] Starting >>> rospack [ make ]                                                                                                                       
[rosmake-2] Finished <<< cpp_common ROS_NOBUILD in package cpp_common
 No Makefile in package cpp_common                                                        
[rosmake-2] Starting >>> rostime [ make ]                                                                                                                       
[rosmake-0] Finished <<< gencpp ROS_NOBUILD in package gencpp
 No Makefile in package gencpp                                                                    
[rosmake-0] Starting >>> rosparam [ make ]                                                                                                                      
[rosmake-2] Finished <<< rostime ROS_NOBUILD in package rostime
 No Makefile in package rostime                                                                 
[rosmake-2] Starting >>> roscpp_traits [ make ]                                                                                                                 
[rosmake-3] Finished <<< genpy ROS_NOBUILD in package genpy
 No Makefile in package genpy                                                                       
[rosmake-3] Starting >>> message_generation [ make ]                                                                                                            
[rosmake-1] Finished <<< rospack ROS_NOBUILD in package rospack
 No Makefile in package rospack                                                                 
[rosmake-0] Finished <<< rosparam ROS_NOBUILD in package rosparam roscpp_traits: 0.0 sec ] [ message_generation: 0.0 sec ]            [ 4 Active 9/42 Complete ]
 No Makefile in package rosparam                                                              
[rosmake-1] Starting >>> roslib [ make ]                                                                                                                        
[rosmake-0] Starting >>> rosmaster [ make ]                                                                                                                     
[rosmake-2] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits
 No Makefile in package roscpp_traits                                               
[rosmake-2] Starting >>> roscpp_serialization [ make ]                                                                                                          
[rosmake-1] Finished <<< roslib ROS_NOBUILD in package roslib
 No Makefile in package roslib                                                                    
[rosmake-1] Starting >>> rosunit [ make ]                                                                                                                       
[rosmake-3] Finished <<< message_generation ROS_NOBUILD in package message_generation
 No Makefile in package message_generation                                
[rosmake-0] Finished <<< rosmaster ROS_NOBUILD in package rosmaster
 No Makefile in package rosmaster                                                           
[rosmake-3] Starting >>> roslang [ make ]                                                                                                                       
[rosmake-2] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization
 No Makefile in package roscpp_serialization                          
[rosmake-0] Starting >>> xmlrpcpp [ make ]                                                                                                                      
[rosmake-2] Starting >>> message_runtime [ make ]                                                                                                               
[rosmake-1] Finished <<< rosunit ROS_NOBUILD in package rosunit
 No Makefile in package rosunit                                                                 
[rosmake-1] Starting >>> rosclean [ make ]                                                                                                                      
[rosmake-2] Finished <<< message_runtime ROS_NOBUILD in package message_runtime
 No Makefile in package message_runtime                                         
[rosmake-2] Starting >>> std_msgs [ make ]                                                                                                                      
[rosmake-3] Finished <<< roslang ROS_NOBUILD in package roslang [ rosclean: 0.0 sec ] [ std_msgs: 0.0 sec ]                          [ 4 Active 18/42 Complete ]
 No Makefile in package roslang                                                                 
[rosmake-1] Finished <<< rosclean ROS_NOBUILD in package rosclean
 No Makefile in package rosclean                                                              
[rosmake-1] Starting >>> roslz4 [ make ]                                                                                                                        
[rosmake-3] Starting >>> rosbuild [ make ]                                                                                                                      
[rosmake-2] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
 No Makefile in package std_msgs                                                              
[rosmake-2] Starting >>> geometry_msgs [ make ]                                                                                                                 
[rosmake-0] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp
 No Makefile in package xmlrpcpp                                                              
[rosmake-0] Starting >>> rosgraph_msgs [ make ]                                                                                                                 
[rosmake-1] Finished <<< roslz4 ROS_NOBUILD in package roslz4
 No Makefile in package roslz4                                                                    
[rosmake-1] Starting >>> rosbag_storage [ make ]                                                                                                                
[rosmake-3] Finished <<< rosbuild ROS_NOBUILD in package rosbuild
 No Makefile in package rosbuild                                                              
[rosmake-3] Starting >>> rosconsole [ make ]                                                                                                                    
[rosmake-0] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs
 No Makefile in package rosgraph_msgs                                               
[rosmake-2] Finished <<< geometry_msgs ROS_NOBUILD in package geometry_msgs
 No Makefile in package geometry_msgs                                               
[rosmake-2] Starting >>> sensor_msgs [ make ]                                                                                                                   
[rosmake-3] Finished <<< rosconsole ROS_NOBUILD in package rosconsolec ] [ sensor_msgs: 0.0 sec ]                                    [ 3 Active 26/42 Complete ]
 No Makefile in package rosconsole                                                        
[rosmake-1] Finished <<< rosbag_storage ROS_NOBUILD in package rosbag_storage
 No Makefile in package rosbag_storage                                            
[rosmake-3] Starting >>> roscpp [ make ]                                                                                                                        
[rosmake-2] Finished <<< sensor_msgs ROS_NOBUILD in package sensor_msgs
 No Makefile in package sensor_msgs                                                     
[rosmake-3] Finished <<< roscpp ROS_NOBUILD in package roscpp
 No Makefile in package roscpp                                                                    
[rosmake-3] Starting >>> rosout [ make ]                                                                                                                        
[rosmake-0] Starting >>> rospy [ make ]                                                                                                                         
[rosmake-3] Finished <<< rosout ROS_NOBUILD in package rosout
 No Makefile in package rosout                                                                    
[rosmake-3] Starting >>> roslaunch [ make ]                                                                                                                     
[rosmake-0] Finished <<< rospy ROS_NOBUILD in package rospy
 No Makefile in package rospy                                                                       
[rosmake-3] Finished <<< roslaunch ROS_NOBUILD in package roslaunch                                                                  [ 1 Active 32/42 Complete ]
 No Makefile in package roslaunch                                                           
[rosmake-3] Starting >>> rostest [ make ]                                                                                                                       
[rosmake-3] Finished <<< rostest ROS_NOBUILD in package rostest
 No Makefile in package rostest                                                                 
[rosmake-3] Starting >>> cv_bridge [ make ]                                                                                                                     
[rosmake-1] Starting >>> topic_tools [ make ]                                                                                                                   
[rosmake-3] Finished <<< cv_bridge ROS_NOBUILD in package cv_bridge
 No Makefile in package cv_bridge                                                           
[rosmake-1] Finished <<< topic_tools ROS_NOBUILD in package topic_tools
 No Makefile in package topic_tools                                                     
[rosmake-1] Starting >>> rosbag [ make ]                                                                                                                        
[rosmake-1] Finished <<< rosbag ROS_NOBUILD in package rosbag                                                                        [ 1 Active 36/42 Complete ]
 No Makefile in package rosbag                                                                    
[rosmake-1] Starting >>> rosmsg [ make ]                                                                                                                        
[rosmake-1] Finished <<< rosmsg ROS_NOBUILD in package rosmsg
 No Makefile in package rosmsg                                                                    
[rosmake-1] Starting >>> rosservice [ make ]                                                                                                                    
[rosmake-1] Finished <<< rosservice ROS_NOBUILD in package rosservice
 No Makefile in package rosservice                                                        
[rosmake-1] Starting >>> dynamic_reconfigure [ make ]                                                                                                           
[rosmake-1] Finished <<< dynamic_reconfigure ROS_NOBUILD in package dynamic_reconfigure
 No Makefile in package dynamic_reconfigure                             
[rosmake-1] Starting >>> lsd_slam_viewer [ make ]                                                                                                               
[rosmake-1] Finished <<< lsd_slam_viewer [PASS] [ 28.65 seconds ]                                                                                               
[rosmake-1] Starting >>> lsd_slam_core [ make ]                                                                                                                 
[ rosmake ] Last 40 linesd_slam_core: 534.4 sec ]                                                                                    [ 1 Active 41/42 Complete ]
{-------------------------------------------------------------------------------
  /usr/include/boost/thread/locks.hpp:553:9: note:   candidate expects 2 arguments, 1 provided
  /usr/include/boost/thread/locks.hpp:550:9: note: boost::shared_lock<Mutex>::shared_lock(Mutex&, boost::defer_lock_t) [with Mutex = boost::shared_mutex]
  /usr/include/boost/thread/locks.hpp:550:9: note:   candidate expects 2 arguments, 1 provided
  /usr/include/boost/thread/locks.hpp:547:9: note: boost::shared_lock<Mutex>::shared_lock(Mutex&, boost::adopt_lock_t) [with Mutex = boost::shared_mutex]
  /usr/include/boost/thread/locks.hpp:547:9: note:   candidate expects 2 arguments, 1 provided
  /usr/include/boost/thread/locks.hpp:538:9: note: boost::shared_lock<Mutex>::shared_lock() [with Mutex = boost::shared_mutex]
  /usr/include/boost/thread/locks.hpp:538:9: note:   candidate expects 0 arguments, 1 provided
  In file included from /home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/src/SlamSystem.cpp:23:0:
  /home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/src/DataStructures/Frame.h: In member function ‘boost::shared_lock<boost::shared_mutex> lsd_slam::Frame::getActiveLock()’:
  /home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/src/DataStructures/Frame.h:140:55: error: no matching function for call to ‘boost::shared_lock<boost::shared_mutex>::shared_lock(boost::shared_lock<boost::shared_mutex>)’
  /home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/src/DataStructures/Frame.h:140:55: note: candidates are:
  /usr/include/boost/thread/locks.hpp:558:9: note: boost::shared_lock<Mutex>::shared_lock(Mutex&, const system_time&) [with Mutex = boost::shared_mutex, boost::system_time = boost::posix_time::ptime]
  /usr/include/boost/thread/locks.hpp:558:9: note:   candidate expects 2 arguments, 1 provided
  /usr/include/boost/thread/locks.hpp:553:9: note: boost::shared_lock<Mutex>::shared_lock(Mutex&, boost::try_to_lock_t) [with Mutex = boost::shared_mutex]
  /usr/include/boost/thread/locks.hpp:553:9: note:   candidate expects 2 arguments, 1 provided
  /usr/include/boost/thread/locks.hpp:550:9: note: boost::shared_lock<Mutex>::shared_lock(Mutex&, boost::defer_lock_t) [with Mutex = boost::shared_mutex]
  /usr/include/boost/thread/locks.hpp:550:9: note:   candidate expects 2 arguments, 1 provided
  /usr/include/boost/thread/locks.hpp:547:9: note: boost::shared_lock<Mutex>::shared_lock(Mutex&, boost::adopt_lock_t) [with Mutex = boost::shared_mutex]
  /usr/include/boost/thread/locks.hpp:547:9: note:   candidate expects 2 arguments, 1 provided
  /usr/include/boost/thread/locks.hpp:538:9: note: boost::shared_lock<Mutex>::shared_lock() [with Mutex = boost::shared_mutex]
  /usr/include/boost/thread/locks.hpp:538:9: note:   candidate expects 0 arguments, 1 provided
  CMakeFiles/lsdslam.dir/build.make:54: recipe for target 'CMakeFiles/lsdslam.dir/src/DataStructures/Frame.cpp.o' failed
  make[3]: *** [CMakeFiles/lsdslam.dir/src/DataStructures/Frame.cpp.o] Error 1
  make[3]: *** Waiting for unfinished jobs....
  /home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/src/DataStructures/FrameMemory.cpp:137:1: warning: control reaches end of non-void function [-Wreturn-type]
  CMakeFiles/lsdslam.dir/build.make:77: recipe for target 'CMakeFiles/lsdslam.dir/src/DataStructures/FramePoseStruct.cpp.o' failed
  make[3]: *** [CMakeFiles/lsdslam.dir/src/DataStructures/FramePoseStruct.cpp.o] Error 1
  CMakeFiles/lsdslam.dir/build.make:100: recipe for target 'CMakeFiles/lsdslam.dir/src/DataStructures/FrameMemory.cpp.o' failed
  make[3]: *** [CMakeFiles/lsdslam.dir/src/DataStructures/FrameMemory.cpp.o] Error 1
  CMakeFiles/lsdslam.dir/build.make:123: recipe for target 'CMakeFiles/lsdslam.dir/src/SlamSystem.cpp.o' failed
  make[3]: *** [CMakeFiles/lsdslam.dir/src/SlamSystem.cpp.o] Error 1
  make[3]: Leaving directory '/home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/build'
  CMakeFiles/Makefile2:380: recipe for target 'CMakeFiles/lsdslam.dir/all' failed
  make[2]: *** [CMakeFiles/lsdslam.dir/all] Error 2
  make[2]: Leaving directory '/home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/build'
  Makefile:113: recipe for target 'all' failed
  make[1]: *** [all] Error 2
  make[1]: Leaving directory '/home/pi/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/build'
  /opt/ros/indigo/share/mk/cmake.mk:7: recipe for target 'all' failed
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package lsd_slam_core written to:                                                                   [ 1 Active 41/42 Complete ]
[ rosmake ]    /home/pi/.ros/rosmake/rosmake_output-20150924-055837/lsd_slam_core/build_output.log
[rosmake-1] Finished <<< lsd_slam_core [FAIL] [ 534.35 seconds ]                                                                                                
[ rosmake ] Halting due to failure in package lsd_slam_core. 
[ rosmake ] Waiting for other threads to complete.                                                
[ rosmake ] Results:                                                                                                                                            
[ rosmake ] Built 42 packages with 1 failures.                                                                                                                  
[ rosmake ] Summary output to directory                                                                                                                         
[ rosmake ] /home/pi/.ros/rosmake/rosmake_output-20150924-055837   

So something's wrong with a boost mutex lock, but I have no idea how I could fix that. It would be great to get it running, so any help would be very appreciated.

Gogo.

gogobd commented 8 years ago

I'm upgrading my boost library from 1.49.0 to 1.59.0 to see what happens.

benjamincburns commented 8 years ago

@gogobd Any update on this?

hca2014 commented 8 years ago

Can anyone provide the required changes to the CMakelists.txt file mentioned for RPi 2 compilation? Thanks.

jerrykingnice commented 8 years ago

hi gogobd, how did you get this solved?I get the same error. thanks!

gogobd commented 8 years ago

Unfortunately that was a while ago and I'm traveling right now, but I think I git that away by changing the version of the boost library. Sorry that I can't be more conclusive right now.

After many tries I got lsd-slam working without much graphical modules, especially without the point cloud viewer which is too heavy for my raspberry.

Hope that helps...

Gg ☆

On 12 Aug 2016, at 05:53, jerrykingnice notifications@github.com wrote:

hi gogobd, how did you get this solved?I meet accross the same error. thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

SergioGarG commented 7 years ago

Hi @gogobd , can you tell me how you solved the problem?

Thank you in advance :)