Skip to content

Instantly share code, notes, and snippets.

@sam210723
Last active January 10, 2021 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sam210723/80d0f735eba42b1c332069067c9afc2c to your computer and use it in GitHub Desktop.
Save sam210723/80d0f735eba42b1c332069067c9afc2c to your computer and use it in GitHub Desktop.
Install RISC-V build toolchain on Xilinx ISE 14.7 VM (Oracle Linux Server 6.4)
#!/bin/bash
# Install RISC-V build toolchain on Xilinx ISE 14.7 VM (Oracle Linux Server 6.4)
# Build libmpc from source
rm -rf mpc-0.8.1
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz
tar zxvf mpc-0.8.1.tar.gz
cd mpc-0.8.1
./configure --disable-shared --enable-static --prefix=/tmp/gcc --with-gmp=/#tmp/gcc --with-mpfr=/tmp/gcc
make
make check
make install
cd ..
# Enable the Software Collection Library
# https://blogs.oracle.com/opal/getting-a-c11-compiler-for-node-4,-5-and-6-on-oracle-linux-6
echo -e "\n" >> /etc/yum.repos.d/public-yum-ol6.repo
echo -e "[ol6_software_collections]\n" >> /etc/yum.repos.d/public-yum-ol6.repo
echo -e "name=Software Collection Library release 1.2 packages for Oracle Linux 6 (x86_64)\n" >> /etc/yum.repos.d/public-yum-ol6.repo
echo -e "baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/SoftwareCollections12/x86_64/\n" >> /etc/yum.repos.d/public-yum-ol6.repo
echo -e "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle\n" >> /etc/yum.repos.d/public-yum-ol6.repo
echo -e "gpgcheck=1\n" >> /etc/yum.repos.d/public-yum-ol6.repo
echo -e "enabled=1\n" >> /etc/yum.repos.d/public-yum-ol6.repo
echo -e "\n" >> /etc/yum.repos.d/public-yum-ol6.repo
# Install packages
sudo yum install -y git autoconf automake mpfr-devel gmp-devel gawk bison flex texinfo patchutils gcc gcc-c++ zlib-devel expat-devel
sudo yum install -y scl-utils devtoolset-3
scl enable devtoolset-3 bash
# Build Python 3 from source
rm -rf python
mkdir python
cd python
wget http://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar xvzf Python-3.6.5.tgz
cd Python-3.6.5
./configure --prefix=/opt/python3.6
make
sudo make install
sudo ln -s /opt/python3.6/bin/python3.6 /usr/bin/python36
sudo ln -s /opt/python3.6/bin/python3.6 /usr/bin/python3
sudo ln -s /opt/python3.6/bin/idle3.6 /usr/bin/idle-python36
sudo ln -s /opt/python3.6/bin/pip3 /usr/bin/pip
cd ..
# Build RISC-V tools from source
rm -rf riscv-gnu-toolchain-rv32i
git clone --recursive https://github.com/riscv/riscv-gnu-toolchain riscv-gnu-toolchain-rv32i
cd riscv-gnu-toolchain-rv32i
./configure --prefix=/opt/riscv --with-arch=rv32i --with-abi=ilp32
export PATH="$PATH:/opt/riscv/bin"
sudo make
cd ..
# Build gtkwave from source
sudo yum install -y tcl-devel tk-devel gperf xz xz-devel
wget http://gtkwave.sourceforge.net/gtkwave-3.3.108.tar.gz
tar -xvf gtkwave-3.3.108.tar.gz
cd gtkwave-3.3.108
./configure
make
sudo make install
# Build iverilog from RPM
wget ftp://ftp.icarus.com/pub/eda/verilog/v11/verilog-11.0-0.src.rpm
rpmbuild --rebuild verilog-11.0-0.src.rpm
sudo yum -y localinstall ~/rpmbuild/RPMS/x86_64/verilog-11.0-0.x86_64.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment