From 889a6b2657b7243cac1ac52d247a6110971157c2 Mon Sep 17 00:00:00 2001 From: Sungjoon Moon Date: Wed, 27 Nov 2024 02:40:21 +0900 Subject: [PATCH] Update toolchain to 2.10.2 --- README.md | 4 ++-- buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig | 2 +- .../configs/BPI-CanMV-K230D-Zero_ilp32_defconfig | 2 +- buildroot-overlay/configs/k230_canmv_01studio_defconfig | 2 +- buildroot-overlay/configs/k230_canmv_defconfig | 2 +- buildroot-overlay/configs/k230_evb_defconfig | 2 +- buildroot-overlay/configs/k230d_canmv_defconfig | 2 +- buildroot-overlay/configs/k230d_canmv_ilp32_defconfig | 2 +- buildroot-overlay/package/ai2d_kpu/Makefile | 2 +- buildroot-overlay/package/ai_demo/CMakeLists.txt | 6 +++--- buildroot-overlay/package/ai_demo/build.sh | 6 +++--- ...37\345\205\245\351\227\250\346\214\207\345\215\227.md" | 8 ++++---- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d3302ee..264d68d 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ ## Install toolchain and dependencies -download Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1-20240712.tar.gz toolchan from `https://www.xrvm.cn/community/download?id=4333581795569242112` +download Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2-20240712.tar.gz toolchan from `https://www.xrvm.cn/community/download?id=4333581795569242112` uncompress the toolchain to the /opt/toolchain(Refer command): ```bash mkdir -p /opt/toolchain; -tar -zxvf Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1-20240712.tar.gz -C /opt/toolchain; +tar -zxvf Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2-20240712.tar.gz -C /opt/toolchain; ``` install dependencies(Refer command): diff --git a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig index 0fc6633..8f7945d 100755 --- a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig +++ b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig @@ -3,7 +3,7 @@ BR2_RISCV_ISA_RVC=y BR2_RISCV_ISA_RVV=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y -BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1" +BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_6=y diff --git a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig index a1e7d28..27cbcce 100755 --- a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig +++ b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig @@ -4,7 +4,7 @@ BR2_RISCV_ISA_RVV=y BR2_RISCV_32=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y -BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1" +BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_6=y diff --git a/buildroot-overlay/configs/k230_canmv_01studio_defconfig b/buildroot-overlay/configs/k230_canmv_01studio_defconfig index 320b86b..ef11724 100755 --- a/buildroot-overlay/configs/k230_canmv_01studio_defconfig +++ b/buildroot-overlay/configs/k230_canmv_01studio_defconfig @@ -3,7 +3,7 @@ BR2_RISCV_ISA_RVC=y BR2_RISCV_ISA_RVV=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y -BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1" +BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_6=y diff --git a/buildroot-overlay/configs/k230_canmv_defconfig b/buildroot-overlay/configs/k230_canmv_defconfig index b5310b5..a77d0ee 100755 --- a/buildroot-overlay/configs/k230_canmv_defconfig +++ b/buildroot-overlay/configs/k230_canmv_defconfig @@ -4,7 +4,7 @@ BR2_RISCV_ISA_RVV=y BR2_TARGET_OPTIMIZATION="-mcpu=c908v" BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y -BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1" +BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_6=y diff --git a/buildroot-overlay/configs/k230_evb_defconfig b/buildroot-overlay/configs/k230_evb_defconfig index 7e3e200..8512ea2 100755 --- a/buildroot-overlay/configs/k230_evb_defconfig +++ b/buildroot-overlay/configs/k230_evb_defconfig @@ -3,7 +3,7 @@ BR2_RISCV_ISA_RVC=y BR2_RISCV_ISA_RVV=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y -BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1" +BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_6=y diff --git a/buildroot-overlay/configs/k230d_canmv_defconfig b/buildroot-overlay/configs/k230d_canmv_defconfig index b15b75f..3e27b67 100755 --- a/buildroot-overlay/configs/k230d_canmv_defconfig +++ b/buildroot-overlay/configs/k230d_canmv_defconfig @@ -3,7 +3,7 @@ BR2_RISCV_ISA_RVC=y BR2_RISCV_ISA_RVV=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y -BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1" +BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_6=y diff --git a/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig b/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig index 728fb30..7134bb2 100755 --- a/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig +++ b/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig @@ -4,7 +4,7 @@ BR2_RISCV_ISA_RVV=y BR2_RISCV_32=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y -BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1" +BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_6=y diff --git a/buildroot-overlay/package/ai2d_kpu/Makefile b/buildroot-overlay/package/ai2d_kpu/Makefile index 95448c7..d30fb66 100755 --- a/buildroot-overlay/package/ai2d_kpu/Makefile +++ b/buildroot-overlay/package/ai2d_kpu/Makefile @@ -1,4 +1,4 @@ -CXX=/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/bin/riscv64-unknown-linux-gnu-g++ +CXX=/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/bin/riscv64-unknown-linux-gnu-g++ OBJ = main.cpp diff --git a/buildroot-overlay/package/ai_demo/CMakeLists.txt b/buildroot-overlay/package/ai_demo/CMakeLists.txt index 2cc4af2..d578ec3 100644 --- a/buildroot-overlay/package/ai_demo/CMakeLists.txt +++ b/buildroot-overlay/package/ai_demo/CMakeLists.txt @@ -7,7 +7,7 @@ if (NOT DEFINED BR2_PRIMARY_SITE) set(BR2_PRIMARY_SITE "https://ai.b-bug.org/~/wangjianxin/dl/") endif() # 设置编译器路径 -set(CMAKE_C_COMPILER /opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/bin/riscv64-unknown-linux-gnu-gcc) +set(CMAKE_C_COMPILER /opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/bin/riscv64-unknown-linux-gnu-gcc) set(sdk_root "${PROJECT_SOURCE_DIR}/../../../") set(usr_root "${sdk_root}/output/k230_canmv_defconfig/host/riscv64-buildroot-linux-gnu/sysroot/usr") @@ -22,7 +22,7 @@ include_directories(./common) link_directories(${usr_root}/lib/) -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/sysroot/usr/lib64/lp64d -L/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/sysroot/") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/sysroot/usr/lib64/lp64d -L/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/sysroot/") # 定义要排除的目录列表 set(exclude_dirs "cmake" "k230_bin" "shell" "out" "llamac" ".git" "common" "kmodel" "face_detect") @@ -43,4 +43,4 @@ foreach(file ${files}) endif() endif() endif() -endforeach() \ No newline at end of file +endforeach() diff --git a/buildroot-overlay/package/ai_demo/build.sh b/buildroot-overlay/package/ai_demo/build.sh index 5824ac4..f126880 100755 --- a/buildroot-overlay/package/ai_demo/build.sh +++ b/buildroot-overlay/package/ai_demo/build.sh @@ -51,7 +51,7 @@ for subdir in $(ls -d */); do fi if [ "$subdir_name" = "llamac" ] && { [ "$curr_pro" = "llamac" ] || [ "$curr_pro" = "all" ]; }; then - /opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/bin/riscv64-unknown-linux-gnu-g++ -O3 llamac/llama_run.cc -o out/llama_run -lm + /opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/bin/riscv64-unknown-linux-gnu-g++ -O3 llamac/llama_run.cc -o out/llama_run -lm elif { [ "$curr_pro" = "$subdir_name" ] || [ "$curr_pro" = "all" ]; }; then echo "******************$subdir_name 开始编译******************" if [ "$subdir_name" = "pose_det_rtsp_plug" ]; then @@ -65,7 +65,7 @@ for subdir in $(ls -d */); do cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=`pwd` \ -D$subdir_name=ON \ - -DCMAKE_C_COMPILER=/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/bin/riscv64-unknown-linux-gnu-gcc \ + -DCMAKE_C_COMPILER=/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/bin/riscv64-unknown-linux-gnu-gcc \ .. make -j && make install echo "******************$subdir_name 编译完成******************" @@ -456,4 +456,4 @@ for subdir in $(ls -d */); do rm -rf out/* done -rm -rf out \ No newline at end of file +rm -rf out diff --git "a/docs/linux_sdk\345\277\253\351\200\237\345\205\245\351\227\250\346\214\207\345\215\227.md" "b/docs/linux_sdk\345\277\253\351\200\237\345\205\245\351\227\250\346\214\207\345\215\227.md" index 8a9f1fb..0e6e27d 100755 --- "a/docs/linux_sdk\345\277\253\351\200\237\345\205\245\351\227\250\346\214\207\345\215\227.md" +++ "b/docs/linux_sdk\345\277\253\351\200\237\345\205\245\351\227\250\346\214\207\345\215\227.md" @@ -27,11 +27,11 @@ cd k230_linux_sdk >gitee上仓库地址是 git@gitee.com:kendryte/k230_linux_sdk.git ### 安装交叉工具链 -下载Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1-20240712.tar.gz (下载地址1:https://www.xrvm.cn/community/download?id=4333581795569242112 ,下载地址2:https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1721095219235/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1-20240712.tar.gz)文件,并解压缩到/opt/toolchain目录 (参考命令如下): +下载Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2-20240712.tar.gz (下载地址1:https://www.xrvm.cn/community/download?id=4352528597269942272 ,下载地址2:https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource/1836682/1725612383347/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2-20240904.tar.gz)文件,并解压缩到/opt/toolchain目录 (参考命令如下): ```bash mkdir -p /opt/toolchain; -tar -zxvf Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1-20240712.tar.gz -C /opt/toolchain; +tar -zxvf Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2-20240712.tar.gz -C /opt/toolchain; ``` > 安装新32位交叉工具链(下载地址:https://github.com/ruyisdk/riscv-gnu-toolchain-rv64ilp32/releases/download/2024.06.25/riscv64ilp32-elf-ubuntu-22.04-gcc-nightly-2024.06.25-nightly.tar.gz)(可选, 只有k230d_canmv_ilp32_defconfig配置需要) > @@ -330,7 +330,7 @@ int main() 编译程序 ```shell -/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/bin/riscv64-unknown-linux-gnu-gcc hello.c -o hello +/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/bin/riscv64-unknown-linux-gnu-gcc hello.c -o hello ``` @@ -494,7 +494,7 @@ int main() { 编译: ```bash -/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv_xtheadc rvv.c -o rvv +/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.2/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv_xtheadc rvv.c -o rvv ``` 开发板上运行: