-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
## Build | ||
|
||
We use CMake build system like most C++ projects. | ||
|
||
### Build dabnn | ||
|
||
Cross-compiling for ARMv8 Android: | ||
|
||
1. Download and unzip Android NDK from https://developer.android.com/ndk/downloads. | ||
|
||
1. Run cmake with the toolchain file, which determine the proper compiling toolchains. | ||
|
||
```bash | ||
mkdir build-dabnn | ||
cd build-dabnn | ||
cmake -DCMAKE_TOOLCHAIN_FILE=the_path_to_android_ndk/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release .. | ||
``` | ||
|
||
**If this step fails, please check whether the toolchain file really exists on the path you set.** | ||
|
||
1. Build | ||
|
||
```bash | ||
cmake --build . | ||
``` | ||
|
||
For ARMv7, just replace `-DANDROID_ABI=arm64-v8a` with `-DANDROID_ABI=armeabi-v7a` in step 2. | ||
|
||
For non-Android ARM devices, use the proper toolchain file for your device instead of the Android NDK toolchain file, or compile natively on your ARM device. | ||
|
||
For non-ARM devices, only the unoptimized code will work. If you still want to build dabnn for non-ARM devices, pass `-DBNN_BUILD_MAIN_LIB=ON` in step 2. | ||
|
||
### Build onnx2bnn | ||
|
||
On non-ARM devices, | ||
|
||
1. Run cmake | ||
|
||
```bash | ||
mkdir build-onnx2bnn | ||
cd build-onnx2bnn | ||
cmake .. | ||
``` | ||
|
||
1. Build | ||
|
||
```bash | ||
cmake --build . | ||
``` | ||
|
||
On ARM devices, pass `-DBNN_BUILD_MAIN_LIB=OFF` in step 1. |