diff --git a/README.md b/README.md index 4dffe5f26..c8a013ecc 100644 --- a/README.md +++ b/README.md @@ -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