Skip to content

Instantly share code, notes, and snippets.

@uziam
Last active November 15, 2021 05:37
Show Gist options
  • Save uziam/05ecf005629bb24a2050e1609f691fac to your computer and use it in GitHub Desktop.
Save uziam/05ecf005629bb24a2050e1609f691fac to your computer and use it in GitHub Desktop.
Install Modelsim 19.1 on Fedora 31

Install Modelsim 19.1 on Fedora 31

Modelsim relies a some 32-bit libraries that are not all easily avaliable on Fedora 31, this guide will walk you through the different steps needed to get it running.

Install the required libraries

The following 32-bit libraries are required for Modelsim to work:

  • unixODBC.i686
  • unixODBC-devel.i686
  • ncurses-compat-libs.i686
  • zeromq-devel.i686
  • libXext.i686
  • alsa-lib.i686
  • libXtst.i686
  • libXft.i686
  • libxml2.i686
  • libedit.i686
  • libX11.i686
  • libXi.i686

sudo dnf install unixODBC.i686 unixODBC-devel.i686 ncurses-compat-libs.i686 zeromq-devel.i686 libXext.i686 alsa-lib.i686 libXtst.i686 libXft.i686 libxml2.i686 libedit.i686 libX11.i686 libXi.i686

Install modelsim

Next we need to install modelsim somewhere on the system (/opt/intelFPGA for example). Once it is installed, navigate to the bin directory (/opt/intelFPGA/19.1/modelsim_ase/bin) and modify vsim in a text editor (as root, since it is read only). There are two changes we need here:

  • Find the line that contains mode=$(MTI_VCO_MODE:-"") and change it to mode=$(MTI_VCO_MODE:-"32")
  • Find the line that contains vco="linux_rh60" and change it to vco="linux"

Build fontconfig-2.12.6 library

The tarball for this library can be downloaded from here but before we can compile this library, we need to install two packages:

sudo dnf install glibc-devel.i686 libxml2-devel.i686

Next, we need to set up a location for keeping our manually compiled 32-bit libraries:

sudo mkdir /opt/intelFPGA/19.1/modelsim_ase/lib32

We need to now modify vsim (/opt/intelFPGA/19.1/modelsim_ase/bin/vsim) so it is aware of this directory. Find the line that contains dir=`dirname $arg0` and add the following line below it export LD_LIBRARY_PATH=${dir}/lib32. Now we can extract, compile and install the library as follows:

tar -xzvf fontconfig-2.12.6.tar.gz
cd fontconfig-2.12.6
./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --enable-libxml2
make -j8
sudo cp objs/.libs/libfreetype.so* /opt/intelFPGA/19.1/modelsim_ase/lib32

Build freetype-2.4.12 library

The tarball can be downloaded from here and installed as follows:

tar -xjvf freetype-2.4.12.tar.bz2
cd freetype-2.4.12
./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
make -j8
sudo cp objs/.libs/libfreetype.so* /opt/intelFPGA/19.1/modelsim_ase/lib32

Now you should be able to run modelsim (hopefully).

@vchernin
Copy link

I adapted parts of this guide to instead run modelsim in a toolbox container which seems to work:
https://gist.github.com/vchernin/04b30f0eb72385592d4a2ece615476a8

Thanks for writing this one up!

@uziam
Copy link
Author

uziam commented Nov 15, 2021

I adapted parts of this guide to instead run modelsim in a toolbox container which seems to work: https://gist.github.com/vchernin/04b30f0eb72385592d4a2ece615476a8

Thanks for writing this one up!

Thanks! Very interesting, I'll definitely give your guide a try to run it inside a toolbox container.

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