Bug 96187 - sci-libs/netcdf dependency for sci-libs/hdf causes conflict
Bug#: 96187 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: sci@gentoo.org Reported By: princely@emirates.net.ae
Component: Library
URL: 
Summary: sci-libs/netcdf dependency for sci-libs/hdf causes conflict
Keywords:  
Status Whiteboard: 
Opened: 2005-06-15 08:45 0000
Description:   Opened: 2005-06-15 08:45 0000
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.

------- Comment #1 From Markus Dittrich 2005-09-21 19:37:18 0000 -------
Created an attachment (id=68982) [details]
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!

------- Comment #2 From Robin Princeley 2005-09-22 04:10:09 0000 -------
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. 
 

------- Comment #3 From Markus Dittrich 2005-09-22 12:43:24 0000 -------
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.

------- Comment #4 From Olivier Fisette 2005-10-01 14:32:25 0000 -------
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.