Good morning Pedro,
Building NetCDF statically is already an option, by passing
-DBUILD_SHARED_LIBS=OFF during configuration. This will build the
netcdf libraries and utilities statically, avoiding the direct
dependency on MSVCR100.dll. They will, however, still inherit any
downstream .dll dependencies from the curl, hdf and zlib libraries. You
might be able to work around this by downloading (or building) static
versions of these libraries. However, when I first investigated this
process some months ago, it became obvious that this would require more
time and effort on our end than we can reasonably expend (particularly
for 64-bit versions of the libraries). Hence, we only provide shared
libraries pre-built :).
On a tangental note, I see from the NCO discussion you linked that your
user was able to resolve the issue by removing the MSVCR100D.dll from
the c:\nco\ directory. On Windows, it is preferable to use the Release
version of the netcdf libraries (dependent on MSVCR100.dll) for the time
being, due to cross-dll memory management situations which arise between
the netcdf and hdf libraries. This is a known issue which can be
followed in our JIRA system at
https://bugtracking.unidata.ucar.edu/browse/NCF-220 . It is possible to
build and use the debug libraries, but running the unit tests will
result in a handful of errors.
I hope this clarifies the difficulty faced in providing purely static
libraries for netcdf-4/DAP enabled builds; as always, I am open to
suggestions and work-arounds!
Have a great day,
-Ward
On 6/5/13 12:24 AM, Pedro Vicente wrote:
Hi Allen, Ward
I have a request regarding your new CMake Windows build system, could
you add an option to make the build static regarding the Microsoft
libraries (MSVCR100D.dll) ?
Starting with version 4.3.1, NCO
http://nco.sourceforge.net/
uses the HDF5 and netCDF Windows libraries made with your CMake
system, and this is causing problems for NCO users, as explained here
https://sourceforge.net/projects/nco/forums/forum/9830/topic/8345151
and here
https://sourceforge.net/projects/nco/forums/forum/9829/topic/8417103
This is just a matter of changing the compiler flag to /MT(d)
http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
Using a dynamic build is just a bad idea, because of these DLL issues.
I have some Windows executables from code I did in the early 90's ,
that unfortunately I cannot run today,
just because I linked them with DLLs, with the DLLs from the Visual
Studio from that time, that do not exist anymore (it seems every new
version they change the Visual Studio Dlls).
Because of this I do not use Dlls, I know that eventually something
will go wrong :-)
Pedro
------
Pedro Vicente, Earth System Science
University of California, Irvine
http://www.ess.uci.edu/