Setting up RISC-V Toolchain on Ubuntu 24.04/22.04
Last updated
Was this helpful?
Last updated
Was this helpful?
Install dependencies
Create target directory
Clone riscv-gnu-toolchain repository
To enable fp16 support, we need GCC 14.1.0. By 2024-12-29, the source has already bumped to GCC 14.2, so we don't need to do anything here.
The gcc submodule is from https://gcc.gnu.org/git/gcc.git, but here is a Github mirror of it that is more convenient to work with and reference:
Configure the project
prefix should match the target installation directory, and must be in absolute path.
Finally, build the project
The toolchain should be installed in the target directory. Add the following to ~/.bashrc to include them on PATH