[Gdal-dev] NetCDF on Windows

Julien Demaria dem at acri-st.fr
Tue Feb 10 11:59:07 EST 2004


Hi,

I have also compiled and tested netCDF (static library version) support for 
GDAL on Windows using MSVC++ 6.

Next the instructions to compile and use the static netcdf library from 
official netCDF sources, if this can help some people... :

1) download and extract the official netcdf (3.5.0) sources archive

2) download and extract in the extracted NETCDF_DIR\src directory this 
archive 
ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.5.0.win32makeVC6.ZIP

3) cd NETCDF_DIR\src\libsrc

4) I have modified the compile options in msofts.mak (to be compatible with 
my others libraries (gdal, openev, ...)) :
         COPT=   /nologo /Ox /MD

5) nmake /f msofts.mak

6) copy netcdfs.lib in your NETCDF_INSTALLDIR\lib directory
     copy netcdf.H in your NETCDF_INSTALLDIR\include directory


I have also tested it under Solaris 5.7 (with gcc3.3.2 using sun LD).



Julien


At 12:55 12/01/2004 -0500, Frank Warmerdam wrote:
>Howard Butler wrote:
>>List,
>>I am please to report that I was able to compile NetCDF support for GDAL 
>>using the windows binary that I found on 
>>ftp://gmt.soest.hawaii.edu/pub/gmt/ that included a dll and .lib file.
>>Once compiled, however, I am unable to see the NetCDF driver listed when 
>>I print the drivers list using Python.  What other compiler symbols do I 
>>need to set to ensure that the driver built?
>
>Howard,
>
>Excellent work, but the magic you are missing is changes to frmts/makefile.vc
>to define FRMT_netcdf when building gdalallregister.cpp.  I have committed
>the required changes to nmake.opt, frmts/makefile.vc, and 
>frmts/netcdf/makefile.vc
>so that netcdf can now be built on windows.  I have done some minimal testing
>to verify that it works properly with the netcdf sdk you referenced.
>
>Note, I had to do a "chmod a+x" on the netcdf.dll when running from within the
>Cygwin environment. I don't know if this is an artifact of cgywin or what.
>
>Best regards,
>
>--
>---------------------------------------+--------------------------------------
>I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
>light and sound - activate the windows | http://pobox.com/~warmerdam
>and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>
>_______________________________________________
>Gdal-dev mailing list
>Gdal-dev at remotesensing.org
>http://remotesensing.org/mailman/listinfo/gdal-dev





More information about the Gdal-dev mailing list