Wed Jun 11 18:19:05 MDT 1997

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

We have ported netcdf-3.3.1 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 "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: These makefiles just make DLLs. Making static
   libraries is left as an exercise for the reader.

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).


===
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.
