Library / SDK
xboot/libonnx avatar
xboot/libonnx

libonnx says make produces a static library, and its Makefile never builds one

A lightweight, portable pure C99 onnx inference engine for embedded devices with hardware acceleration support.

657 stars115 forksCMIT

At a glance

What is it?
A pure C99 ONNX inference engine for embedded devices, dropped into a project as source files and compiled alongside it. The documentation is thin and usable, with three small mismatches between what it claims and what the repository contains.
Who is it for?
For a small embedded inference need, this is a usable design with an honest API: five documented calls, a resolver array for hardware acceleration, models either read from a file or compiled into the binary, and no external runtime to install. The rough edges are all in the build and the version story.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 131 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • xboot/libonnx657 ★ · +5
Star history
Repository2026-09-112026-11-15
xboot/libonnx652657

5 Stars in the last 65 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The ONNX version in the notes and the link behind it disagree

The notes carry the library's one version claim: it is based on the ONNX version v1.17.0, with support for the newest opset 24. The link on those words points somewhere else. The text reads v1.17.0 and the address it points at is the v1.19.0 tree of the same repository. So a reader who trusts the label gets one version and a reader who follows the link gets another, and nothing else on the page resolves it. Beside the claim sits the file that matters more in practice, a supported operator table in the documents directory, which is where an embedded user should actually check before porting a model.

The root Makefile builds four sub-projects and never the library

The compilation section says that typing `make` at the root produces a static library plus binaries of the examples and the tests. The root Makefile does not do that. Its whole target list is two phony targets, `all` and `clean`, and `all` is four recursive calls:

code
all:
	$(MAKE) -C examples/hello all
	$(MAKE) -C examples/benchmark all
	$(MAKE) -C examples/mnist all
	$(MAKE) -C tests all

There is no rule that compiles `src/` into an archive. So the documented outcome and the documented command disagree, and the library itself is reached through a sub-project the page does not name. That is consistent with how the library is meant to be consumed, since the getting started text says the C and header files can be dropped into a project and compiled along with it, but it means the static library claim is not something the top of the build produces.

A plain make needs SDL2 before the page mentions SDL2

The root target builds three example projects, and one of them is graphical. Compiling the mnist example requires SDL2 and SDL2 GFX, installed on Ubuntu with:

shell
    apt-get install libsdl2-dev libsdl2-gfx-dev

That instruction appears in a subsection about the mnist example, after the reader has already been told to just type make. Since make at the root descends into the mnist project, an undocumented dependency sits in front of the first build step on any machine without those development packages, which is most headless build agents. The screenshot link points at the same example as the only one with a picture, and the benchmark example is built by the root target too without a word of documentation about it.

Five calls are the whole API, and the sample skips acceleration

The getting started path is four lines of C. A context comes from a file with `onnx_context_alloc_from_file`, tensors are found by name with `onnx_tensor_search`, inference runs with `onnx_run`, and the context is released with `onnx_context_free`. Hardware acceleration is the interesting part of that signature: an array of `struct resolver_t *` can be passed for it, and the getting started call passes `NULL` and `0` instead, so the sample demonstrates the plain software path and never names a resolver implementation. No error handling appears anywhere, no return value is checked, and the page does not say what `onnx_run` gives back or how a caller learns that an operator was missing.

Two ways to load a model, and the embedded one is Linux only

The notes describe the route the examples actually use. On Linux, `xxd -i <filename.onnx>` converts a model into an unsigned char array, which is then handed to `onnx_context_alloc`, and the page states plainly that this is how the hello and mnist examples load their models. So there are two supported entry points, a file on disk and a compiled-in array, and the compiled-in route is what the shipped examples demonstrate, which is the right choice for firmware where a filesystem may not exist. The catch is the platform: the tool named is a Linux one, and a Windows or bare-metal build has to supply its own byte array by another route, which the page does not mention.

The sample test output stops in the middle of a line

Running the tests is two commands, a change into the built output directory and the runner with the model folder as its argument:

shell
cd libonnx/tests/output
./tests ../model

What follows is four complete lines of OKAY results for mnist and mobilenet, and then a fifth line that stops partway through, at the fragment `[shufflenet_v1_9](tes`. So the only evidence of what a passing run looks like is itself cut off, and the reader cannot tell whether the remaining models passed, failed or were skipped. The paragraph after it is the honest part: running the tests on other folders may not succeed, because some operators are not implemented.

No releases, one cross-compile variable, and no install target

There is nothing to pin. The repository publishes no releases and no tags, so the only version statement anywhere is the opset claim in the notes, and the last commit is dated 7 July 2026. Cross compilation is one variable: `make CROSS_COMPILE=path/to/toolchains/aarch64-linux-gnu-` compiles everything for the platform, and the page says to point it at your toolchain, with arm64 as the worked example and no other architecture named. There is also no install target at the root, which matches the intended distribution model of copying the sources into your own project. The tree itself is small, with src, tests, examples, tools and documents directories, and the tools folder is offered for help with model files.

Editorial conclusion

For a small embedded inference need, this is a usable design with an honest API: five documented calls, a resolver array for hardware acceleration, models either read from a file or compiled into the binary, and no external runtime to install. The rough edges are all in the build and the version story. The top-level Makefile builds examples and tests and nothing else, so the static library the page promises comes from a sub-project you have to find. The notes name one ONNX version and link another. And the repository publishes no releases at all, so there is nothing to pin except the branch. Before depending on it, build it yourself and record the resulting artifacts, read the supported operator table rather than trusting the opset number, and check which of your model's operators are implemented, since the page says outright that running the tests on other model folders may fail. It suits a fixed model on constrained hardware. It does not suit a team that wants a versioned dependency with a release to track.

Frequently asked questions

What is libonnx?

A lightweight, portable, pure C99 ONNX inference engine aimed at embedded devices, MIT licensed. You allocate a context, look up input and output tensors by name, run inference, and free the context, and you can pass an array of resolver structs for hardware acceleration. Its C and header files are meant to be dropped into a project and compiled alongside it.

How do I build libonnx?

Change into the checkout and run make. The root Makefile then builds the hello, benchmark and mnist examples plus the tests. Compiling mnist additionally needs SDL2 and SDL2 GFX, installed on Ubuntu with `apt-get install libsdl2-dev libsdl2-gfx-dev`. For another architecture, pass a toolchain prefix such as CROSS_COMPILE=path/to/toolchains/aarch64-linux-gnu-.

Does libonnx support hardware acceleration?

The API has a slot for it: an array of `struct resolver_t *` can be passed when the context is allocated, and the page does not name a resolver implementation. The getting started example passes NULL and 0, so it demonstrates the software path only.

Which ONNX version and operators does libonnx support?

The notes say it is based on ONNX v1.17.0 with support for the newest opset 24, though the link labelled v1.17.0 points at the v1.19.0 tree. The page warns that some operators are not implemented and points to a supported operator table in the documents directory, and says running the tests on other model folders may fail.

Does libonnx publish releases I can pin?

No. The repository has no GitHub releases and no tags, so there is nothing to pin beyond the branch itself. The only version statement on the page is the opset claim in the notes.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. xboot/libonnx on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/xboot-libonnx.svg)](https://hysenlabs.com/projects/xboot-libonnx)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/xboot-libonnx.svg)](https://hysenlabs.com/projects/xboot-libonnx)

Was this useful?