supertone-inc / onnxruntime-build

A build project for ONNX Runtime
32 stars 17 forks source link

How to produce minimal build? #11

Closed IvanPizhenko closed 8 months ago

IvanPizhenko commented 8 months ago

Standard ONNX runtime build manual says it is possible to produce minimal build. For that, it suggests passing some option to the shell script which performs the build. I have dug into that and found that finally it maps to passing following options to cmake:

-Donnxruntime_DISABLE_RTTI=ON
-Donnxruntime_MINIMAL_BUILD=ON

and maybe

-Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=ON

But how do I pass these options in this build system?

krazijames commented 8 months ago

https://github.com/supertone-inc/onnxruntime-build/blob/434229d3ba921d557eaa80ac3f267b63fda3f7c1/build-static_lib.sh#L40 You may utilize CMAKE_OPTIONS env variable to pass options for running cmake.

For example:

> CMAKE_OPTIONS="-Donnxruntime_DISABLE_RTTI=ON -Donnxruntime_MINIMAL_BUILD=ON" ./build-static_lib.sh