FS#59745 - [opencv] libhdf5.so not found

Attached to Project: Arch Linux
Opened by Carlos Eduardo Ramalho (cramalho) - Wednesday, 22 August 2018, 01:39 GMT
Last edited by Antonio Rojas (arojas) - Thursday, 23 August 2018, 08:22 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description: libhdf5.so not found


Steps to reproduce:

- Install opencv without the "hdf5" package in your machine
- Try to compile something with opencv + pkg-config. You'll get a linker error.

Proposed solution: "hdf5" should be a pre-requisite.
This task depends upon

Closed by  Antonio Rojas (arojas)
Thursday, 23 August 2018, 08:22 GMT
Reason for closing:  Upstream
Comment by Antonio Rojas (arojas) - Wednesday, 22 August 2018, 06:42 GMT
Many of our packages are built against opencv without hdf5. If your project uses libopencv_hdf.so it should depend on hdf5 itself. And if it doesn't use it and still tries to link to it it's a bug in the project.
Comment by Carlos Eduardo Ramalho (cramalho) - Thursday, 23 August 2018, 08:10 GMT
The "opencv.pc" distributed in this pakcage includes the -lopencv_hdf flag unconditionally.

I did not explicitly ask for this dependency. Simply used pkg-config to get the opencv flags as any user would do.

Is this a bug every in project that tries to use opencv via pkg-config?

If projects are not supposed to use libopencv_hdf.so by default, don't include this in the distributed opencv.pc. Or just make opencv depend on hdf5, as suggested.
Comment by Antonio Rojas (arojas) - Thursday, 23 August 2018, 08:22 GMT
The all-or-nothing approach of the pc file is wrong, yes. There should be an individual pc file for each library, like other multi-library packages have (libxcb, qt5-base, ffmpeg). Not only because of this issue, but also because it produces overlinking. But this comes from upstream, so please report it to them. I'm not going to work around this by forcing unnecessary runtime dependencies on every package that depends on opencv (not just hdf5, but also gtk3). Especially when there are very simple alternatives: add hdf5 and gtk3 as makedepends of your package, or manually specify the linked opencv libraries instead of blindly trusting pkgconfig output.

Loading...