Bug #1424

rst-convertersConfig.cmake needs to expose library dependencies for all dependencies

Added by Anonymous about 11 years ago. Updated almost 11 years ago.

Status:ResolvedStart date:02/19/2013
Priority:HighDue date:
Assignee:J. Wienke% Done:

100%

Category:Build SystemEstimated time:1.00 hour
Target version:Robotics Service Bus - rsb-0.9

Description

rst-convertersConfig.cmake needs to expose library dependencies for all dependencies (e.g. OpenCV) as it it now only done for RCI.

0001-fixes-1424-reduce-public-link-interface.patch Magnifier (17.9 KB) J. Wienke, 06/21/2013 10:39 AM


Related issues

Related to RSB OpenCV [Deprecated] - Tasks #816: Add build job and package upload Resolved 01/20/2012
Blocks RSB OpenCV [Deprecated] - Tasks #1309: Separate CMakeFile for Packaging Closed 12/18/2012
Blocks RSB OpenCV [Deprecated] - Bug #1531: Does not build on Ubuntu {Precise,Quantal} Resolved 06/06/2013

Associated revisions

Revision 271837c3
Added by J. Wienke almost 11 years ago

fixes #1424: reduce public link interface

  • Remove external dependencies from converter headers (as they are note
    required there anyways) to reduce the public link interface of the library.
  • In CMake, explicitly state the reduced link interface.

Revision c1d00ccf
Added by J. Wienke almost 11 years ago

fixes #1424: reduce public link interface

  • Remove external dependencies from converter headers (as they are note
    required there anyways) to reduce the public link interface of the library.
  • In CMake, explicitly state the reduced link interface.

Revision 0b78112f
Added by J. Wienke over 7 years ago

fixes #1424: reduce public link interface

  • Remove external dependencies from converter headers (as they are note
    required there anyways) to reduce the public link interface of the library.
  • In CMake, explicitly state the reduced link interface.

History

#1 Updated by J. Wienke about 11 years ago

Actually this is probably only necessary for include paths, as libraries are already exposed in the depends files:

SET(CMAKE_IMPORT_FILE_VERSION 1)

# Create imported target rstconverters
ADD_LIBRARY(rstconverters SHARED IMPORTED)

# Import target "rstconverters" for configuration "debug" 
SET_PROPERTY(TARGET rstconverters APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
SET_TARGET_PROPERTIES(rstconverters PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG "rsb;rst;rstsandbox;opencv_gpu;opencv_contrib;opencv_legacy;opencv_objdetect;opencv_calib3d;opencv_features2d;opencv_video;opencv_highgui;opencv_ml;opencv_imgproc;opencv_flann;opencv_core" 
  IMPORTED_LOCATION_DEBUG "/homes/jwienke/workspace/git/rst-converters/cpp/build-master/build/librstconverters.so.0.9" 
  IMPORTED_SONAME_DEBUG "librstconverters.so.0.9" 
  )

#2 Updated by Anonymous about 11 years ago

In a dependeing project this leads to

/usr/bin/ld: warning: libcv.so.2.1, needed by [...]/lib/librstconverters.so.0.9, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libml.so.2.1, needed by [...]/lib/librstconverters.so.0.9, not found (try using -rpath or -rpath-link)
[...]

So it seems that library dirs for e.g. opencv libraries are not properly exposed.

#3 Updated by Anonymous about 11 years ago

Feedback by Alexandre Tuleu:

I have a file /usr/share/rst-converters0.9/rst-converters-depends-relWithDebInfo.cmake that contains linking flags to opencv
I have looked up upon /usr/include/rst-converters0.9 and there is no include to any OpenCV files.
So it seems that OpenCV is an implicit hidden dependency of rst-converters. User of rst-converters does not have to use any symbol of opencv.
But the depends file make this explicit, by exporting the linking flags (but it should be removable, as dependencies on rst-converters does not need any opencv symbols).
But the config file of rst-converters allow the build configuration to pass even if opencv header are not installed on the system,
To fix the sityuation, either :

  • fix rst-converters-depends file to strip all opencv stuff (Recommended, less dependcencies. Do not forget to add OpenCV as binary deps of the debian packages)
    OR
  • add find_package(OpenCV REQUIRED) in rst-convertersConfig.cmake

Johannes, what do you think?

#4 Updated by J. Wienke about 11 years ago

I don't really understand the feedback and what is happening here. We only build the opencv-converters if opencv is generated and the depends file is generated by cmake. So I suspect a cmake bug.

With respect to grepping for opencv through the header files: With the generic converter interface of RSB it is quite likely that such a dependency is not visible in the header, as the converters do not have any specific data types in their interfaces.

#5 Updated by J. Moringen almost 11 years ago

  • Assignee set to J. Wienke
  • Priority changed from Normal to High

#6 Updated by J. Wienke almost 11 years ago

I have no idea how to fix this.

#7 Updated by J. Wienke almost 11 years ago

I thought about this a bit more. Most of the issues can probably be resolved if the converters do not expose the dependencies at all and hence no dependencies need to be visible in the link interfaces. The attached patch should do this. I could not test it with RCI enabled. So I don't know whether the changes in these converters compile correctly.

#8 Updated by J. Wienke almost 11 years ago

  • % Done changed from 0 to 30

#9 Updated by J. Wienke almost 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 30 to 100

Applied in changeset rst-converters|commit:271837c326641d6d54597810b27f4b36aceaf650.

Also available in: Atom PDF