Installation

Installing UNIT

UNIT can be installed via Git and CMake:

bash
1git clone https://github.com/ZeroIntensity/unit && cd unit
2cmake -B build -DCMAKE_BUILD_TYPE=Release
3cmake --build build
4sudo cmake --install build

This installs the library and headers to your system’s default prefix (on Linux, this is /usr/local). To install elsewhere, pass the CMAKE_INSTALL_PREFIX setting:

bash
1cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/.local
2cmake --build build
3cmake --install build

Python bindings

Alternatively, if you plan on using the Python bindings without the C API or C++ API, you can solely install that using your preferred package manager:

bash
pip install unit-compiler

Using UNIT in your project

CMakeLists.txt
find_package(unit REQUIRED)
target_link_libraries(my_program PRIVATE unit::unit)