This manual describes the UDUNITS-2 package, which contains a C library for units of physical quantities and a unit-definition and value-conversion utility.
Copyright 2014 University Corporation for Atmospheric Research and contributors. All rights reserved.
This software was developed by the Unidata Program Center of the University Corporation for Atmospheric Research (UCAR) <http://www.unidata.ucar.edu>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3) Neither the names of the development group, the copyright holders, nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. 4) This license shall terminate automatically and you may no longer exercise any of the rights granted to you by this license as of the date you commence an action, including a cross-claim or counterclaim, against the copyright holders or any contributor alleging that this software infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of this software with other software or hardware.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
|• Differences:||How this package differs from the UDUNITS-1 package|
|• Installation:||Installing this package|
|• Library:||The unit library|
|• Utility:||The unit utility|
|• Database:||The unit database|
|• Support:||Support for this package|
|• Complete Index:||Complete index|
The UDUNITS-2 package provides support for units of physical quantities. Its three main components are: 1) (udunits2lib)a C library for units of physical quantities; 2) (udunits2prog)a utility; for obtaining the definition of a unit and for converting numeric values between compatible units; and 3) an extensive database of units.
UDUNIT-2 package differs from the
package in the following ways:
UDUNITS-1package only supports the ASCII character set. The
UDUNITS-2package supports the following character sets: ASCII, ISO 8859-1 (Latin-1), and the UTF-8 encoding of ISO 10646 (Unicode). This means that unit string specifications like "
ÂµÂ°FÂ·Î©â»Â¹" are now supported (your viewer must support UTF-8 to display this string correctly).
0.1 lg(re 1 mW)" specifies a deciBel unit with a one milliwatt reference level. Such units are fully integrated into the package and all meaningful operations and conversions are supported.
double, or one-dimensional arrays of
UDUNITS-1package. The new interface, however, is easily understood and easy to use. To support backward comptibility, the package does contain a version 1 C API, which uses the version 2 library.
One thing that has not changed is that almost all unit string specifications
understood by the
UDUNITS-1 package are also
understood by the
UDUNITS-2 package. One exception is
g, which in version 1 of the package was associated with
standard free fall (a unit of acceleration) but which is associated
with the unit gram in version 2 of the package.
|• Prerequisites:||Prerequisites for this package|
|• Obtain:||Obtaining this package|
|• Unix:||Installing on Unix-like environments|
|• Windows:||Installing on Windows environments|
The Expat library and header-files must be installed. Look for the library "libexpat" and the header-file "expat.h".
If this package is to be tested (which is optional), then the CUnit library and header-files must be installed. Look for the library "libcunit" and the header-files "CUnit/CUnit.h" and "CUnit/Basic.h".
If this package is to be built on a Windows system, then the CMake and MinGW packages must be installed. Look for the utility "cmake" and the directory/folder "MinGW".
Get the source for this package from its download-page at ftp://ftp.unidata.ucar.edu/pub/udunits/ and unpack it in an appropriate place. For example,
su - cd /usr/local/src wget -O - ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.28.tar.gz | pax -rz
|• Autoconf:||Autoconf-based installation|
|• CMake:||CMake-based installation|
./configure [--prefix=root] [--disable-shared] [CC=path] make make check # optional; requires CUNIT installation make install # also installs INFO documentation make install-html install-pdf # optional make clean
By default, the installation root is
distcleantarget using the make utility from step 2:
configurescript. Specify the installation prefix, the compiler from the previous step, and any required option. For example, if you are on an HP-UX system and want to use the
/bin/c89compiler, create a static library, and install under
/opt, then the following command is appropriate:
./configure --prefix=/opt --disable-shared CC=/bin/c89
--disable-shared causes the build process to create
a static library only: a sharable library is not created.
This option is necessary if the
libtool utility that’s included
in this package can’t build a sharable library using the given compiler.
The default installation prefix is
/usr/local and the default compiler is
checktarget using the make utility from step 2:
This step is only effective if the
configure script found an
CUNIT unit-testing package. If that package wasn’t
found, then the above command will quickly exit without testing this
installtarget using the make utility from step 2:
make install-html install-pdf
cleantarget using the make utility from step 2:
mkdir build cd build cmake .. make all [test] install [install_test]
where the arguments in square brackets are optional.
Currently, only a 32-bit MinGW-based installation is supported:
cmake -G "MinGW Makefiles" cmake --build . [-DCMAKE_INSTALL_PREFIX=dir] -- all [test] install [install_test]
where arguments in square brackets are optional.
The default installation-prefix is
C:\Program Files (x86)\udunits-2.minor.bug", where
minor and bug are the minor version and bug-fix level,
See (udunits2lib)UDUNITS Library, for details on this package’s unit library.
See (udunits2prog)UDUNITS Utility, for details on this package’s unit utility.
The database for the UDUNITS-2 package comprises one XML file containing unit prefixes and four XML files containing unit definitions:
The home-page for this package can be found at http://www.unidata.ucar.edu/software/udunits/.
Bug reports should be sent to email@example.com.
|Jump to:||D I L O P S U|
|obtaining this package:||Obtain|
|prerequisites for this package:||Prerequisites|
|Jump to:||D I L O P S U|