Refine readme (#273)

Signed-off-by: ZhangXiang <Xiang.Zhang@verisilicon.com>
This commit is contained in:
Sven 2022-01-17 18:22:39 +08:00 committed by GitHub
parent e6eeb5dbee
commit 04cd392b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 13 deletions

View File

@ -32,9 +32,10 @@ Feel free to raise a github issue if you wish to add TIM-VX for other frameworks
## Build and Run
TIM-VX supports both [bazel](https://bazel.build) and cmake.
TIM-VX supports both [bazel](https://bazel.build) and [cmake](https://cmake.org).
### Cmake
----
### cmake
To build TIM-VX for x86 with prebuilt:
@ -48,16 +49,19 @@ make install
All install files (both headers and *.so) is located in : `host_build/install`
Cmake option:
cmake options:
`CONFIG`: Set Target Platform. Such as: `A311D`, `S905D3`, `vim3_android`, `YOCTO`. Default is `X86_64_linux`.
`TIM_VX_ENABLE_TEST`: Build the unit test. Default is OFF.
`TIM_VX_USE_EXTERNAL_OVXLIB`: Use external OVXLIB. Default is OFF.
`EXTERNAL_VIV_SDK`: use external VX driver libs. By default is OFF.
| option name | Summary | Default |
| ----- | ----- | ----- |
|`TIM_VX_ENABLE_TEST`| Enable unit test case for public APIs and ops | OFF |
|`TIM_VX_ENABLE_LAYOUT_INFER`| Build with tensor data layout inference support| ON |
|`TIM_VX_USE_EXTERNAL_OVXLIB`| Replace internal with a prebuilt libovxlib library | OFF |
|`OVXLIB_LIB`|full path to libovxlib.so include so name, required if `TIM_VX_USE_EXTERNAL_OVXLIB`=ON | Not set |
|`OVXLIB_INC`|ovxlib's include path, required if `TIM_VX_USE_EXTERNAL_OVXLIB`=ON| Not set |
|`EXTERNAL_VIV_SDK`| Give external vivante openvx driver libraries | OFF |
|`TIM_VX_BUILD_EXAMPLES`| Build example applications | OFF |
----
run unit test:
```shell
@ -80,6 +84,7 @@ export DISABLE_IDE_DEBUG=1
cmake ../ -DTIM_VX_ENABLE_TEST=ON -DFETCHCONTENT_SOURCE_DIR_GOOGLETEST=<wksp_root/googletest> <add other cmake define here>
```
----
#### Build for your evk-board
1. prepare toolchain file follow cmake standard
@ -87,11 +92,11 @@ export DISABLE_IDE_DEBUG=1
3. add -DEXTERNAL_VIV_SDK=<low-level-driver/out/sdk> to cmake definitions, also remember -DCMAKE_TOOLCHAIN_FILE=<Your_Toolchain_Config>
4. then make
#### Notes for integration
----
#### Important notice for integration
If you want to build tim-vx as a static library, and link it to your shared library or application, please be carefull with the linker, "-Wl,--whole-archive" is required.
@see samples/lenet/CMakeLists.txt for reference
@see **samples/lenet/CMakeLists.txt** for reference
### Bazel