Avoid dependency on libsz.so and libaec.so in v4.9.3
Hi all,
I've noticed that netcdf library has some additional new dependencies on linux after upgrading from v4.9.2 to v4.9.3:
libaec.so.0 libbz2.so.1 libicudata.so.72 libicuuc.so.72 liblzma.so.5 libsz.so.2 libxml2.so.2
I understand this is mostly due to new plugin infrastructure, and I was able to eliminate most of them by using the following CMake options:
-DNETCDF_ENABLE_PLUGINS=OFF
-DNETCDF_ENABLE_FILTER_SZIP=OFF
-DNETCDF_ENABLE_FILTER_BZ2=OFF
-DNETCDF_ENABLE_LIBXML2=OFF \
But for some reason, I am still seeing dependency on both of SZIP-related libraries - libsz.so and libaec.so
% ldd libnetcdf.so.22 | grep libaec
libaec.so.0 => /lib/x86_64-linux-gnu/libaec.so.0 (0x00007f2aa0aee000)
% ldd libnetcdf.so.22 | grep libsz
libsz.so.2 => /lib/x86_64-linux-gnu/libsz.so.2 (0x00007f0f62881000)
I see in build log that SZIP filter is found for HDF5 (?), but SZIP writing is indeed turned-off:
-- Checking for H5_HAVE_FILTER_SZIP
-- Performing Test _has_H5_HAVE_FILTER_SZIP
-- Performing Test _has_H5_HAVE_FILTER_SZIP - Success
<.. snip..>
SZIP Write Support: no
Is there some way I can avoid the dependency on libsz.so and libaec.so?
Thanks for taking a look! Kris
I see that in netcdf/liblib/CMakeLists.txt SZIP_FOUND is false, and that SZIP libraries are not included in TLL_LIBS. So my best guess is that these dependencies are brought in by HDF5 (which we do build with SZIP support). I see that paths to SZIP libraries are included in the -- Found HDF5: line of the build log.
Not sure if this is right or if there is still a way to avoid libnetcdf.so.22 depending on libsz.so and libaec.so directly
There really isn't a way to avoid this dependency without disabling libhdf5 linking altogether, if I recall correctly; you might be able to disable szip reading in hdf5, but if the downstream libhdf5 offers szip reading, I believe we need to link against the appropriate library (libaec, libsz) to perform some functions directly, instead of handing everything over to the libhdf5 library.
That said, I'm curious now about why libsz wouldn't have been a dependency in v4.9.2. I'm up to my elbows in proposal writing, but I will take a look to see what changed and whether or not it was intended!
Thank you for taking a look and the quick confirmation!
I was looking at our timeline to see if the new dependency might be explained by when we started building HDF5 with SZIP support, but looks like that's not the case. We first upgraded to v4.9.2, then we enabled SZIP in HDF5 and also upgraded to 1.14.4.3. We have rebuilt netCDF v4.9.2 with this new HDF5 and looks like there wasn't a dependency on libsz.so and libaec.so in netCDF SO at that point.