Skip to content

Commit 078ed1a

Browse files
committed
docs: expand packaging guidance
1 parent c0bae37 commit 078ed1a

1 file changed

Lines changed: 28 additions & 10 deletions

File tree

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ end
6363

6464
You will need [Rust](https://www.rust-lang.org/tools/install) for compilation to succeed.
6565

66-
### Precompiled NIFs
67-
68-
If you are packaging Ortex with a precompiled NIF, set `ORTEX_SKIP_COMPILE=1` during
69-
compilation to avoid building the Rust crate. Ensure the NIF (and any required
70-
`libonnxruntime` binaries) are available in `priv/native` for the target platform.
71-
72-
```sh
73-
ORTEX_SKIP_COMPILE=1 mix compile
74-
```
75-
7666
## Execution provider features
7767

7868
Ortex relies on `ort` cargo features to compile support for non-CPU execution providers.
@@ -89,3 +79,31 @@ ORTEX_FEATURES=cuda,tensorrt mix compile
8979
```
9080

9181
Enabling GPU providers requires the relevant system toolchains to be installed.
82+
83+
### Packaging and Offline Builds
84+
85+
If you are packaging Ortex with a precompiled NIF, set `ORTEX_SKIP_COMPILE=1` during
86+
compilation to avoid building the Rust crate. Ensure the NIF (and any required
87+
`libonnxruntime` binaries) are available in `priv/native` for the target platform.
88+
89+
```sh
90+
ORTEX_SKIP_COMPILE=1 mix compile
91+
```
92+
93+
For offline or system-provided ONNX Runtime builds, you can disable downloads and
94+
link dynamically using a local runtime install:
95+
96+
```sh
97+
ORTEX_SKIP_DOWNLOAD=1 \
98+
ORT_PREFER_DYNAMIC_LINK=1 \
99+
ORT_LIB_LOCATION=/path/to/onnxruntime/lib \
100+
mix compile
101+
```
102+
103+
If your package provides `libonnxruntime.pc`, enable pkg-config lookup:
104+
105+
```sh
106+
ORTEX_FEATURES=pkg-config \
107+
PKG_CONFIG_PATH=/path/to/onnxruntime/lib/pkgconfig \
108+
mix compile
109+
```

0 commit comments

Comments
 (0)