Building the RISC-V GNU toolchain - recommended Vagrant configuration?

老子叫甜甜 提交于 2019-12-24 15:02:09

问题


I have tried and failed a few times to install the riscv-gnu-toolchain into a virtual machine. Does anyone have a suggested Linux / virtual machine configuration (ideally a Vagrantfile)? If I can't find one, I'll make one myself and share it here. Starting OS version, memory and hard-drive capacity - ideally non-GUI, and as minimal as makes sense.

Also, since it's such a huge build, are people having luck with multi-CPU setups and make -j6 (or your core-count) for parallel builds?


回答1:


This Vagrantfile does it. It was assembled from a number of sources (none of which had a summary of correct information).

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial64"
  # needs vagrant plugin install vagrant-disksize:
  config.disksize.size = '40GB'
  config.vm.provider "virtualbox" do |v|
    v.linked_clone = true
    v.cpus = 12
    v.memory = 8192
    v.name = "RISC-V Toolchain (Ubuntu 16)"
  end
  config.vm.provision "shell", inline: <<-SHELL
    echo "updating apt"
    apt-get update
    echo "installing dependencies"
    apt-get install -y 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
    mkdir /opt/riscv
    chown vagrant:vagrant /opt/riscv
    cd /home/vagrant
    echo "checking out toolchain"
    export HOME=/home/vagrant
    sudo -u vagrant git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
    cd riscv-gnu-toolchain
    echo "configuring toolchain"
    sudo -u vagrant ./configure --prefix=/opt/riscv --enable-multilib
    echo "building toolchain"
    sudo -u vagrant make -j 12 linux
    echo "vagrant provisioner - running tests"
    apt-get install -y expect libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev python
    sudo -u vagrant ./configure --prefix=/opt/riscv
    sudo -u vagrant make report-linux
  SHELL
end


来源:https://stackoverflow.com/questions/58400105/building-the-risc-v-gnu-toolchain-recommended-vagrant-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!