Open nh2 opened 2 years ago
Can you add HDF5's dependency at the same time? Modify CMakeLists.txt
find_hdf5()
if (NOT HDF5_FOUND)
message(WARNING "hdf5 library not found, some tests will not be run")
else()
include_directories(${HDF5_INCLUDE_DIR})
list(APPEND PKGCONFIG_EXTERNAL_DEPS_LIST "hdf5")
endif()
Can you add HDF5's dependency at the same time?
@longhuan2018 Done.
Can you drop @LZ4_STATIC_LDFLAGS@
from cmake/flann.pc.in
? That should fix #480.
Can you drop
@LZ4_STATIC_LDFLAGS@
fromcmake/flann.pc.in
? That should fix #480.
@jspricke Done.
But why does flann.pc.in
list these depenencies (hdf5
and liblz4
) in Requires
instead of Requires.private
?
According to https://people.freedesktop.org/~dbn/pkg-config-guide.html, section "Writing pkg-config files",
Requires
andRequires.private
define other modules needed by the library. It is usually preferred to use theprivate
variant ofRequires
to avoid exposing unnecessary libraries to the program that is linking with your library. If the program will not be using the symbols of the required library, it should not be linking directly to that library. See the discussion of overlinking for a more thorough explanation.
@longhuan2018 Should HDF5
this really be in the .pc
file?
It says
hdf5 library not found, some tests will not be run
So it sounds like it is only needed for tests, should it then be used for pkg-config
?
I noticed that the libflann*.so
files are not linked against hdf5
so files.
But why does
flann.pc.in
list these depenencies (hdf5
andliblz4
) inRequires
instead ofRequires.private
?According to https://people.freedesktop.org/~dbn/pkg-config-guide.html, section "Writing pkg-config files",
Requires
andRequires.private
define other modules needed by the library. It is usually preferred to use theprivate
variant ofRequires
to avoid exposing unnecessary libraries to the program that is linking with your library. If the program will not be using the symbols of the required library, it should not be linking directly to that library. See the discussion of overlinking for a more thorough explanation.
flann is exposing lz4 headers in util/serialization.h
so to my understanding Requires
is correct.
flann is exposing lz4 headers in
util/serialization.h
so to my understandingRequires
is correct.
Yes, then it is correct. I've added that info as a CMake comment.
Then I only need the answer from @longhuan2018 regarding HDF5.
lz4 is an unconditional dependency of flann (see #399), but until now was not correctly generated into the
Requires: lz4
line offlann.pc
, because thePKG_EXTERNAL_DEPS
variable used inflann.pc.in
was not defined at all.This fixes build error
lz4.h: No such file or directory
for properly sandboxed builds, in which undeclared dependencies are not made available.