Ask Your Question
0

catkin_make_isolated has trouble finding libraries

asked 2013-06-27 10:58:32 -0500

ahendrix gravatar image

I'm following the documentation to build a package that exports C++ headers and a library ( http://ros.org/doc/groovy/api/catkin/html/howto/building_libraries.html ).

It builds fine with catkin_make, but dependent packages to build with catkin_make_isolated. What am I doing wrong?

My CMakeLists.txt contains:

# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
cmake_minimum_required(VERSION 2.8.3)
project(pr2_mechanism_model)

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS roscpp pr2_hardware_interface urdf urdfdom kdl_parser pluginlib angles hardware_interface rostest rosunit)

find_package(Eigen REQUIRED)
include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS})
include_directories(include ${catkin_INCLUDE_DIRS})

add_library( pr2_mechanism_model
  src/joint.cpp
  src/robot.cpp
  src/chain.cpp
  src/tree.cpp
  src/simple_transmission.cpp
  src/pr2_gripper_transmission.cpp
  src/wrist_transmission.cpp
  src/pr2_belt_transmission.cpp
  src/joint_calibration_simulator.cpp
)

catkin_package(
    DEPENDS tinyxml urdfdom
    CATKIN_DEPENDS roscpp pr2_hardware_interface urdf kdl_parser pluginlib angles hardware_interface
    INCLUDE_DIRS include
    LIBRARIES pr2_mechanism_model
)

install(DIRECTORY include/${PACKAGE_NAME}/
   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(TARGETS pr2_mechanism_model
   RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

The package itself builds fine, but any package that tries to find_package() it fails to build under catkin_make_isolated with an error like:

==> Processing catkin package: 'pr2_controller_interface'
==> Building with env: '/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_mechanism_model/env.sh'
==> cmake /wg/stor2a/ahendrix/hydro/src/pr2_mechanism/pr2_controller_interface -DCATKIN_DEVEL_PREFIX=/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_controller_interface -DCMAKE_INSTALL_PREFIX=/wg/stor2a/ahendrix/hydro/install_isolated in '/wg/stor2a/ahendrix/hydro/build_isolated/pr2_controller_interface'
-- Using CATKIN_DEVEL_PREFIX: /wg/stor2a/ahendrix/hydro/devel_isolated/pr2_controller_interface
-- Using CMAKE_PREFIX_PATH: /wg/stor2a/ahendrix/hydro/devel_isolated/pr2_mechanism_model;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_mechanism;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_machine;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_hardware_interface;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_description;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_dashboard_aggregator;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_common;/wg/stor2a/ahendrix/hydro/devel_isolated/position_controllers;/wg/stor2a/ahendrix/hydro/devel_isolated/map_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/forward_command_controller;/wg/stor2a/ahendrix/hydro/devel_isolated/controller_interface;/wg/stor2a/ahendrix/hydro/devel_isolated/hardware_interface;/wg/stor2a/ahendrix/hydro/devel_isolated/controllers_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/controller_manager_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/control_toolbox;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_play;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_capture;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_common_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_common;/opt/ros/hydro
-- This workspace overlays: /wg/stor2a/ahendrix/hydro/devel_isolated/pr2_mechanism_model;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_mechanism;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_machine;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_hardware_interface;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_description;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_dashboard_aggregator;/wg/stor2a/ahendrix/hydro/devel_isolated/pr2_common;/wg/stor2a/ahendrix/hydro/devel_isolated/position_controllers;/wg/stor2a/ahendrix/hydro/devel_isolated/map_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/forward_command_controller;/wg/stor2a/ahendrix/hydro/devel_isolated/controller_interface;/wg/stor2a/ahendrix/hydro/devel_isolated/hardware_interface;/wg/stor2a/ahendrix/hydro/devel_isolated/controllers_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/controller_manager_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/control_toolbox;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_play;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_capture;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_common_msgs;/wg/stor2a/ahendrix/hydro/devel_isolated/audio_common;/opt/ros/hydro
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using CATKIN_TEST_RESULTS_DIR: /wg/stor2a/ahendrix/hydro/build_isolated/pr2_controller_interface/test_results
-- catkin 0.5.67
CMake Error at ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-06-27 11:13:53 -0500

Dirk Thomas gravatar image

updated 2013-06-27 11:14:17 -0500

Your library ends up in the wrong location under build - it should be under devel/lib.

The reason is that you invoke catkin_package after add_library. catkin_package sets the default destination for all kind of targets and must therefore be called before add_library.

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

Stats

Asked: 2013-06-27 10:58:32 -0500

Seen: 918 times

Last updated: Jun 27 '13