onnxruntime_Cxx_api.h no such file

Asked by Tiger Beard

The packet seems missing onnxruntime_Cxx_api.h and other headers

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu onnx Edit question
Assignee:
No assignee Edit question
Solved by:
Tiger Beard
Solved:
Last query:
Last reply:
Revision history for this message
Tiger Beard (catman2) said :
#1

I installed the package "libonnx-dev" to the get SO and the required headers.

But when compiling code using this lib I get error "No such file or directory". And in the install path
 /us/include/onnx there is non of the API header files, indeed.

OnStack Overflow i found this info :
    Get the required headers (onnxruntime_c_api.h, onnxruntime_cxx_api.h, onnxruntime_cxx_inline.h)
    from the dir: \onnxruntime\include\onnxruntime\core\session and put it in the unit location.

    ref: https://stackoverflow.com/questions/62617626/how-to-generate-c-api-for-onnxruntime-on-linux

Basically it says installing the lib mannually is
1. compile the SO.
2. copy the following headers from the source tree
 onnxruntime_c_api.h
 onnxruntime_cxx_api.h
 onnxruntime_cxx_inline.h

What I am missing when none of those headers is after installation in /usr/include/onnx. If that is not a bug, where I am supposed to get those headers from after installing the package with apt - is there any way to get those headers on the system in an automated way?

Thanks.

Revision history for this message
Tiger Beard (catman2) said :
#2

AddON: The missing files are in the 22.04 Jammy package.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

You are confusing onnx and onnxruntime. They are separate packages, with onnxruntime being available in the official Ubuntu repositories only for the future Ubuntu 24.10 release, but also provided in PPAs (see https://launchpad.net/ubuntu/+ppas?name_filter=onnxruntime - standard disclaimer for PPAs applies).

Revision history for this message
Tiger Beard (catman2) said :
#4

Thansk for your answer that is very helpful and explains a lot.

Just in case the maintainer reads this: ONNX is not my area of expertise, I just needed it as a part of a longer chain of build dependencies. So I guess its fair to say that for an uninitated developer its a bit of a surprise that there is a neural network support library package where the project has different libs for "normal" (whatever that is) and "runtime" and only one is contains in the repository.

The issue would have resolved itself easily if "apt search onnx" would turn up both packages or at least a hint in any of the texts.

So may I kindly suggest as an improvement to add the following line to the package test

 "ONNX" uses a different library for runtime which is not (yet) included in the repository.

Might have other users a few hours of time. :-)

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Why should onnx give a hint to onnxruntime?
These are independent projects, even the web pages https://onnx.ai/ and https://onnxruntime.ai/ are different
Same with https://github.com/onnx/onnx vs. https://github.com/microsoft/onnxruntime
and for Ubuntu: https://launchpad.net/ubuntu/+source/onnx and https://launchpad.net/ubuntu/+source/onnxruntime

Revision history for this message
Tiger Beard (catman2) said :
#6

Oh, I was not aware of that.

Why? - maybe for the same reason as gcc gives out compiler warnings like "no symbol 'MyClassPrt', did you mean MyClassPtr ?". Why should they care, the could just say "no symbol 'MyClasPrt'".

Do you know any other library in the whole repository that uses the same name for different projects (considering onnx'runtime' an extension to 'onnx') or similar cases?

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

For example:
https://launchpad.net/ubuntu/+source/snap is a DNA sequence analysis platform
https://launchpad.net/ubuntu/+source/snapd enables to Install, configure, refresh and remove snap packages (a specific form of software delivery)

Revision history for this message
Tiger Beard (catman2) said :
#8

Right, thanks for finding that.
I have learned something new today to watch out for.

Seems I am just a very ignorant person. Hopefully there are no others ;-)