PointCloudLibrary / pcl

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

configure finds libpng, libexpat, libtiff, libjpeg, but binaries aren't linked with them #5900

Closed yurivict closed 9 months ago

yurivict commented 9 months ago

Context

configure finds them:

-- Found PNG: /usr/local/lib/libpng.so (found version "1.6.40")
-- Found EXPAT: /usr/local/lib/libexpat.so (found version "2.5.0")
-- Found JPEG: /usr/local/lib/libjpeg.so (found version "80")
-- Found TIFF: /usr/local/lib/libtiff.so (found version "4.4.0")

The ports framework complains because no built binaries are linked to these libraries:

Warning: you might not need LIB_DEPENDS on libexpat.so
Warning: you might not need LIB_DEPENDS on libtiff.so
Warning: you might not need LIB_DEPENDS on libpng.so
Warning: you might not need LIB_DEPENDS on libjpeg.so

This issue exists in the FreeBSD port.

Version: 1.13.1 clang-16 FreeBSD 13.2

larshg commented 9 months ago

I'm pretty sure its subdependencies to VTK. I dont recall PCL use them directly, so its partly true.

yurivict commented 9 months ago

@larshg

For libpng pcl has the cmake variable WITH_PNG, which implies that pcl itself uses libpng.

larshg commented 9 months ago

True, its also used for saving PNGs. Even though there is also a functions which utlizes VTK for saving PNG: https://github.com/PointCloudLibrary/pcl/blob/c0c00648e15a34016deec49fb0cfb16e659e62a0/io/CMakeLists.txt#L7-L12 But it should in that case be linked to a png library. Not sure if they are compatible and can use the same PNG library though.

mvieth commented 9 months ago

I confirmed that PCL does not use libexpat, libtiff, and libjpeg directly (only via VTK). So I would guess that LIB_DEPENDS is indeed not needed for these three.

PCL links to the png libraries here: https://github.com/PointCloudLibrary/pcl/blob/c0c00648e15a34016deec49fb0cfb16e659e62a0/io/CMakeLists.txt#L373-L375

I also checked with ldd and found out that libpcl_io links to libpng16.so.16 (on my Ubuntu 22.04), which is the only libpng library on my computer. There is also a libpng.so, but that is just a link to the libpng16.so.16. Not sure if the situation is the same on FreeBSD? Maybe the warning is shown because the tool does not understand that libpng16.so.16 and libpng.so are essentially the same library?

yurivict commented 9 months ago

@mvieth

Thank you, Marcus. Binary is indeed linked to libpng16.so, as you said. And the other libraries in question are induced by VTK. I've updated the FreeBSD port's dependency list.

Thank you for your help!