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

Problems migrating to Jade -> cannot find -l:/usr/lib/.../*.so

asked 2016-03-18 08:40:50 -0500

mhar gravatar image

updated 2016-03-31 09:47:03 -0500

I am trying to migrate a project from Indigo to Jade. When I run catkin_make I get cannot find -l: errors (output below).

I am running ubuntu 15.04 and installed ROS Jade via the package manager. As it looks like it might be a problem with ld I am using version 2.25

The installation of ROS appears to be fine. I do not have the problem if I create a new project with subscribers and publishers like the ROS tutorials

Does anyone have any ideas?

$ catkin_make
Base path: /home/**/catkin_ws
Source space: /home/**/catkin_ws/src
Build space: /home/**/catkin_ws/build
Devel space: /home/**/catkin_ws/devel
Install space: /home/**/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/**/catkin_ws/build"
####
####
#### Running command: "make -j8 -l8" in "/home/**/catkin_ws/build"
####
...
...
[  6%] Linking CXX executable ../../../../bin/a1
Building CXX object ../../../CMakeFiles/f.dir/dt.cxx.o
[  6%] /usr/bin/ld: cannot find -l:/usr/lib/x86_64-linux-gnu/libboost_signals.so
/usr/bin/ld: cannot find -l:/usr/lib/x86_64-linux-gnu/libboost_filesystem.so
/usr/bin/ld: cannot find -l:/usr/lib/x86_64-linux-gnu/libboost_system.so
...
collect2: error: ld returned 1 exit status
../../../../CMakeFiles/sc.dir/build.make:119: recipe for target 'bin/sc' failed
make[2]: *** [bin/sc] Error 1
CMakeFiles/Makefile2:1648: recipe for target '../../../../CMakeFiles/sc.dir/all' failed
make[1]: *** [../../../../CMakeFiles/sc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
...
...

All the libraries it mentions are installed. For example

$ apt-cache policy libboost-signals-dev 
libboost-signals-dev:
  Installed: 1.55.0.2
  Candidate: 1.55.0.2
  Version table:
 *** 1.55.0.2 0
        500 http://us.archive.ubuntu.com/ubuntu/ vivid/universe amd64 Packages
        100 /var/lib/dpkg/status

CMakeLists.txt

The package is split up into many sub directories. So what follows below is the main package CMakeLists and then an example of one of the sub directory packages that is failing

cmake_minimum_required(VERSION 2.8.3)
project(main)

find_package(catkin REQUIRED COMPONENTS message_generation rospy)

catkin_package(CATKIN_DEPENDS roscpp)

...

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")

...

set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}
)

catkin_python_setup()

add_subdirectory(dir1)
add_subdirectory(dir2)
add_subdirectory(sc)
add_subdirectory(dir4)
add_subdirectory(dir5)

Example sub directory CMakeLists.txt. This is just one of many that are failing:

cmake_minimum_required(VERSION 2.4.6)

# Find ros dependencies...
include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
pkg_check_modules(ros-roscpp REQUIRED roscpp)
pkg_check_modules(ros-cv_bridge REQUIRED cv_bridge)
pkg_check_modules(ros-image_transport REQUIRED image_transport)

set( sc_srcs
  main.cpp
  ScNode.cpp
  ${sc_moc_files} 
)

set( sc_hrs
  ScNode.h
)

# All ros libs are in the same directory
# so we just list one of them here
link_directories(
  ${ros-roscpp_LIBRARY_DIRS}
)

set( sc_libs
  ${ros-roscpp_LIBRARIES}
  ${ros-cv_bridge_LIBRARIES}
  ${ros-image_transport_LIBRARIES}
)

include_directories(
  ${ros-roscpp_conversions_INCLUDE_DIRS}
)

add_executable(sc ${sc_srcs} ${sc_hdrs})
target_link_libraries(sc ${sc_libs})
set_target_properties(sc PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
edit retag flag offensive close merge delete

Comments

Did you try to install dependencies of your packages via rosdep update / rosdep install mypkg ?

al-dev gravatar image al-dev  ( 2016-03-18 14:31:27 -0500 )edit

Yes I have - no joy there

mhar gravatar image mhar  ( 2016-03-18 15:07:48 -0500 )edit

Can you edit your post to include your CMakeLists.txt ?

al-dev gravatar image al-dev  ( 2016-03-18 16:10:00 -0500 )edit

Sure, done

mhar gravatar image mhar  ( 2016-03-18 17:03:52 -0500 )edit

I am just a bit confused by your example package CMakeLists.txt, is it intended to be used by catkin ? It does not contain any catkin instructions. Usually linking your targets against ${catkin_LIBRARIES} does the job for a catkin package.. Did you say this compiled with catkin on Indigo?

al-dev gravatar image al-dev  ( 2016-03-18 17:16:47 -0500 )edit

@al-dev: that is not the CMakeLists.txt from the package, but of the workspace itself. @mhar: @al-dev asked for the CMakeLists.txt of the package that's giving you problems.

gvdhoorn gravatar image gvdhoorn  ( 2016-03-19 02:54:34 -0500 )edit

I think I've given you the right CMakeLists.txt now.
@al-dev yes it complies fine with catkin on Indigo - hopefully it makes more sense now

The project is split into sub directories - so I've given you the main project CMakeLists.txt and then one of the sub directories

mhar gravatar image mhar  ( 2016-03-19 12:42:45 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-03-31 12:51:43 -0500

mhar gravatar image

Problem solved

The problem is less to do with the upgrade from Indigo to Jade and more about the ld version. Our older build (indigo) is still using rosbuild package config definitions (pkg_check_modules(...). As the upgraded system uses a newer version of ld (version 2.25) these rosbuild definitions were breaking.

The problem was solved by using catkin

For example:

include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
pkg_check_modules(ros-roscpp REQUIRED roscpp)
pkg_check_modules(ros-cv_bridge REQUIRED cv_bridge)
pkg_check_modules(ros-image_transport REQUIRED image_transport)

becomes

find_package(catkin REQUIRED COMPONENTS cv_bridge image_transport)

Further detail

The package config files provides paths to that are incompatible with newer versions of ld. In versions 2.25 and greater the Libs path, in the form -l:/full/path/to/library.so no longer works. Instead the newer version of ld expects the path in the form -l:library. More information can be found here: https://github.com/ros/catkin/issues/694

The problem has been resolved in some of the magic under catkin. In find_package(catkin..) catkin looks up the pkgconfig file and fixes the paths under Libs.

edit flag offensive delete link more
0

answered 2016-03-19 22:20:57 -0500

al-dev gravatar image

I am not using Jade myself so other users may be more helpful here but as a tentative solution, I would search for the problematic libraries on the system and then create symbolic links, e.g find /usr/lib/ -name "*boost_signal*" and then sudo ln -s path_to_file /usr/lib/x86_64-linux-gnu/libboost_signals.so .

If you cannot find any library with that name on the system, you should probably install it first.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-03-18 08:40:50 -0500

Seen: 414 times

Last updated: Mar 31 '16