NetCDF (Network Common Data Form) is an open standard for self-describing, machine-independent data formats for array-oriented scientific data. The standard and a good deal of associated software are developed by the Unidata program at the University Corporation for Atmospheric Research (UCAR).
I needed one of their libraries (ucar.ma2) to build HDFView from source. Because I have very little experience, figuring out how to do this took the better part of today. Here are my notes, so things will be faster the next time around…
Note that the
hdf-java source (containing the HDFView source) comes
with a few precompiled JARs, including
netcdf.jar. However, Gentoo
wants to compile everything from source), so we remove
those JARs before compiling
hdf-java, forcing a reliance on versions
that have already been installed from source using Portage.
Java develoment kit
You'll need both a Java development kit (JDK, think "compiler") and runtime environment (JRE, think "bytecode interpreter"). Install the default implementations with
# emerge virtual/jdk
# emerge dev-java/maven-bin
There's a from-source dev-java/maven in java-overlay, but I'll wait until that has been merged into the main Portage tree before checking it out. NetCDF will probabaly not depend on any bleeding-edge Maven features.
$ git clone git://github.com/Unidata/thredds.git
Unfortunately, this repository bundles a number of related Unidata
packages besides netCDF, so the 95 megabyte cdm directory comes with
an additional 432 megabytes of additional stuff. This means that it's
a good idea to run the clone over a fast connection, and probably
useful to use
git clone --depth 10 or similar to limit the amount of
history you clone.
Now that you've got the source, just tell Maven to install it for you. First, you'll need to install the `common utilities:
$ cd thredds/common $ mvn-2.2 install
Next, install the
cdm module itself
$ cd thredds $ mvn-2.2 install
To install HDFView on Gentoo, just emerge
dev-java/hdf-java from my
wtk overlay with the
USE flag enabled.