Switch language한국어
Back to the list

Setting Up and Using ONNX Runtime for C++ in Linux

TL;DR AI

Key summary

2 min read
  1. ONNX Runtime lets you run .onnx models in native C++ programs on Linux without a Python environment.

  2. Install GCC and CMake, then download the Linux C++ ONNX Runtime package and extract it into your project.

  3. Copy the runtime include and lib folders into external/onnxruntime, add the ONNX Runtime shared target in CMake, and set BUILD_RPATH.

  4. The example uses squeezenet1_1 and a simple C++ program that runs inference with a dummy tensor and prints the result.

Read the original