1

我正在尝试从 Linux 上的源代码构建 onnxruntime。根据这个指令,我已经成功构建了 python 轮子和共享库。但我还没有看到 C API 的标头。

有一个构建选项--build_csharp似乎可以启用 C#/C 包。我尝试添加此选项,但出现以下错误。

CMake Warning at CMakeLists.txt:137 (message):
Language Csharp is not found in the system

我安装了 dotnet-sdk-3.1 但仍然出现此错误。请问如何在Linux上正确生成onnxruntime C API?谢谢!

4

1 回答 1

2

请尝试以下步骤:

- Steps to build ONNX from source code:
1. git clone --recursive https://github.com/Microsoft/onnxruntime
2. Get the commit ID of the version you want to build (In case you want older version)
3. git checkout "your commitID"
4. Install the required version of Cmake on your system
6. Run: <path>\build.sh --config Release --build_shared_lib --parallel
7. A build folder will be created in the onnxruntime.
5. Get the onnxruntime.dll from the dir: \onnxruntime\build\Windows\Release\Release
6. 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.
于 2020-11-11T09:12:23.303 回答