CCNYRoboticsLab / ccny_rgbd_tools

ccny_rgbd_tools
GNU Lesser General Public License v3.0
125 stars 76 forks source link

Issues with librgbdtools compilation. #43

Closed tanmayshankar closed 9 years ago

tanmayshankar commented 9 years ago

Hey,

I am trying to compile ccny_rgbd_tools (master branch) on ROS Hydro, ubuntu 12.04. (After struggling with issue #42 ).

I run the rosdep install command, and it installs libg2o. (ros-hydro-libg2o). Then I get these errors:

Linking CXX shared library lib/librgbdtools.so make[3]: Leaving directory /home/tanmay/hydro_workspace/sisl_sandbox/ccny_rgbd_tools/lib_rgbdtools/rgbdtools_git/build' [ 87%] Built target rgbdtools make[3]: Entering directory/home/tanmay/hydro_workspace/sisl_sandbox/ccny_rgbd_tools/lib_rgbdtools/rgbdtools_git/build' Scanning dependencies of target global_cloud_align make[3]: Leaving directory /home/tanmay/hydro_workspace/sisl_sandbox/ccny_rgbd_tools/lib_rgbdtools/rgbdtools_git/build' make[3]: Entering directory/home/tanmay/hydro_workspace/sisl_sandbox/ccny_rgbd_tools/lib_rgbdtools/rgbdtools_git/build' [ 93%] Building CXX object CMakeFiles/global_cloud_align.dir/apps/global_cloud_align.cpp.o Linking CXX executable bin/global_cloud_align lib/librgbdtools.so: error: undefined reference to 'g2o::get_monotonic_time()' lib/librgbdtools.so: error: undefined reference to 'cs_di_sfree' lib/librgbdtools.so: error: undefined reference to 'cs_di_schol' lib/librgbdtools.so: error: undefined reference to 'cs_di_amd' lib/librgbdtools.so: error: undefined reference to 'cs_di_free' lib/librgbdtools.so: error: undefined reference to 'cs_di_calloc' lib/librgbdtools.so: error: undefined reference to 'cs_di_pinv' lib/librgbdtools.so: error: undefined reference to 'cs_di_symperm' lib/librgbdtools.so: error: undefined reference to 'cs_di_etree' lib/librgbdtools.so: error: undefined reference to 'cs_di_post' lib/librgbdtools.so: error: undefined reference to 'cs_di_counts' lib/librgbdtools.so: error: undefined reference to 'cs_di_spfree' lib/librgbdtools.so: error: undefined reference to 'cs_di_malloc' lib/librgbdtools.so: error: undefined reference to 'cs_di_cumsum' lib/librgbdtools.so: error: undefined reference to 'cs_di_nfree'

When I remove libg2o and run rosmake --pre-clean, it cannot find some header files. I tried manually including these, but it still comes up as errors.

[ 87%] Building CXX object CMakeFiles/rgbdtools.dir/src/graph/keyframe_graph_solver_g2o.cpp.o In file included from /home/tanmay/hydro_workspace/sisl_sandbox/ccny_rgbd_tools/lib_rgbdtools/rgbdtools_git/src/graph/keyframe_graph_solver_g2o.cpp:24:0: /home/tanmay/hydro_workspace/sisl_sandbox/ccny_rgbd_tools/lib_rgbdtools/rgbdtools_git/include/rgbdtools/graph/keyframe_graph_solver_g2o.h:27:39: fatal error: g2o/core/sparse_optimizer.h: No such file or directory

Any suggestions as to how I can solve this inconsistency, guys? @idryanov

Thanks in advance!

EDIT 1: I managed to sort out the g2o::get_monotonic_time() error by compiling this along with ccny_g2o , after setting up CMakeLists accordingly.

tanmayshankar commented 9 years ago

Hello everyone,

I managed to successfully compile the package. Here is what was going wrong -

The issue was primarily with the linking of the libraries in CMake, and with dependencies / paths of the libraries installed. I first went through CMake documentation thoroughly, especially using external libraries with and without existing cmake modules. I then set the variables that FIND_PACKAGE is supposed to set (for example, G2O_INCLUDE_DIR, SUITEPARSE_INCLUDE_DIR, etc.), accordingly.

I also explicitly linking cxsparse and some of the G2O libraries with my executables, since they weren't getting linked (by the looks of it), using target_link (${G2O_LIBRARIES}), etc. I really advise anyone facing similar issues to go through how Cmake works first.