PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.72k stars 4.6k forks source link

Glitches with the pkg-config files (pcl_*.pc) #221

Closed marlam closed 10 years ago

marlam commented 10 years ago

Hi,

there are a few glitches with the pkg-config files provided by the PCL modules:

1) The package version should never be encoded into the module filename. For example it should be just pcl_io.pc, not pcl_io-1.7.pc. Otherwise users of libpcl have to hardcode version numbers into their build scripts. For example, I now have PKG_CHECK_MODULES([libpcl_io], [pcl_io >= 1.6], [], [PKG_CHECK_MODULES([libpcl_io], [pcl_io-1.7 >= 1.7], [], [PKG_CHECK_MODULES([libpcl_io], [pcl_io-1.6 >= 1.6], [], ..... and I have to extend this with each new version. That should just be one line: PKG_CHECK_MODULES([libpcl_io], [pcl_io >= 1.6], [], .....

2) pcl_io-1.7.pc and pcl_visualization-1.7.pc list 'openni-dev' as a dependency. At least on Ubuntu, that package does not exist; it should be replaced with 'libopenni2' (or similar?)

jspricke commented 10 years ago

That's a tricky question. Problem is, that PCL changed it's API within most of it's minor releases. That's why it's included in the SONAME, for example. On the other hand, PCL contains quite a number of submodules, so increasing the version number everywhere, would be quite confusing as well. But it would be more equal to our Cmake files, so maybe we should do it.

2) pcl_io-1.7.pc and pcl_visualization-1.7.pc list 'openni-dev' as a dependency. At least on Ubuntu, that package does not exist; it should be replaced with 'libopenni2' (or similar?)

libopenni2 is from the libopenni2-dev package (note the 2 as being part of the library name as it has a different API), whereas PCL still depends on libpenni-dev, so libopenni is right. We need someone to fiddle around in the Cmake macros, to get this right.

richmattes commented 10 years ago

openni doesn't ship its own pkgconfig file, it's being added by whoever is packaging openni for ros. That pkgconfig file is not necessarily present in other openni packages shipped by other distributions[1]. Hardcoding a dependency on a non-standard pkgconfig file is not the friendliest thing to do (even when it does get fixed to depend on the correct pkgconfig file name instead of the deb package's name)

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1007941

stanislas-brossette commented 10 years ago

Hi, there is another glitch with the last Debian packages on Precise.

Currently, pcl-io-1.7 requires openni-dev to be installed in its pkg-config file (i.e. requires openni-dev) but the Debian package depends on libopenni-dev. Practically, using this pkg-config file is impossible as a required dependency will be missing and openni-dev / libopenni-dev packages are incompatible (and probably not ABI compatible).

Cf the following log:

# I am using the pcl-io-1.7 from the Debian repository:
$ dpkg -S /usr/lib/pkgconfig/pcl_io-1.7.pc
libpcl-io-1.7-dev: /usr/lib/pkgconfig/pcl_io-1.7.pc

# It contains the following:
$ cat /usr/lib/pkgconfig/pcl_io-1.7.pc
# This file was generated by CMake for PCL library pcl_io
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
#includedir=${prefix}/include/pcl-1.7/pcl
includedir=${prefix}/include/pcl-1.7
Name: pcl_io
Description: Point cloud IO library
Version: 1.7.0
Requires:  eigen3 openni-dev pcl_common-1.7 pcl_octree-1.7
Libs: -L${libdir} -lpcl_io  
Cflags: -I${includedir} 

# I am using the last package for my distribution:
$ apt-cache show libpcl-io-1.7-dev 
Package: libpcl-io-1.7-dev
Source: pcl-1.7
Version: 1.7.0-2+precise4
Architecture: amd64
Maintainer: Jochen Sprickerhof <launchpad@jochen.sprickerhof.de>
Installed-Size: 663
Depends: libpcl-io-1.7 (= 1.7.0-2+precise4), libpcl-common-1.7-dev, libpcl-octree-1.7-dev, libopenni-dev, libvtk5-dev, libusb-1.0-0-dev
Conflicts: libpcl-io-1.2-dev, libpcl-io-1.3-dev, libpcl-io-1.4-dev, libpcl-io-1.5-dev, libpcl-io-1.6-dev
Homepage: http://pointclouds.org/
Priority: optional
Section: libdevel
Filename: pool/main/p/pcl-1.7/libpcl-io-1.7-dev_1.7.0-2+precise4_amd64.deb
Size: 88062
SHA256: 28a16b42f574c9573d12b8e9bae5fad51deca68918dde8f58735a3bacf13202f
SHA1: 9ee8b6adb7c8d5a982ca737dafbba45a18ee5ba7
MD5sum: fd62c6ce96d61d33937ad2e7a20c10e1
Description: The Point Cloud Library (or PCL) for point cloud processing - development
 The PCL framework contains numerous state-of-the art algorithms including
 filtering, feature estimation, surface reconstruction, registration, model
 fitting and segmentation.
 .
 This package contains development files needed to build applications depending on PCL io.

# The Debian package pcl-io-1.7 depends on libopenni-dev which does not provide the required .pc file:
$ dpkg -L libopenni-dev | grep .pc
/usr/lib/pkgconfig/libopenni.pc

I.e. there is a typo in the pkg-config file, the openni-dev should be replaced by libopenni.

This is quite critical as it prevents detection of the PCL package by 3rd party software relying on it. Could you investigate this please? Thanks.

CC @thomas-moulard @francois-keith

jspricke commented 10 years ago

I would propose to drop the pkg-config dependency as long as OpenNI doesn't include on upstream. @jpgr87 I've seen that Fedora has patches for this already, would be great if you could send a pull request with them.

richmattes commented 10 years ago

The Fedora patch to fix this issue mirrors the d282b79 commit. We just removed the lines where openni-dev was appended to the EXT_DEPS.

rbrusu commented 10 years ago

Is there any follow up needed on this issue?

nizar-sallem commented 10 years ago

I believe it has already been committed to master.