Re: Shared library

>I don't understand why one would want to make libnetcdf into a shared

There are several reasons to use shared libraries:

1. Disk space savings.
While netCDF is not huge, each executable will shrink some and this can
add up to significant disk space savings; particularly if you have many
applications that use netCDF.

2. Link times decrease.
Again, since netCDF is not huge, time savings in the link stage are
not dramatic.  At least a small time decrease.

3. Memory space savings.
Code that is common is put in a read-only psect and is shared amongst
active processes.  While the total code in netCDF is not huge, if you
have many simultaneous processes using netCDF, the memory savings can
be significant.

You mentioned a disadvantage of "fragility" of executables since they
are dependent on the state of the library.  This is certainly true, but
can be mitigated by careful maintenance of the library.  With a properly
constructed library, it is possible to upgrade netCDF to a new version
(assuming backward code compatability) and have old executables automatically
use the new version without relinking.

  • 1993 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: