Table of Contents

Building JasPer and the Grib API on Windows

XXX is JasPer really required? lisbethb, audunc say probably not.

JasPer

JasPer is an obnoxious little piece of software that should be avoided at all costs, but Grib uses it, so we're stuck with it.

Download the latest source (currently 1.900.1) from http://www.ece.uvic.ca/~mdadams/jasper/ and extract it in a convenient place.

Next, in src/appl/tmrdemo.c, replace sleep(1) with usleep(1000).

Finally, configure, build and install:

$ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no
$ make all install
$ cp LICENSE /c/met.no/copyright/jasper.txt

TODO: replace with OpenJPEG?

Grib API

First, get the latest source (currently 1.8.0) from http://www.ecmwf.int/products/data/software/download/grib_api.html and extract it in a convenient place.

Grib comes with a tool called grib1to2 which is used to convert grib1 data sets to grib2. This is a shell script, which is useless on Windows anyway, but more importantly, it is listed in tools/Makefile.am as a program rather than a script. On Windows, automake automatically appends .exe to program names, and there is no rule to generate grib1to2.exe. The simple fix is to remove all mention of grib1to2 from tools/Makefile.am (end of line 16, entire line 55, lines 65-67), then regenerate tools/Makefile.in by running the following commands in the top-level directory:

$ aclocal
$ automake

You may have to chmod u+w tools/Makefile.am before editing it.

Finally, configure, build and install:

$ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no
$ make all install
$ cp AUTHORS /c/met.no/copyright/grib_api.txt
$ cat LICENSE >>/c/met.no/copyright/grib_api.txt

Note that Grib does not build shared libraries (not sure why, the code to do so is partly present but commented out). that's OK since we've decided not to use shared libraries.

TODO: check configure options

TODO: check interactions between GPLv3 and licenses for other third-party components used by metlibs / diana

Comment from SMHI. All fopen need to be with rb and wb, otherwise fseek doesn't work.

GRIB_DEFINITION_PATH must be correct.