This is an old revision of the document!
Building UDUNITS on Windows
Diana / metlibs use the old, unsupported UDUNITS library, not the new UDUNITS-2 library. Unfortunately, converting from one to the other is not trivial, so we're stuck with the old library—for now.
First, get the latest source (1.12.9) from http://www.unidata.ucar.edu/downloads/udunits/index.jsp and extract it in a convenient place.
Building UDUNITS is not straightforward. Its autotools infrastructure is old, and its configure script does not use the correct autoconf idiom for locating yacc
, so you have to specify it manually; moreover, it fails to recognize g77, and uses POSIX features without defining the appropriate _XOPEN_SOURCE
macro.
The configure
command line is a bit of a mess:
$ cd src $ LD_YACC=-ly LDFLAGS=-no-undefined CPPFLAGS='-Df2cFortran -D_POSIX_MAX_INPUT=255' FC=g77 ./configure --prefix=/opt/udunits
UDUNITS includes Perl modules and man pages which require additional tools to build, so we'll just manually build and install the library and binary:
$ cd lib $ make installed_library installed_headers $ cd ../udunits $ make installed_program