Skip to content

Commit

Permalink
Added onnxruntime binary copy instructions for build from source
Browse files Browse the repository at this point in the history
  • Loading branch information
natke committed Feb 23, 2024
1 parent 25b422e commit 9cd5318
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,50 @@ This step requires `cmake` to be installed.

2. Install ONNX Runtime

By default, the onnxruntime-genai build expects to find the ONNX Runtime include and binaries in a folder called `ort` in the root directory of onnxruntime-genai. You can put the ONNX Runtime files in a different location and specify this location to the onnxruntime-genai build. These instructions use ORT_HOME as the location.

* Install from release

These instructions are for the Linux GPU build of ONNX Runtime. Replace the location with the operating system and target of choice.

```bash
mkdir -p ort
cd ort
cd $ORT_HOME
wget https://github.com/microsoft/onnxruntime/releases/download/v1.17.0/onnxruntime-linux-x64-gpu-1.17.0.tgz
tar xvzf onnxruntime-linux-x64-gpu-1.17.0.tgz
mv onnxruntime-linux-x64-gpu-1.17.0/include .
mv onnxruntime-linux-x64-gpu-1.17.0/lib .
```

* Or copy equivalent files from a local source build
* Or build from source

```
git clone https://github.com/microsoft/onnxruntime.git
cd onnxruntime
./build.sh --build_shared_lib --skip_tests --parallel [--use_cuda]
```

Create include and lib folders in the ORT_HOME directory

```bash
mkdir $ORT_HOME/include
mkdir $ORT_HOME/lib
```

Build from source and copy the include and libraries into ORT_HOME

On Windows

```cmd
build.bat --build_shared_lib --skip_tests --parallel [--use_cuda]
copy include\onnxruntime\core\session\onnxruntime_c_api.h $ORT_HOME\include
copy build\Windows\Debug\Debug\*.dll $ORT_HOME\lib
```

On Linux

```cmd
./build.sh --build_shared_lib --skip_tests --parallel [--use_cuda]
cp include/onnxruntime/core/session/onnxruntime_c_api.h $ORT_HOME/include
cp build/Linux/RelWithDebInfo/libonnxruntime*.so* $ORT_HOME/lib
```

3. Build onnxruntime-genai
Expand Down

0 comments on commit 9cd5318

Please sign in to comment.