EnesYildirim / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

Do not need to link against hdf5_hl, hdf5, z when linking dynamically #139

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When linking dynamically to netcdf, there is no need to specify any of 
-lhdf5_hl, -lhdf5, or -lz since the netcdf4-python code does not use code from 
those libraries directly.  It would be help if these were removed in that case.

Original issue reported on code.google.com by or...@cora.nwra.com on 12 Sep 2012 at 9:47

GoogleCodeExporter commented 8 years ago
Why would that be helpful?  Does linking fail if those libs are not found?  I 
don't know how I would tell if the libs are shared or static.

Original comment by whitaker.jeffrey@gmail.com on 17 Sep 2012 at 10:06

GoogleCodeExporter commented 8 years ago
It would be helpful by avoiding over linking, which we try to avoid in packages 
in Fedora (it can lead to dependency bloat).  With shared libraries, it is 
completely unnecessary to list them.  Personally, I would assume shared and add 
an option to link statically.

Original comment by or...@cora.nwra.com on 18 Sep 2012 at 7:01

GoogleCodeExporter commented 8 years ago
As an real-world example, at GFDL they can select which netcdf version they 
wish to use (module load netcdf/4.1.2, module load netcdf/4.2, etc.)  The two 
versions just mentioned at their site use different versions of HDF5.  By only 
linking against the netcdf shared library, and not the hdf5 shared library, 
users can switch between these netcdf versions.  If the HDF5 library is also 
specified, they are tied to the netcdf/hdf5 combination used in the build.  (At 
least this is the case with my PyFerret builds there.)

Of course, if you are statically linking in netcdf, then you do need the rest 
of the libraries.

Original comment by karlmatt...@gmail.com on 2 May 2013 at 5:28

GoogleCodeExporter commented 8 years ago
setup.py doesn't know whether the libs are static or shared, so I err on the 
side of caution and link all the libs.

If netcdf is built shared, then nc-config --libs will not list the HDF5 libs.  
So, setting USE_NCCONFIG should get the desired behavior.

Original comment by whitaker.jeffrey@gmail.com on 2 May 2013 at 6:02

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04