diff --git a/BUILD.md b/BUILD.md index 4bda3f8b53..06d878f922 100644 --- a/BUILD.md +++ b/BUILD.md @@ -36,14 +36,17 @@ ONNX Runtime python binding only supports Python 3.5, 3.6 and 3.7. cd onnxruntime ``` 2. Install cmake-3.13 or better from https://cmake.org/download/. -3. (optional) Install protobuf 3.6.1 from source code (cmake/external/protobuf). CMake flag protobuf\_BUILD\_SHARED\_LIBS must be turned off. After the installation, you should have the 'protoc' executable in your PATH. -4. (optional) Install onnx from source code (cmake/external/onnx) +3. (optional) Install protobuf 3.6.1 from source code (cmake/external/protobuf). CMake flag protobuf\_BUILD\_SHARED\_LIBS must be turned OFF on Windows and turned ON on Linux. After the installation, you should have the 'protoc' executable in your PATH. On Linux it is recommended to run `ldconfig` to make sure protobuf libraries are found. +4. If you installed your protobuf in a non standard location it would be helpful on Linux build to set the following env var: +`export CMAKE_ARGS="-DONNX_CUSTOM_PROTOC_EXECUTABLE=full path to protoc"` so ONNX build can find it. +On Linux also run `ldconfig ` so the linker can find protobuf libraries. +5. (optional) Install onnx from source code (cmake/external/onnx) ``` export ONNX_ML=1 python3 setup.py bdist_wheel pip3 install --upgrade dist/*.whl ``` -5. Run `./build.sh --config RelWithDebInfo --build_wheel` for Linux (or `build.bat --config RelWithDebInfo --build_wheel` for Windows) +6. Run `./build.sh --config RelWithDebInfo --build_wheel` for Linux (or `build.bat --config RelWithDebInfo --build_wheel` for Windows). Upon successful build you should be able to find the wheel under `dist` folder. The build script runs all unit tests by default (for native builds and skips tests by default for cross-compiled builds).