Select Git revision
INSTALL 76.54 KiB
NetCDF Installation and Porting Guide
*************************************
This document describes how to build and install the netCDF library,
version 4.0.1 on Unix and Windows systems. This document was last
updated on 24 March 2009.
The current stable release of netCDF, version 4.0, can be obtained
from the netCDF web page at `http://www.unidata.ucar.edu/netcdf'.
Instructions for installing the current stable release version of
netCDF can be found at `http://www.unidata.ucar.edu/netcdf/docs'.
If netCDF does not build and pass all tests, and you don't find your
computing platform addressed in this document, then try
`http://www.unidata.ucar.edu/netcdf/other-builds.html' for reports of
successful builds of this package in environments to which we had no
access.
For a brief introduction to the netCDF format and utilities see
*note The NetCDF Tutorial: (netcdf-tutorial)Top.
For a complete description of the netCDF format and utilities see
*note The NetCDF Users Guide: (netcdf)Top.
Programming guides are available for C (*note The NetCDF C Interface
Guide: (netcdf-c)Top.), C++ (*note The NetCDF C++ Interface Guide:
(netcdf-cxx)Top.), Fortran 77 (*note The NetCDF Fortran 77 Interface
Guide: (netcdf-f77)Top.), and Fortran 90 (*note The NetCDF Fortran 90
Interface Guide: (netcdf-f90)Top.). All of these documents are
available from the netCDF-4 documentation page
`http://www.unidata.ucar.edu/netcdf/netcdf-4/newdocs'.
Separate documentation for the netCDF Java library can be found at
the netCDF-Java website,
`http://www.unidata.ucar.edu/software/netcdf-java'.
To learn more about netCDF, see the netCDF website
`http://www.unidata.ucar.edu/netcdf'.
1 Installing the NetCDF Binaries
********************************
The easiest way to get netCDF is through a package management program,
such as rpm, yum, adept, and others. NetCDF is available from many
different repositories, including the default Red Hat and Ubuntu
repositories.
Another way to get netCDF is to get a pre-built binary distribution.
To get them, see
`http://www.unidata.ucar.edu/downloads/netcdf/index.jsp'.
To install the binary distribution, uncompress and unpack the tar
file. You will end up with 4 subdirectories, lib, include, man, and bin.
The lib subdirectory holds the netCDF libraries (C, Fortran, and
C++). The include directory holds the necessary netcdf.h file (for C),
netcdf.inc (for Fortran), netcdfcpp.h (for C++), and the .mod files
(for Fortran 90). The bin directory holds the ncgen and ncdump
utilities, and the man directory holds the netCDF documentation.
You can have these directories anywhere you like, and use netCDF. But
when compiling a netCDF program, you will have to tell the linker where
to find the library (e.g. with the -L option of most C compilers), and
you will also have to tell the C pre-processor where to find the
include file (e.g. with the -I option).
If you are using shared libraries, you will also have to specify the
library location for run-time dynamic linking. See your compiler
documentation. For some general information see the netCDF FAQ "How do
I use shared libraries" at