The sci-libs/hdf library defines functions found in sci-libs/netcdf library causing linking conflicts. netcdf library is not required to compile hdf (mfhdf includes headers,etc. that it needs). Therefore netcdf should not be required by HDF. Also this is not easy to catch because it compiles fine and only causes problems at runtime when the wrong function gets linked / called. This causes problems with other applications and libraries higher up, such as GDAL. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 68982 [details, diff] trivial patch to remove netcdf dependency The netcdf dependencies are indeed not required by hdf. Unfortunately, I don't quite understand what you mean by "the sci-libs/hdf library defines functions found in sci-libs/netcdf library causing linking conflicts". Do you mean that the hdf binaries link to netcdf libaries when they shouldn't? They don't on my system. Also, I don't seen any conflict in installed library names between hdf and netcdf and hence don't see any linking conflict either. Could you please clarify. Thanks!
I have problems with non-portage applications that support both, their configure scripts detect both libraries and attempt to use them together (libmfhdf.so and libnetcdf.a). These libraries export the same netcdf functions causing linking errors (using netcdf functions from libmfhdf.so instead of libnetcdf.a). But this is unexpected - since I didn't specify 'netcdf' in my USE flags I don't expect it to be present on my system.
If you can assure that no other portage package on your system pulls in netcdf (scientific python comes to mind) the removal of netcdf as dependency of hdf should solve your problem. In the long run, however, you might consider fixing the configure/makefiles of you non-portage application to link to the proper library; e.g. via presence/absence of -lnetcdf or linking in /path/to/libmfhdf.so.
I removed the dependency. This should solve your problem if you do not need netcdf on your system. Otherwise, as Markus said, you will have to patch other programs to link to the correct library.