Accueil > Outils > Programmation > Pre-compiled RISC-V GNU toolchain and spike

Pre-compiled RISC-V GNU toolchain and spike

mardi 17 septembre 2019

This is a precompiled version of the RISC-V GNU toolchain (gcc, as, ld, libc, ...) and spike simulator, generated from the sources and, with executables stripped to save disk space (the extracted /opt/riscv/ directory uses around 200 Mb of disk space).

Ubuntu 18.04 & 20.04

It was generated and tested on Ubuntu 18.04, tested on Ubuntu 20.04, and may or may not run elsewhere. Use at your own risk.

This archive needs to be extracted in /opt/riscv/ :

wget '' -O /tmp/riscv.tar.gz
cd /opt/
sudo tar -xzvf /tmp/riscv.tar.gz

The device-tree-compiler and libmpc3 packages need to be installed for spike to work. On Ubuntu, run :

sudo apt install libmpc3 device-tree-compiler

After installation, you can delete the file /tmp/riscv.tar.gz.

Executables are installed in /opt/riscv/bin/, which you need to add to your $PATH (in ~/.bashrc) :


Quick test to check that the toolchain is working :

echo '#include <stdio.h>' > foo.c; printf 'int main() {printf("Hello");}' >> foo.c; riscv64-unknown-elf-gcc foo.c -o foo; spike pk ./foo; echo

Must output :

bbl loader

Fedora 30

This archive was generated on Fedora 30, but is meant to be as self-contained as possible, it is likely to work on other systems. GCC should work regardless of the place where the archive is extracted, but spike pk won’t find pk nor the dtc executable unless the archive is extracted in /home/tpetu/Enseignants/matthieu.moy/mif08/.

wget '' -O /tmp/riscv-fedora.tar.gz
sudo mkdir -p /home/tpetu/Enseignants/matthieu.moy/mif08/
cd /home/tpetu/Enseignants/matthieu.moy/mif08/
sudo tar -xzvf /tmp/riscv-fedora.tar.gz

Documents joints

Valid XHTML 1.0 Transitional
SPIP | | Plan du site | Suivre la vie du site RSS 2.0
Habillage visuel © styleshout sous Licence Creative Commons Attribution 2.5 License