How to setup Kendryte RISC V GNU Compiler Toolchain (Ubuntu) - GaloisInc/betaflight GitHub Wiki

Install the packages needed to compile the source code

sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev

Clone the toolchain

git clone --recursive https://github.com/kendryte/kendryte-gnu-toolchain

Installation (Newlib)

Add the Kendryte's toolchain binary in the $PATH

  • vim ~/.bashrc or vim ~/.profile or other text editor than vim to add the binary in $PATH
  • Add /opt/kendryte-toolchain/bin to your $PATH
  • paste PATH=$PATH:/opt/kendryte-toolchain/bin in .bashrc or .profile
  • Source your .bashrc,type source ~/.bashrc and check with $ echo $PATH

If everything went well you should see in the output .../x86_64-linux:/opt/kendryte-toolchain/bin

Build

If /opt/ does not exist mkdir /opt

  • cd kendryte-gnu-toolchain
  • ./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f
  • In no errors then type make -j8

It might take some time to build the executables