44 lines
906 B
Bash
44 lines
906 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
RV1109_TOOL_CHAIN="/opt/atk-dlrv1126-toolchain"
|
||
|
|
||
|
|
||
|
# for rv1109/rv1126 armhf
|
||
|
GCC_COMPILER=${RV1109_TOOL_CHAIN}/usr/bin/arm-linux-gnueabihf
|
||
|
|
||
|
ROOT_PWD=$( cd "$( dirname $0 )" && cd -P "$( dirname "$SOURCE" )" && pwd )
|
||
|
|
||
|
# model_zoo_path root path
|
||
|
MZ_ROOT=$(pwd | sed 's/\(rknn_model_zoo-main\).*/\1/g')
|
||
|
echo $MZ_ROOT
|
||
|
# build rockx
|
||
|
BUILD_DIR=${ROOT_PWD}/build
|
||
|
|
||
|
if [[ ! -d "${BUILD_DIR}" ]]; then
|
||
|
mkdir -p ${BUILD_DIR}
|
||
|
fi
|
||
|
|
||
|
cd ${BUILD_DIR}
|
||
|
cmake .. \
|
||
|
-DCMAKE_C_COMPILER=${GCC_COMPILER}-gcc \
|
||
|
-DCMAKE_CXX_COMPILER=${GCC_COMPILER}-g++ \
|
||
|
-DMZ_ROOT=${MZ_ROOT} \
|
||
|
-DTARGET_SOC=RV1109_1126 \
|
||
|
-DCMAKE_SYSTEM_NAME=Linux
|
||
|
make -j4
|
||
|
make install
|
||
|
cd ..
|
||
|
|
||
|
cd ${BUILD_DIR}
|
||
|
cmake .. \
|
||
|
-DCMAKE_C_COMPILER=${GCC_COMPILER}-gcc \
|
||
|
-DCMAKE_CXX_COMPILER=${GCC_COMPILER}-g++ \
|
||
|
-DMZ_ROOT=${MZ_ROOT} \
|
||
|
-DTARGET_SOC=RV1109_1126 \
|
||
|
-DCMAKE_SYSTEM_NAME=Linux
|
||
|
make -j4
|
||
|
make install
|
||
|
|