Building the ML SDK VGF Library

The build system must have:

  • C/C++ 17 compiler: GCC, or optionally Clang on Linux and MSVC on Windows®.

  • CMake 3.25 or later.

  • Ninja 1.8.2 or later.

  • Python 3.10 or later and uv 0.9.26. Test and tooling dependencies are declared in pyproject.toml and locked in uv.lock.

The following dependencies are also needed:

For the preferred dependency versions see the manifest file.

Building with the script

To make the build configuration options easily discoverable, we provide a python build script. When you run the script from a git-repo manifest checkout, the script uses default paths and does not require any additional arguments. If you do not use the script, you must specify paths to the dependencies.

To build on the current platform, for example on Linux or Windows®, run the following command:

python3 $SDK_PATH/sw/vgf-lib/scripts/build.py -j $(nproc)

To cross compile for AArch64 architecture, add the following option:

python3 $SDK_PATH/sw/vgf-lib/scripts/build.py -j $(nproc) --target-platform aarch64

To enable and run tests, use the --test option. To lint the tests, use the --lint option. To enable tests and documentation building python dependencies must be installed:

uv sync --locked --no-install-project --no-default-groups --group test --group tooling

Run build commands with uv run --no-sync python scripts/build.py to use the locked environment. To build documentation, pass --doc; Doxygen must also be installed on your machine.

You can install the build artifacts for this project into a specified location. To install the build artifacts, pass the --install option with the required path.

To create an archive containing the build artifacts, pass the --package-type option with an archive type such as zip or tgz. Use --package-dir to choose where the archive is written; by default, packages are written to the build directory.

For more command line options, see the help output:

python3 $SDK_PATH/sw/vgf-lib/scripts/build.py --help

Code coverage

Sync the locked test and tooling dependencies, then run the C++ and Python unit tests on Linux with GCC coverage instrumentation:

uv sync --locked --no-install-project --no-default-groups --group test --group tooling
uv run --no-sync python scripts/build.py --coverage --build-dir build-coverage

The command writes a detailed HTML report to build-coverage/coverage/index.html and a machine-readable JSON summary to build-coverage/coverage/summary.json. Coverage is collected for the native library and Python binding sources, including native code exercised through pytest. Python source-line coverage is not collected.

PyPI

The ML SDK VGF Library is available on PyPI as the ai-ml-sdk-vgf-library package.

Install:

pip install ai-ml-sdk-vgf-library

Install from source with pip

From the repository root, install the package with:

pip install .

This command compiles the project’s C/C++ library and Python extension, then installs the resulting Python package. Ensure the prerequisites listed in Building VGF Library from source are installed and the repository dependencies have been initialized.

Sequential wheel builds reuse native libraries and tools in a shared CMake tree under build/pip/<platform>/<build-type>. Python binding objects are kept in separate ABI directories, and Python discovery is refreshed for each build. Linux manylinux builds use their own platform directory instead of reusing host-built artifacts. Changing native build options still rebuilds affected targets through CMake.