[MacPorts] #57733: netcdf: Ports linking with netcdf also link with hdf5—overlinking?

MacPorts noreply at macports.org
Thu Dec 6 06:12:43 UTC 2018


#57733: netcdf: Ports linking with netcdf also link with hdf5—overlinking?
------------------------+----------------------
 Reporter:  ryandesign  |      Owner:  tenomoto
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:
 Keywords:              |       Port:  netcdf
------------------------+----------------------
 When netcdf +netcdf4 is installed, the nccopy, ncdump, ncgen, and ncgen3
 programs and the  libnetcdf library are linked with libhdf5 and libhdf5_hl
 (and libz and libcurl), but also:

 {{{
 $ pkg-config netcdf --libs
 -L/opt/local/lib -lnetcdf -lhdf5_hl -lhdf5 -lz -ldl -lm -lcurl
 }}}

 {{{
 $ nc-config --libs
 -L/opt/local/lib -lnetcdf -lhdf5_hl -lhdf5 -lz -ldl -lm -lcurl
 }}}

 This means anything that uses one of the above commands to determine what
 libraries to link to for netcdf will be told that it must link not only
 with libnetcdf but also with libhdf5 and libhdf5_hl and libz and libcurl.
 I suspect this is overlinking and that netcdf should not be doing that.

 Particularly in the case of libhdf5, this causes problems whenever hdf5 is
 updated, since it invariably comes with a new major library version
 number, which means everything linking with it must be rebuilt by having
 its revision increased. It's easy to identify which ports declare an
 explicit dependency on the hdf5 port and revbump those, but it is not
 expected that one would also have to seek out the ports that link with
 netcdf and revbump them, but that is what we currently have to do; see
 e.g. https://github.com/macports/macports-ports/pull/3137.

-- 
Ticket URL: <https://trac.macports.org/ticket/57733>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list