Modelsim relies on some 32-bit libraries that are not all easily avaliable on Fedora 35, this guide will walk you through the different steps needed to get it running.
We will create a toolbox container where we will install very old libraries needed for modelsim to work. This should be done in a container, and not in your base system. This is a simple solution only because we can use containers to workaround modelsim's need for such an old library.
https://gist.github.com/uziam/05ecf005629bb24a2050e1609f691fac describes a more complex solution which involves compiling the libraries by hand and hoping you can get the right shared libaries out. In theory it should work however it did not for me, I could not successfully actually make
the shared libraries for fontconfig.
Create a toolbox container with fedora 35. Note your home directory is mounted here, so while dnf
is not directly meddling with your host, files in your home directory are affected by what you do in your toolbox container, so be careful when rm
things.
sudo dnf install toolbox -y
toolbox create --image registry.fedoraproject.org/fedora-toolbox:35 modelsim-libraries
toolbox enter modelsim-libraries
Next we need to install modelsim somewhere on the system (~/intelFPGA_lite/18.1
for example). You most likely did this as part of installing Quartus (it is easier to install everything at once, and on Intel's download page you can install a combined archive with the everything you might need included). You might want to ensure it's under ~ for easy integration with Toolbox.
Once it is installed, navigate to the bin directory (~/intelFPGA_lite/18.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 tomode=$(MTI_VCO_MODE:-"32")
- Find the line that contains
vco="linux_rh60"
and change it tovco="linux"
It doesn't matter if you do this with your toolbox container or in your host system. You just need to edit the executable that you will later be running.
All following commands should be entered assuming you are in your toolbox container.
Remove a conflicting library, and install a bunch of 32 bit dependencies for modelsim. Only do this in your container, do not do this on your normal host system. Do this after running toolbox enter modelsim-libraries
.
sudo dnf remove libedit.x86_64
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 wget
Remove the current fontconfig and install a build for Fedora 28. Only do this in your container, do not do this on your normal host system. Do this after running toolbox enter modelsim-libraries
.
wget https://kojipkgs.fedoraproject.org//vol/fedora_koji_archive05/packages/fontconfig/2.12.6/4.fc28/i686/fontconfig-2.12.6-4.fc28.i686.rpm
sudo dnf remove fontconfig-2.13.94-5.fc35.x86_64
sudo dnf install fontconfig-2.12.6-4.fc28.i686.rpm
Remove the current freetype and install a build for Fedora 20. Only do this in your container, do not do this on your normal host system. Do this after running toolbox enter modelsim-libraries
.
wget https://kojipkgs.fedoraproject.org//vol/fedora_koji_archive00/packages/freetype/2.4.12/6.fc20/i686/freetype-2.4.12-6.fc20.i686.rpm
sudo dnf remove freetype-2.11.0-6.fc35.x86_64
sudo dnf install freetype-2.4.12-6.fc20.i686.rpm
Now you should be able to run modelsim with:
./vsim
from within the /opt/intelFPGA/19.1/modelsim_ase/bin
directory for example.
Note that command will only work if you're in your container (which is the whole point of this guide, make a containerized environment for modelsim to run in).
Credits: Thanks to https://gist.github.com/uziam/05ecf005629bb24a2050e1609f691fac and https://mil.ufl.edu/3701/docs/quartus/linux/ModelSim_linux.pdf for providing steps to do this, some of which I reused here.
Thank you so much for making this. Not having to compile freetype and fontconfig is a huge lifesaver.