Update BUILD.md (#90)

This commit is contained in:
Changming Sun 2018-12-05 00:40:27 +08:00 committed by Ke Zhang
parent 744ec28c88
commit 980e8aa270

View file

@ -1,5 +1,13 @@
# Build ONNX Runtime
## Supported architectures
| | x86_32 | x86_64 | ARM32 | ARM64 |
|-----------|:------------:|:------------:|:------------:|:------------:|
|Windows | YES | YES | YES | YES |
|Linux | YES | YES | YES | YES |
|Mac OS X | NO | YES | NO | NO |
## Supported dev environments
| OS | Supports CPU | Supports GPU| Notes |
@ -9,6 +17,7 @@
|Ubuntu 16.x | YES | YES | Also supported on ARM32v7 (experimental) |
|Ubuntu 17.x | YES | YES | |
|Ubuntu 18.x | YES | YES | |
|Fedora 23 | YES | YES | |
|Fedora 24 | YES | YES | |
|Fedora 25 | YES | YES | |
|Fedora 26 | YES | YES | |
@ -22,7 +31,7 @@ OS/Compiler Matrix:
| OS/Compiler | Supports VC | Supports GCC | Supports Clang |
|-------------|:------------:|:----------------:|:---------------:|
|Windows 10 | YES | Not tested | Not tested |
|Windows 10 | YES | Not tested | planning |
|Linux | NO | YES(gcc>=5.0) | YES |
ONNX Runtime python binding only supports Python 3.x. Please use python 3.5+.
@ -143,6 +152,35 @@ Then run it
```
## ARM Builds
We've experimental support for ARM builds. Please see [ARM docker file](dockerfiles/Dockerfile.arm32v7). Note that
We've experimental support for Linux ARM builds. Windows on ARM is well tested.
### Cross compiling on Linux(FASTER)
1. Get the corresponding toolchain. For example, if your device is Raspberry Pi and the device os is Ubuntu 16.04, you may use gcc-linaro-6.3.1 from [https://releases.linaro.org/components/toolchain/binaries](https://releases.linaro.org/components/toolchain/binaries)
2. Setup env vars
```bash
export PATH=/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin:$PATH
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
```
3. Get a pre-compiled protoc:
You may get it from https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip . Please unzip it after downloading.
4. Save the following content as tool.cmake
```
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CXX_COMPILER arm-linux-gnu-c++)
set(CMAKE_C_COMPILER arm-linux-gnu-gcc)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
```
5. append "-DCMAKE_TOOLCHAIN_FILE=path/to/tool.cmake" to your cmake args, run cmake and make to build it.
### Native compiling on Linux (SLOWER)
Please see [ARM docker file](dockerfiles/Dockerfile.arm32v7). Note that
to build in ACR-Build (Azure Container Registry), you may want to split it to two files and run them one by one.
If you run this Dockerfile directly in ACR-Build, it is likely to hit their timeout limitation (8 hours).
### Cross compiling on Windows
(TODO)