error while loading shared libraries: libgtsam.so.4

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

error while loading shared libraries: libgtsam.so.4

TouchDeeper
Hi,
I make the rtabmap_ros according to the instructionhttps://github.com/introlab/rtabmap_ros/tree/master. make pass well. but when I run the example according to the tutorialhttp://wiki.ros.org/rtabmap_ros/Tutorials/HandHeldMapping,error occurs.
The code I run is below(just the same as tutorial):
1.open the realsensed435 camera :roslaunch realsense2_camera rs_camera.launch align_depth:=true
2.run the rtabmap :roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info
The error is below(seems like the problem of gtsam):
process[rtabmap/rgbd_odometry-1]: started with pid [8496]
/home/wang/rtabmap_ws/devel/lib/rtabmap_ros/rgbd_odometry: error while loading shared libraries: libgtsam.so.4: cannot open shared object file: No such file or directory
The information of the cmake output when I run cmake .. -DCMAKE_INSTALL_PREFIX=my workspace path/devel
-- Checking for module 'libopenni2'
--   No package 'libopenni2' found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
-- PCL definitions don't contain "-march=native", make sure all libraries using Eigen are also compiled without that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).
-- Found Sqlite3: /usr/include /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE  
-- Found OpenMP
-- Found OpenCV: /opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv
-- Found PCL: /usr/include/pcl-1.7;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/vtk-6.2;/usr/include/freetype2;/usr/include/x86_64-linux-gnu/freetype2;/usr/include/jsoncpp;/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent;/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include;/usr/lib/openmpi/include;/usr/lib/openmpi/include/openmpi;/usr/include/python2.7;/usr/include/x86_64-linux-gnu;/usr/include/hdf5/openmpi;/usr/include/libxml2;/usr/include/tcl
-- Found ZLIB: /usr/include
-- VTK_RENDERING_BACKEND=OpenGL
-- Found Freenect: /usr/include
-- Found freenect2: /home/wang/freenect2/include
-- Found DC1394: /usr/include/dc1394
-- Old g2o version detected with c++03 interface (config file: /opt/ros/kinetic/include/g2o/config.h).
-- Found g2o: /opt/ros/kinetic/include;/usr/include/suitesparse;/usr/include/suitesparse
-- GTSAM include directory:  /usr/local/lib/cmake/GTSAM/../../../include
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   timer
--   chrono
-- Found BOOST: /usr/include /usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;-lpthread;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so
-- FlyCapture2_INCLUDE_DIR=FlyCapture2_INCLUDE_DIR-NOTFOUND
-- FlyCapture2_LIBRARY=FlyCapture2_LIBRARY-NOTFOUND
-- Triclops_INCLUDE_DIR=Triclops_INCLUDE_DIR-NOTFOUND
-- Triclops_LIBRARY=Triclops_LIBRARY-NOTFOUND
-- FlyCaptureBridge_LIBRARY=FlyCaptureBridge_LIBRARY-NOTFOUND
-- Found CUDA: /usr/local/cuda-10.0 (found suitable exact version "10.0")
-- Found ZED sdk: /usr/local/zed/include
-- Found CUDA: /usr/local/cuda-10.0 (found version "10.0")
-- Found CUDA: /usr/local/cuda-10.0/include
-- Found RealSense2:
-- Found octomap 1.8.1: /opt/ros/kinetic/include
-- Found Pthreads

-- --------------------------------------------
-- Info :
--   Version : 0.18.3
--   CMAKE_INSTALL_PREFIX = /home/wang/rtabmap_ws/devel
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp -std=c++11
--   FLANN_KDTREE_MEM_OPT = OFF
--   PCL_DEFINITIONS = -DEIGEN_USE_NEW_STDVECTOR;-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET;-DFLANN_STATIC;-Dqh_QHpointer
-- Optional dependencies ('*' affects some default parameters) :
--  *With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = YES (License: Non commercial)
--   With external SQLite3     = YES (License: Public Domain)
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)
--   With OpenNI2              = NO (OpenNI2 not found)
--   With Freenect2            = YES (License: Apache v2 and/or GPLv2)
--   With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)
--   With dc1394               = YES (License: LGPL)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--  *With g2o                  = YES (License: BSD)
--  *With GTSAM                = YES (License: BSD)
--   With VERTIGO              = YES (License: GPLv3)
--   With cvsba                = NO (cvsba not found)
--  *With libpointmatcher      = NO (libpointmatcher not found)
--   With loam_velodyne        = NO (loam_velodyne not found)
--   With ZED                  = YES (With CUDA)
--   With RealSense            = NO (librealsense not found)
--   With RealSense2           = YES (License: Apache-2)
--   With OCTOMAP              = YES (License: BSD)
--   With CPUTSDF              = NO (CPUTSDF not found)
--   With OpenChisel           = NO (open_chisel not found)
--   With libfovis             = NO (libfovis not found)
--   With libviso2             = NO (libviso2 not found)
--   With dvo_core             = NO (dvo_core not found)
--   With okvis                = NO (okvis not found)
--   With msckf_vio            = NO (WITH_MSCKF_VIO=OFF)
--   With ORB_SLAM2            = NO (WITH_G2O should be OFF as ORB_SLAM2 uses its own g2o version)
--   With Qt5                  = YES (License: Open Source or Commercial)
-- --------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wang/rtabmap/rtabmap/build

The step of my install
1.I clone the g2o of c++03 branch.
mkdir build
cd build
cmake ../
make

I didn't install the g2o, should I? and I didn't cmake with -DBUILD_WITH_MARCH_NATIVE=OFF, should I? what I get from the instruction tell me I should add -DBUILD_WITH_MARCH_NATIVE=OFF only when i use the latest official g2o.
As you can see from the information of output:
-- Old g2o version detected with c++03 interface (config file: /opt/ros/kinetic/include/g2o/config.h).
-- Found g2o: /opt/ros/kinetic/include;/usr/include/suitesparse;/usr/include/suitesparse
The g2o be found seems like the g2o come with the ros kinetic.Is it the problem?

2.I clone the gtsam and check the branch is dev, i didn't change it.
$ mkdir build
$ cd build
$ cmake ..
$ make check
$ make instal

Other steps are just as the instruction said.
Reply | Threaded
Open this post in threaded view
|

Re: error while loading shared libraries: libgtsam.so.4

matlabbe
Administrator
g2o from kinetic is fine. For the gtsam error:
libgtsam.so.4: cannot open shared object file: No such file or directory 

Is libgtsam.so.4 installed in /usr/local/lib? Can you try updating ldconfig?
$ sudo ldconfig

Then try relaunch rtabmap.

Reply | Threaded
Open this post in threaded view
|

Re: error while loading shared libraries: libgtsam.so.4

TouchDeeper
Amazing, it works.
after i run
$ sudo idconfig
 The rtabmap run well.
 
An unrelated question,
The method of formatting the code such as '$ sudo ldconfig' is what? This looks more elegant. The method you posted on the topic "Welcome! (and code snippet formatting example!)" is not effective to me.
Reply | Threaded
Open this post in threaded view
|

Re: error while loading shared libraries: libgtsam.so.4

matlabbe
Administrator
I use the "raw" xml tag more often, you can also click on More->"Raw text" when editing a question.
Reply | Threaded
Open this post in threaded view
|

Re: error while loading shared libraries: libgtsam.so.4

TouchDeeper
In reply to this post by TouchDeeper
Hi,matlabbe
It works. Thanks a lot!
$ sudo idconfig