-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake exported target uses undefined hdf5::hdf5 imported target #1444
Comments
Well, |
The netCDFConfig.cmake file is generated automatically; let me take a look to see if I can find out how it is properly modified/updated. |
@WardF it is configured from https://github.com/Unidata/netcdf-c/blob/master/netCDFConfig.cmake.in |
Coming back to revisit 4.7.1 issues in the lead-up to the release. @jschueller thanks for the pointer. |
Note that a similar issue is with missing a dependency on MPI as well. |
I think the issue here is that cmake's current FIndHDF5.cmake file doesn't define any imported targets (the hdf5::hdf5 target) but hdf5 build with cmake defines a cmake config file that does provide this target. See https://gitlab.kitware.com/cmake/cmake/issues/18560 for the upstream discussions regarding this. So I suspect the best route to fixing this is to ignore the hdf5 provided config files by passing NO_MODULE to the find_package(HDF5) calls? |
VTK has a patched |
@mathstuf Its actually in the context of VTK and the superbuild that I was seeing issues with this. |
That's probably with VTK 8.2 / ParaView 5.6 and older (where the build system choked on imported targets). Now with VTK 8.90 / ParaView 5.7 and newer, imported targets are heavily preferred (non-targets are usually warned about if it comes to the attention of the new build system infrastructure). |
hdf5 logic is complicated #877 |
@jschueller Indeed. |
Addressing this now before it slips under the radar again. |
hi @WardF with your patch now I get just "hdf5_hl-shared" instead of the previous "hdf5::hdf5_hl-shared", but it's not right yet ;) |
Yes, the logic for HDF5 is tricky. Thanks for checking in, I was going to ask, once I had something that looked like a fix. I imagine I'll need to pattern something off of the hdf5 logic found in the netcdf-c top-level CMakeLists.txt file. It's good to have something to do :). |
Is there progress on this? I see that a netcdf-c cmake built library has a pkgconfig file that references libraries that don't exist (
|
Wow this has really lingered. My sincere, embarrassed apologies. @K20shores this feels like something that might fit in with the work we're doing over at #2847? |
@WardF, yes, I think the updates we've added may fix this. I'll have to check |
on mingw (win32), compiling netcdf with cmake, with a cmake-compiled hdf5 using its exported target (module mode, not config mode), results in an installed netcdf-targets.cmake that contains the hdf5::hdf5 target (and hdf5::hdf5_hl) in the INTERFACE_LINK_LIBRARIES properties.
But then, when using netcdf in module mode (with find_package(netCDF)) these hdf5 targets are undefined (the hdf5 cmake config is not included), and cmake is not happy:
We first encountered this bug in vtk: https://gitlab.kitware.com/vtk/vtk/issues/17637
A workaround is to provide manually hdf5 paths when configuring netcdf, doing so results in actual library paths being written to the exported targets file instead of hdf5 targets.
The text was updated successfully, but these errors were encountered: