ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

catkin_make install fails to install the executable correctly

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

dejanpan gravatar image

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

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: 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)

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)

   INCLUDE_DIRS include
   CATKIN_DEPENDS laser_geometry roscpp sensor_msgs tf
   DEPENDS eigen

## Specify additional locations of header files

## 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})


install(TARGETS intrudor_detector_node

Update: PCL_LIBRARIES are as follows: . 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: . In install workspace pcl_common* is not found anymore.

edit retag flag offensive close merge delete


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 -0600 )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 -0600 )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 -0600 )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 -0600 )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 -0600 )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 -0600 )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 -0600 )edit
William gravatar image William  ( 2013-03-11 11:36:49 -0600 )edit

1 Answer

Sort by » oldest newest most voted

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


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

Seen: 1,973 times

Last updated: Mar 11 '13