Wed Jun 11 18:19:05 MDT 1997
amended 3/18/98 JCaron

These are notes describing how to build netcdf-3.4
using the using Microsoft Visual C++ 5.x and (optionally)
Digital Visual Fortran 5.0.

We have ported netcdf-3.4 to this environment,
and run the tests. Because of difficulties in getting
Microsoft Visual Studio to fall in line with our existing
source directory scheme, we chose _not_ to build the system
"inside" Visual Studio. Instead, we provide a simple group
of "msoft.mak" files which can be used. If you
wish to work in Visual Studio, go ahead. Read the
section called "Macros" at the end of this discussion.

As of this writing, we have not tried compiling the
C++ interface in this environment.

To build netcdf using the provided "msoft.mak" files,
proceed as follows:

1) Get the netcdf source distribution and unpack it somewhere.

2) Get ftp://ftp.unidata.ucar.edu/dist/ftp/pub/netcdf/contrib/win32/maks.zip
   Unzip this in the netcdf-3.4\src directory. 

3) Read WIN32_INSTALL (this file).

4) In src\libsrc; nmake /f msoft.mak
   This will build netcdf.lib and netcdf.dll
   Note: This makefiles make DLLs. To make static
   libraries see section on static libraries.

5) (optional)
   In src\libsrc; nmake /f msoft.mak test
   This will make and run the simple test.

6) (optional)
   In src\fortran; nmake /f msoft.mak
   This will build the fortran interface and rebuild dll in ..\libsrc to
   include the fortran interface. Note Bene: We don't provide a .DEF file,
   so this step changes the "ordinals" by which entry points in the DLL
   found. Some sites may wish to modify the msoft.mak file(s) to produce
   a separate library for the fortran interface.

7) (optional)
   While you are in src\fortran; nmake /f msoft.mak test
   This tests the netcdf-2 fortran interface.

8) (optional, but recommended)
   In src\nctest; nmake /f msoft.mak test
   This tests the netcdf-2 C interface.

9) (optional, but highly recommended)
   In src\nc_test; nmake /f msoft.mak test
   This tortures the netcdf-3 C interface.

10) (optional, but highly recommended if you built the fortran interface)
   In src\nf_test; nmake /f msoft.mak test
   This tortures the netcdf-3 fortran interface.

11) (optional) In src\ncdump; nmake /f msoft.mak
   This makes ncdump.exe.

12) (optional) In src\ncgen; nmake /f msoft.mak
   This makes ncgen.exe.

13) (optional) In src\ncdump; nmake /f msoft.mak test
   This tests ncdump. Both ncgen and ncdump need to be
   built prior to this test. Note the makefile sets the
   path so that ..\libsrc\netcdf.dll can be located.

14) (optional) In src\ncgen; nmake /f msoft.mak test
   This tests ncgen. Both ncgen and ncdump need to be
   built prior to this test. Note the makefile sets the
   path so that ..\libsrc\netcdf.dll can be located.

15) Install:
   Copy libsrc\netcdf.lib to a LIBRARY directory.
   Copy libsrc\netcdf.h and fortran/netcdf.inc to an INCLUDE directory.
   Copy libsrc\netcdf.dll, ncdump/ncdump.exe, and ncgen/ncgen.exe to
   a BIN directory (someplace in your PATH).

===
Static Libraries:

There are make files called "msofts.mak" that create and use a static version of the
netcdf library, named "netcdfs.lib".  If you use these makefiles, ncgen and ncdump 
will be statically linked.  DLLs are shared, so are more efficient, but you must be sure
that they can be found in your PATH.

To make the static library versions, repeat all steps above except use "msofts.mak" 
instead of "msoft.mak". The library will be name netcdfs.lib, and the bins will be named
ncgens.exe and ncdumps.exe. You can rename them if you like to the usual names.

===
Macros:

Always define NDEBUG to turn off our assertions.

libsrc\netcdf.h:
	Define DLL_NETCDF whenever the netcdf library is a DLL.
	Also define DLL_EXPORT when you are building the library itself.

fortran\
	Set defines thus
	 /D "DLL_EXPORT" /D FCALLSC_QUALIFIER="__declspec(dllexport) __stdcall"
	if you building the fortran interfaces to put in a DLL.

fortran\ and nf_test\:
	Define VISUAL_CPLUSPLUS so cfortran.h and nf_test.F know what to do.

=====
Notes.

When running the nc_test suite of tests using O2 optimization, you may see two
messages that you can ignore:

...
*** Testing nc_put_vars_float ... 
	FAILURE at line 5314 of test_put.c: range error: status = 0
 1194 good comparisons. 
	### 1 FAILURES TESTING nc_put_vars_float! ###
...

*** Testing nc_put_varm_float ... 
	FAILURE at line 6637 of test_put.c: range error: status = 0
 1194 good comparisons. 
	### 1 FAILURES TESTING nc_put_varm_float! ###