From 8aacd785b14d360336b699e392dfe77610e518b0 Mon Sep 17 00:00:00 2001 From: Antkillerfarm Date: Mon, 11 Oct 2021 18:47:39 +0800 Subject: [PATCH] add doc for cmake build & run (#185) --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d4e1a0c..34e279f 100644 --- a/README.md +++ b/README.md @@ -21,19 +21,26 @@ Main Features Feel free to raise a github issue if you wish to add TIM-VX for other frameworks. -## Get started +# Get started -### Build and Run -TIM-VX supports both [bazel](https://bazel.build) and cmake. [Install bazel](https://docs.bazel.build/versions/master/install.html) to get started. +## Build and Run + +TIM-VX supports both [bazel](https://bazel.build) and cmake. + +### Bazel + +[Install bazel](https://docs.bazel.build/versions/master/install.html) to get started. TIM-VX needs to be compiled and linked against VeriSilicon OpenVX SDK which provides related header files and pre-compiled libraries. A default linux-x86_64 SDK is provided which contains the simulation environment on PC. Platform specific SDKs can be obtained from respective SoC vendors. -To build TIM-VX +To build TIM-VX: + ```shell bazel build libtim-vx.so ``` -To run sample LeNet +To run sample LeNet: + ```shell # set VIVANTE_SDK_DIR for runtime compilation environment export VIVANTE_SDK_DIR=`pwd`/prebuilt-sdk/x86_64_linux @@ -42,6 +49,35 @@ bazel build //samples/lenet:lenet_asymu8_cc bazel run //samples/lenet:lenet_asymu8_cc ``` +### Cmake + +To build TIM-VX: + +```shell +mkdir host_build +cd host_build +cmake .. +make -j8 +``` + +Cmake option: + +`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 ON. + +`TIM_VX_USE_EXTERNAL_OVXLIB`: Use external OVXLIB. Default is OFF. + +run unit test: + +```shell +cd host_build/src/tim +export LD_LIBRARY_PATH=`pwd`/../../../prebuilt-sdk/x86_64_linux/lib:$LD_LIBRARY_PATH +./unit_test +``` + +## Other + To build and run Tensorflow-Lite with TIM-VX, please see [README](https://github.com/VeriSilicon/tflite-vx-delegate#readme) To build and run TVM with TIM-VX, please see [TVM README](https://github.com/VeriSilicon/tvm/blob/vsi_npu/README.VSI.md)