Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Shared library


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

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.


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690