Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Next: , Previous: Installation, Up: Building on Unix



3.9 Using NetCDF

To use netCDF you must link to the netCDF library, and, if using the netCDF-4/HDF5 features, also two HDF5 and at least one compression library.

Use the -L option to your linker to pass the directories in which netCDF, HDF5, and zlib are installed.

Use the -l (lower-case L) option to list the libraries, which must be listed in the correct order:

-lnetcdf -lhdf5_hl -lhdf5 -lz

On some systems you must also include -lm for the math library.

If szip was used when building HDF5, you must also use -lsz.
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690