Skip to content

Instantly share code, notes, and snippets.

@ihsan314
Last active February 19, 2024 23:18
Show Gist options
  • Save ihsan314/2343959869d2ed4f3c5835a5473bff58 to your computer and use it in GitHub Desktop.
Save ihsan314/2343959869d2ed4f3c5835a5473bff58 to your computer and use it in GitHub Desktop.
Install Modelsim/Quartus on Ubuntu 20.04/Fedora 32

How to install Modelsim and Quartus on Fedora 32 and Ubuntu 20.04

I tried these steps in virtual machines with these OSes, and successfully got Modelsim and Quartus to open.

  1. Update your system.

    Fedora:

    sudo dnf upgrade --refresh

    Ubuntu:

    sudo apt update
    sudo apt upgrade
  2. Install dependencies.

    Fedora:

    sudo dnf install libX11.i686 libXext.i686 libXft.i686 libuuid.i686 libnsl.i686 libnsl.x86_64 \
                     libtool zlib-devel.x86_64 zlib-static.x86_64 zlib-devel.i686 zlib-static.i686 \
                     ncurses-compat-libs.i686 glibc-devel.i686 libstdc++-devel.i686 glibc-devel

    Ubuntu:

    sudo apt install gcc-multilib g++-multilib lib32z1 \
        lib32stdc++6 lib32gcc1 libxt6:i386 libxtst6:i386 expat:i386 \
        fontconfig:i386 libfreetype6:i386 libexpat1:i386 libc6:i386 \
        libgtk-3-0:i386 libcanberra0:i386 libice6:i386 libsm6:i386 \
        libncurses5:i386 zlib1g:i386 libx11-6:i386 libxau6:i386 \
        libxdmcp6:i386 libxext6:i386 libxft2:i386 libxrender1:i386 \
        zlib1g-dev libtool autoconf build-essential pkg-config \
        automake
  3. Install libpng from source:

    wget http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54.orig.tar.xz
    tar xvf libpng_1.2.54.orig.tar.xz
    cd libpng_1.2.54
    ./autogen.sh
    ./configure # Add `--prefix=/usr/` for Fedora.
    make
    sudo make install
    sudo ldconfig
  4. Run the installation script:

    ./QuartusLiteSetup-18.1.0.625-linux.run
  5. Make the vco script writable:

    chmod u+w ~/intelFPGA_lite/18.1/modelsim_ase/vco
  6. Make a backup of the vco file:

    cp ~/intelFPGA_lite/18.1/modelsim_ase/vco \
        ~/intelFPGA_lite/18.1/modelsim_ase/vco_original
  7. Edit the vco script:

    sed -i 's/linux\_rh[[:digit:]]\+/linux/g' \
        ~/intelFPGA_lite/18.1/modelsim_ase/vco
    sed -i 's/MTI_VCO_MODE:-""/MTI_VCO_MODE:-"32"/g' \
        ~/intelFPGA_lite/18.1/modelsim_ase/vco
    sed -i '/dir=`dirname "$arg0"`/a export LD_LIBRARY_PATH=${dir}/lib32' \
        ~/intelFPGA_lite/18.1/modelsim_ase/vco
  8. Verify the vco script was edited correctly:

    diff ~/intelFPGA_lite/18.1/modelsim_ase/vco \
        ~/intelFPGA_lite/18.1/modelsim_ase/vco_original

    should yield

    13c13
    < mode=${MTI_VCO_MODE:-"32"}
    ---
    > mode=${MTI_VCO_MODE:-""}
    51d50
    < export LD_LIBRARY_PATH=${dir}/lib32
    211c210
    <           *)                vco="linux" ;;
    ---
    >           *)                vco="linux_rh60" ;;
    
  9. Install libfreetype:

    wget download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.bz2
    tar xjf freetype-2.4.12.tar.bz2
    cd freetype-2.4.12/
    ./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" \
    "CXXFLAGS=-m32" "LDFLAGS=-m32"
    make clean
    make
    cd ~/intelFPGA_lite/18.1/modelsim_ase/
    mkdir lib32
    cp ~/freetype-2.4.12/objs/.libs/libfreetype.so* lib32/

    For Fedora install fontconfig as well:

    mkdir fontconfig-2.13.0-4.3.el7
    cd fontconfig-2.13.0-4.3.el7
    wget https://rpmfind.net/linux/centos/7.8.2003/os/x86_64/Packages/fontconfig-2.13.0-4.3.el7.i686.rpm
    rpm2cpio fontconfig-2.13.0-4.3.el7.i686.rpm | cpio -idmv
    cp usr/lib/libfontconfig.so.1 ~/intelFPGA_lite/18.1/modelsim_ase/lib32/

Now both Modelsim and Quartus should open.

To make sure you can upload to your FPGA board (or whichever you're using), add a new file named /etc/udev/rules.d/51-usbblaster.rules on Fedora, or name it /etc/udev/rules.d/92-usbblaster.rules on Ubuntu. Ensure it's contents are as follows:

 Intel FPGA Download Cable
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666"

# Intel FPGA Download Cable II
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="0666"

To ensure that Platform Designer/Qsys can generate your system, you will need to ensure perl is installed, and will need to do the following to fix the perl that the Quartus installation uses:

cd ~/intelFPGA_lite/18.1/quartus/linux64/perl/bin
mv perl perl_old
ln -s /usr/bin/perl

Sources:

@Ivan-Igorevich
Copy link

Ivan-Igorevich commented Feb 7, 2023

for Debian11/Ubuntu22+

libgcc1 lib32gcc-s1
sudo apt install libcanberra-gtk-module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment