2016-02-12

Hi all,

I am trying to compile a package based on the lccp_segmentation algorithm available in the pcl-trunk. The compilation and installation of the pcl-trunk were fine since I have the same version of the package in a simple .cpp file (not in ROS), and I can compile everything with no problems. But when I try to compile my ROS package it seems to be a conflict between PCL 1.7 and 1.8, since the output in the terminal is something like:

link library [libpcl_common.so] in /usr/lib may be hidden by files in: /usr/local/lib

Which I guess it yields to the following error:

*** No rule to make target `/usr/lib/libboost_system-mt.so', needed by `/home/nicola/ros_ws/master_thesis/devel/lib/segmentation_lccp/segmentationLCCP'

My setup is:
- Ubuntu 14.04.3 LTS
- Ros indigo
- PCL (1.7 and 1.8 are both installed)

I have just a very basic knowledge about the linking stuff and cmake, I also surfed a lot in the internet but none had my same problem. I hope to have gave you enough information, below there are the outputs of the catkin_make and cmake commands of the above commented source codes.

Thanks in advance,

Here the output of the catkin_make command:

catkin_make --only-pkg-with-deps segmentation_lccp
Base path: /home/nicola/ros_ws/master_thesis
Source space: /home/nicola/ros_ws/master_thesis/src
Build space: /home/nicola/ros_ws/master_thesis/build
Devel space: /home/nicola/ros_ws/master_thesis/devel
Install space: /home/nicola/ros_ws/master_thesis/install
Whitelisted packages: segmentation_lccp
####
#### Running command: "make cmake_check_build_system" in "/home/nicola/ros_ws/master_thesis/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/nicola/ros_ws/master_thesis/devel
-- Using CMAKE_PREFIX_PATH: /home/nicola/ros_ws/master_thesis/devel;/opt/ros/indigo
-- This workspace overlays: /home/nicola/ros_ws/master_thesis/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/nicola/ros_ws/master_thesis/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests
-- catkin 0.6.16
-- BUILD_SHARED_LIBS is on
-- Using CATKIN_WHITELIST_PACKAGES: segmentation_lccp
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - segmentation_lccp
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'segmentation_lccp'
-- ==> add_subdirectory(grasping_novel_objects/segmentation_lccp)
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
-- serialization
-- checking for module 'libopenni2'
-- package 'libopenni2' not found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
** WARNING ** io features related to openni2 will be disabled
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** io features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** io features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** io features related to dssdk will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
-- checking for module 'libopenni2'
-- package 'libopenni2' not found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
** WARNING ** visualization features related to openni2 will be disabled
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** visualization features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** visualization features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** visualization features related to dssdk will be disabled
-- Could NOT find RSSDK (missing: _RSSDK_LIBRARIES)
** WARNING ** visualization features related to rssdk will be disabled
-- looking for PCL_COMMON
-- looking for PCL_OCTREE
-- looking for PCL_IO
-- looking for PCL_STEREO
-- looking for PCL_KDTREE
-- looking for PCL_SEARCH
-- looking for PCL_SAMPLE_CONSENSUS
-- looking for PCL_FILTERS
-- looking for PCL_TRACKING
-- looking for PCL_2D
-- looking for PCL_FEATURES
-- looking for PCL_SURFACE
-- looking for PCL_GEOMETRY
-- looking for PCL_ML
-- looking for PCL_SEGMENTATION
-- looking for PCL_VISUALIZATION
-- looking for PCL_REGISTRATION
-- looking for PCL_KEYPOINTS
-- looking for PCL_RECOGNITION
-- looking for PCL_PEOPLE
-- looking for PCL_OUTOFCORE
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
-- segmentation_lccp: 2 messages, 1 services
-- Configuring done
CMake Warning at grasping_novel_objects/segmentation_lccp/CMakeLists.txt:123 (add_executable):
Cannot generate a safe linker search path for target segmentationLCCP
because files in some directories may conflict with libraries in implicit
directories:

link library [libpcl_common.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_octree.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_io.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_kdtree.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_search.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_sample_consensus.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_filters.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_tracking.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_features.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_surface.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_segmentation.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_visualization.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_registration.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_keypoints.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_recognition.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_people.so] in /usr/lib may be hidden by files in:
/usr/local/lib
link library [libpcl_outofcore.so] in /usr/lib may be hidden by files in:
/usr/local/lib

Some of these libraries may not be found correctly.

-- Generating done
-- Build files have been written to: /home/nicola/ros_ws/master_thesis/build
####
#### Running command: "make -j4 -l4" in "/home/nicola/ros_ws/master_thesis/build"
####
[ 0%] Built target sensor_msgs_generate_messages_lisp
[ 0%] Built target visualization_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target _segmentation_lccp_generate_messages_check_deps_filtered_object
[ 0%] [ 0%] Built target visualization_msgs_generate_messages_cpp
Built target _segmentation_lccp_generate_messages_check_deps_segmentationLCCP
make[2]: *** No rule to make target `/usr/lib/libboost_system-mt.so', needed by `/home/nicola/ros_ws/master_thesis/devel/lib/segmentation_lccp/segmentationLCCP'. Stop.
make[1]: *** [grasping_novel_objects/segmentation_lccp/CMakeFiles/segmentationLCCP.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 0%] Built target _segmentation_lccp_generate_messages_check_deps_Objects
[ 0%] [ 0%] Built target sensor_msgs_generate_messages_cpp
Built target std_msgs_generate_messages_cpp
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

The CMakeLists.txt is:

cmake_minimum_required(VERSION 2.8.3)
project(segmentation_lccp)

find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
tf
sensor_msgs
message_generation
message_runtime
visualization_msgs
)

find_package( PCL 1.8 REQUIRED )
find_package( OpenCV REQUIRED )

## System dependencies are found with CMake's conventions
set(Boost_REALPATH ON)
find_package(Boost 1.54 REQUIRED COMPONENTS system)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()

add_message_files(
FILES
filtered_object.msg
Objects.msg
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
visualization_msgs
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES LCCP_segmentation
CATKIN_DEPENDS roscpp tf rospy std_msgs message_runtime message_generation sensor_msgs
# DEPENDS system_lib
)
include_directories(
./include
${PCL_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)

link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable(segmentationLCCP src/segmentationLCCP.cpp src/DetectObjectsOnTable.cpp src/LCCP.cpp src/Segmentation.cpp src/smooth_pcl_mls.cpp src/fill_occluded_sides.cpp)
add_dependencies(segmentationLCCP LCCP_segmentation_generate_messages_cpp)
target_link_libraries(segmentationLCCP
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
)

I report here also the output of cmake command of the other executable which is not based on ROS and which works fine:

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- checking for module 'eigen3'
-- found eigen3, version 3.2.0
-- Found eigen: /usr/include/eigen3
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
-- serialization
-- checking for module 'libopenni'
-- found libopenni, version 1.5.4.0
-- Found openni: /usr/lib/libOpenNI.so
-- checking for module 'libopenni2'
-- package 'libopenni2' not found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
** WARNING ** io features related to openni2 will be disabled
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** io features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** io features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** io features related to dssdk will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- Found libusb-1.0: /usr/include
** WARNING ** io features related to libusb-1.0 will be disabled
-- checking for module 'flann'
-- found flann, version 1.8.4
-- Found Flann: /usr/lib/x86_64-linux-gnu/libflann_cpp_s.a
-- Found qhull: /usr/lib/x86_64-linux-gnu/libqhull.so
-- checking for module 'libopenni2'
-- package 'libopenni2' not found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
** WARNING ** visualization features related to openni2 will be disabled
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** visualization features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** visualization features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** visualization features related to dssdk will be disabled
-- Could NOT find RSSDK (missing: _RSSDK_LIBRARIES)
** WARNING ** visualization features related to rssdk will be disabled
-- looking for PCL_COMMON
-- Found PCL_COMMON: /usr/local/lib/libpcl_common.so
-- looking for PCL_OCTREE
-- Found PCL_OCTREE: /usr/local/lib/libpcl_octree.so
-- looking for PCL_IO
-- Found PCL_IO: /usr/local/lib/libpcl_io.so
-- looking for PCL_STEREO
-- Found PCL_STEREO: /usr/local/lib/libpcl_stereo.so
-- looking for PCL_KDTREE
-- Found PCL_KDTREE: /usr/local/lib/libpcl_kdtree.so
-- looking for PCL_SEARCH
-- Found PCL_SEARCH: /usr/local/lib/libpcl_search.so
-- looking for PCL_SAMPLE_CONSENSUS
-- Found PCL_SAMPLE_CONSENSUS: /usr/local/lib/libpcl_sample_consensus.so
-- looking for PCL_FILTERS
-- Found PCL_FILTERS: /usr/local/lib/libpcl_filters.so
-- looking for PCL_TRACKING
-- Found PCL_TRACKING: /usr/local/lib/libpcl_tracking.so
-- looking for PCL_2D
-- Found PCL_2D: /usr/local/include/pcl-1.8
-- looking for PCL_FEATURES
-- Found PCL_FEATURES: /usr/local/lib/libpcl_features.so
-- looking for PCL_SURFACE
-- Found PCL_SURFACE: /usr/local/lib/libpcl_surface.so
-- looking for PCL_GEOMETRY
-- Found PCL_GEOMETRY: /usr/local/include/pcl-1.8
-- looking for PCL_ML
-- Found PCL_ML: /usr/local/lib/libpcl_ml.so
-- looking for PCL_SEGMENTATION
-- Found PCL_SEGMENTATION: /usr/local/lib/libpcl_segmentation.so
-- looking for PCL_VISUALIZATION
-- Found PCL_VISUALIZATION: /usr/local/lib/libpcl_visualization.so
-- looking for PCL_REGISTRATION
-- Found PCL_REGISTRATION: /usr/local/lib/libpcl_registration.so
-- looking for PCL_KEYPOINTS
-- Found PCL_KEYPOINTS: /usr/local/lib/libpcl_keypoints.so
-- looking for PCL_RECOGNITION
-- Found PCL_RECOGNITION: /usr/local/lib/libpcl_recognition.so
-- looking for PCL_PEOPLE
-- Found PCL_PEOPLE: /usr/local/lib/libpcl_people.so
-- looking for PCL_OUTOFCORE
-- Found PCL_OUTOFCORE: /usr/local/lib/libpcl_outofcore.so
-- Found PCL: /usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/local/lib/libpcl_common.so;debug;/usr/local/lib/libpcl_common.so;optimized;/usr/local/lib/libpcl_octree.so;debug;/usr/local/lib/libpcl_octree.so;/usr/lib/libOpenNI.so;vtkCommon;vtkFiltering;vtkImaging;vtkGraphics;vtkGenericFiltering;vtkIO;vtkRendering;vtkVolumeRendering;vtkHybrid;vtkWidgets;vtkParallel;vtkInfovis;vtkGeovis;vtkViews;vtkCharts;optimized;/usr/local/lib/libpcl_io.so;debug;/usr/local/lib/libpcl_io.so;optimized;/usr/local/lib/libpcl_stereo.so;debug;/usr/local/lib/libpcl_stereo.so;optimized;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;debug;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;optimized;/usr/local/lib/libpcl_kdtree.so;debug;/usr/local/lib/libpcl_kdtree.so;optimized;/usr/local/lib/libpcl_search.so;debug;/usr/local/lib/libpcl_search.so;optimized;/usr/local/lib/libpcl_sample_consensus.so;debug;/usr/local/lib/libpcl_sample_consensus.so;optimized;/usr/local/lib/libpcl_filters.so;debug;/usr/local/lib/libpcl_filters.so;optimized;/usr/local/lib/libpcl_tracking.so;debug;/usr/local/lib/libpcl_tracking.so;optimized;/usr/local/lib/libpcl_features.so;debug;/usr/local/lib/libpcl_features.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;optimized;/usr/local/lib/libpcl_surface.so;debug;/usr/local/lib/libpcl_surface.so;optimized;/usr/local/lib/libpcl_ml.so;debug;/usr/local/lib/libpcl_ml.so;optimized;/usr/local/lib/libpcl_segmentation.so;debug;/usr/local/lib/libpcl_segmentation.so;optimized;/usr/local/lib/libpcl_visualization.so;debug;/usr/local/lib/libpcl_visualization.so;optimized;/usr/local/lib/libpcl_registration.so;debug;/usr/local/lib/libpcl_registration.so;optimized;/usr/local/lib/libpcl_keypoints.so;debug;/usr/local/lib/libpcl_keypoints.so;optimized;/usr/local/lib/libpcl_recognition.so;debug;/usr/local/lib/libpcl_recognition.so;optimized;/usr/local/lib/libpcl_people.so;debug;/usr/local/lib/libpcl_people.so;optimized;/usr/local/lib/libpcl_outofcore.so;debug;/usr/local/lib/libpcl_outofcore.so;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;/usr/lib/libOpenNI.so;optimized;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;debug;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;vtkCommon;vtkFiltering;vtkImaging;vtkGraphics;vtkGenericFiltering;vtkIO;vtkRendering;vtkVolumeRendering;vtkHybrid;vtkWidgets;vtkParallel;vtkInfovis;vtkGeovis;vtkViews;vtkCharts (Required is at least version "1.8")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nicola/Codes/LCCP_segmentation/lccp-segmentation/build
nicola@nicola-Aspire-E5-571:~/Codes/LCCP_segmentation/lccp-segmentation/build$ make
Scanning dependencies of target LCCP
[ 16%] Building CXX object CMakeFiles/LCCP.dir/src/LCCP.cpp.o
[ 33%] Building CXX object CMakeFiles/LCCP.dir/src/DetectObjectsOnTable.cpp.o
[ 50%] Building CXX object CMakeFiles/LCCP.dir/src/Segmentation.cpp.o
Linking CXX executable ../bin/LCCP
[ 50%] Built target LCCP
Scanning dependencies of target example_lccp_segmentation
[ 66%] Building CXX object CMakeFiles/example_lccp_segmentation.dir/src/example_lccp_segmentation.cpp.o
[ 83%] Building CXX object CMakeFiles/example_lccp_segmentation.dir/src/removeTable.cpp.o
Linking CXX executable ../bin/example_lccp_segmentation
[ 83%] Built target example_lccp_segmentation
Scanning dependencies of target example_lccp_segmentation_new
[100%] Building CXX object CMakeFiles/example_lccp_segmentation_new.dir/src/example_lccp_segmentation_new.cpp.o
Linking CXX executable ../bin/example_lccp_segmentation_new
[100%] Built target example_lccp_segmentation_new

The CMakeLists.txt of this one is the same of the one reported concerning the PCL stuff.

Show more