ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

catkin_make install fails to install the executable correctly

asked 2013-03-10 14:48:11 -0500

dejanpan gravatar image

updated 2013-03-11 12:00:31 -0500

William gravatar image

Hi there, we are using the below attached CMakeLists.txt to build a simple executable. Building works OK and we can also successfully run it from the devel folder (devel/lib/lawnmower_intrudor_detector/intrudor_detector_node). However after we install the executable using the "catkin_make install" command into the install/lib/lawnmower_intrudor_detector/intrudor_detector_node, the shared libraries the executable is linking against are not found anymore:

./intrudor_detector_node: error while loading shared libraries: libpcl_common.so.1.7: cannot open shared object file: No such file or directory

We verified and the 2 executables (in devel and install) indeed have different checksums - which to the best of our knowledge should not happen, right?

Using: ROS Groovy, Ubuntu 12.04

CMakeLists.txt is below. Please note that the install macro does not work when passed in the name of the package, hence only executable.

cmake_minimum_required(VERSION 2.8.3)
project(lawnmower_intrudor_detector)

find_package(catkin REQUIRED COMPONENTS laser_geometry roscpp sensor_msgs tf)

## System dependencies are found with CMake's conventions
#find_package(PCL 1.6.1 REQUIRED)
find_package(PCL 1.7.0 REQUIRED)

catkin_package(
   INCLUDE_DIRS include
   CATKIN_DEPENDS laser_geometry roscpp sensor_msgs tf
   DEPENDS eigen
)

## Specify additional locations of header files
include_directories(include
  ${catkin_INCLUDE_DIRS} 
  ${PCL_INCLUDE_DIRS}
)

## Declare a cpp executable
add_executable(intrudor_detector_node src/intrudor_detector.cpp)

## Add dependencies to the executable
# add_dependencies(lawnmower_intrudor_detector_node ${PROJECT_NAME})

target_link_libraries(intrudor_detector_node
  ${catkin_LIBRARIES}
  ${PCL_LIBRARIES}
)

install(TARGETS intrudor_detector_node
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

Update: PCL_LIBRARIES are as follows: http://pastebin.com/cWTf0cjr . The weird thing about it is that there is no semicolons delimiting the respective library.

Update 2: ldd output for both executables in devel and install workspaces as follows: http://pastebin.com/ZpQBhUdJ . In install workspace pcl_common* is not found anymore.

edit retag flag offensive close merge delete

Comments

Does it also not work if you cd into the build directory and run make install ?

jbohren gravatar image jbohren  ( 2013-03-10 15:02:19 -0500 )edit

To clarify, catkin_make doesn't install the file, catkin_make just runs CMake and Make together as a convenience. You can reproduce this without catkin_make with 'mkdir build && cd build && cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_PREFIX=../devel && make <target>'

William gravatar image William  ( 2013-03-11 08:36:14 -0500 )edit

These are unrelated to your question, but your CMakeLists.txt find_package(...)'s PCL but does not export it in catkin_package(...) (this may or may not be desired), and you DEPEND on eigen, but never find_package(...) it, which is likely not desired behavior.

William gravatar image William  ( 2013-03-11 08:40:18 -0500 )edit

@Jon: yes, it does NOT work with cd-ing into build and running make install as well.

dejanpan gravatar image dejanpan  ( 2013-03-11 11:04:40 -0500 )edit

Jon, we found out that it works if append the path to the PCL libraries before: "export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}". Note that we compilled PCL ourselves and make installed it into /usr/local.

dejanpan gravatar image dejanpan  ( 2013-03-11 11:10:15 -0500 )edit

@dejanpan can you output PCL_LIBRARIES and post it here? It seems like the only way the above comment fixes it is if PCL does not return absolute path libraries.

William gravatar image William  ( 2013-03-11 11:12:25 -0500 )edit

@William: I updated the question with the PCL_LIBRARIES message status. Weird thing is that the libraries are not delimited by the semicolon. Is that a problem?

dejanpan gravatar image dejanpan  ( 2013-03-11 11:32:03 -0500 )edit
William gravatar image William  ( 2013-03-11 11:36:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-03-11 14:19:31 -0500

dejanpan gravatar image

The solution: run "sudo ldconfig" command. Now the pcl_common is found and the executable correctly executed. Though we are still not sure why the ldconfig would need to be ran manually.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-10 14:48:11 -0500

Seen: 2,051 times

Last updated: Mar 11 '13