Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Update toolchain to 2.10.2 #5

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot-overlay/configs/k230_canmv_01studio_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot-overlay/configs/k230_canmv_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot-overlay/configs/k230_evb_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot-overlay/configs/k230d_canmv_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot-overlay/configs/k230d_canmv_ilp32_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot-overlay/package/ai2d_kpu/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions buildroot-overlay/package/ai_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -43,4 +43,4 @@ foreach(file ${files})
endif()
endif()
endif()
endforeach()
endforeach()
6 changes: 3 additions & 3 deletions buildroot-overlay/package/ai_demo/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 编译完成******************"
Expand Down Expand Up @@ -456,4 +456,4 @@ for subdir in $(ls -d */); do
rm -rf out/*
done

rm -rf out
rm -rf out
8 changes: 4 additions & 4 deletions docs/linux_sdk快速入门指南.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ cd k230_linux_sdk
>gitee上仓库地址是 [email protected]: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配置需要)
>
Expand Down Expand Up @@ -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
```


Expand Down Expand Up @@ -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
```

开发板上运行:
Expand Down