Skip to content

Instantly share code, notes, and snippets.

@MartinRGB
Last active November 14, 2023 06:16
Show Gist options
  • Save MartinRGB/6f56089f16acf86013e96eb7a473c1f3 to your computer and use it in GitHub Desktop.
Save MartinRGB/6f56089f16acf86013e96eb7a473c1f3 to your computer and use it in GitHub Desktop.
@MartinRGB
Copy link
Author

MartinRGB commented Nov 12, 2023

build riscv-gnu-toolchain

https://github.com/riscv-collab/riscv-gnu-toolchain

make linux:

./configure --prefix=/opt/riscv
make linux

make musl:

./configure --prefix=/opt/riscv
make musl

export PATH="$PATH:/opt/riscv/bin"


Upside not work for me,so I refer https://community.milkv.io/t/opencv-4-5-4/82

wget https://sophon-file.sophon.cn/sophon-prod-s3/drive/23/03/07/16/host-tools.tar.gz
tar xvf host-tools.tar.gz
cd host-tools 
touch riscv-crosstool-env-init 
nano riscv-crosstool-env-init 

content is:

HOST_TOOL_PATH=/xxx/xxx/xxx/host-tools

export PATH="$HOST_TOOL_PATH/gcc/riscv64-linux-x86_64/bin:$HOST_TOOL_PATH/gcc/riscv64-linux-musl-x86_64/bin:$HOST_TOOL_PATH/gcc/riscv64-elf-x86_64/bin:$PATH"

echo -e "\033[33;1mriscv交叉编译工具链环境配置完成!\033[0m"

in sdk root folder

source /xxx/xxx/xxx/host-tools/riscv-crosstool-env-init 

then you can compile the code

@MartinRGB
Copy link
Author

MartinRGB commented Nov 12, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment