Easiset way to install netcdf...

Working on the libCF project I just installed the netCDF libraries from Fedora's yum repositories. It was super easy!

 yum install netcdf-devel

 After this, I was able to build and run the following program:

#include <netcdf.h>
int
main()
{
   int ncid;
   if (nc_create("tmp.nc", NC_NETCDF4, &ncid))
      return 1;
   if (nc_close(ncid))
      return 2;
   return 0;
}

 

Which I called tmp.c and compiled and ran with the following command:

gcc tmp.c -lnetcdf && ./a.out

It worked! I got a beautiful empty netCDF-4/HDF5 file called tmp.nc.

It's a shame that this is version 4.1.1. We've made lots of changes since then to improve performance, especially with large files, or files containing large numbers of objects. But 4.1.1 will work for my libcf testing machine, and it was very easy to install!



Comments:

Post a Comment:
Comments are closed for this entry.
Unidata Developer's Blog
A weblog about software development by Unidata developers*
Unidata Developer's Blog
A weblog about software development by Unidata developers*

Welcome

FAQs

News@Unidata blog

Take a poll!

What if we had an ongoing user poll in here?

Browse By Topic
Browse by Topic
« December 2024
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
10
11
12
13
14
15
16
17
18
19
20
21
22
24
25
26
27
28
29
30
31
    
       
Today