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.
The UDUNITS-2 package provides support for units of physical quantities. Its three main components are:
udunits2liba C library for units of physical quantities;
udunits2proga utility for obtaining the definition of a unit and for converting numeric values between compatible units; and
UDUNIT-2 package differs from the UDUNITS-1 package in the following ways:
μ°F·Ω-1" are now supported.
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
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 the
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.
The Expat library and header-files must be installed. Look for the library "
libexpat" and the
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 "
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 "
Currently, only an RPM binary distribution is supported.
rpmcommand. For example, assuming you've downloaded the binary to
sudo rpm --install [--prefix=/opt/udunits] ~/Downloads/udunits-2.2.28-x86_64.rpm
where the argument in square brackets is optional. The default installation directory is
cd ~/Downloads curl -O https://downloads.unidata.ucar.edu/udunits/udunits-2.2.28.tar.gz
cd /opt sudo pax -rz < ~/Downloads/udunits-2.2.28.tar.gz
cd udunits-2.2.28 ./configure [--prefix=install_prefix] >&configure.log make all [check] install [install-html] [install-pdf]
where the arguments in square brackets are optional. The default installation prefix is the parent directory of the source directory.
cd C:\Users\current_user\Downloads curl -O https://artifacts.unidata.ucar.edu/repository/downloads-udunits/udunits-2.2.28.zip
Downloadscode>" folder. Note that, by default, the extractor might create an extra top-level folder with a duplicate name. Remove the extra folder from the destination path if this is the case – either before or after extraction.
cmake(1). For example"
cd C:\Users\current_user\Downloads\udunits2-2.2.28 mkdir build cd build cmake [-D CMAKE_INSTALL_PREFIX=install_prefix] .. make all install
where the argument in square brackets is optional. The default installation folder is the parent folder of the source folder.
udunits2lib UDUNITS Library, for details on this
package’s unit library.
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 https://www.unidata.ucar.edu/software/udunits/.
Bug reports and support questions should be sent to firstname.lastname@example.org.
Copyright 2023 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) https://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:
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.