Skip to content

Instantly share code, notes, and snippets.

@vchernin
Last active February 6, 2025 13:18
Show Gist options
  • Save vchernin/04b30f0eb72385592d4a2ece615476a8 to your computer and use it in GitHub Desktop.
Save vchernin/04b30f0eb72385592d4a2ece615476a8 to your computer and use it in GitHub Desktop.
Install ModelSim 18.1 on Fedora 35

Install Modelsim 18.1 on Fedora 35

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.

Prerequisites

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

Install modelsim

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 to mode=$(MTI_VCO_MODE:-"32")
  • Find the line that contains vco="linux_rh60" and change it to vco="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.

Install the required libraries

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

Install fontconfig-2.12.6 by old RPM

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

Install freetype-2.4.12 library by old 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.

@ScanuNicco
Copy link

Thank you so much for making this. Not having to compile freetype and fontconfig is a huge lifesaver.

@acoustic-kitty
Copy link

Works perfectly, exactly as stated. Don't be like me - use the Fedora 35 image exactly as stated.

Many thanks!

-ak

@tom1209-netizen
Copy link

I don't quite understand the process, I already downloaded the .run file name intel modelsim FPGA. Can you tell me what step I should take next ? Thanks you in advance !

@vchernin
Copy link
Author

vchernin commented Feb 4, 2024

It sounds like you are here:

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.

To be honest I don't remember what the download URL I used is (I should probably have linked it...). Do you have anything installed yet at ~/intelFPGA_lite (the default install directory).

I assume the .run file is an installer shell script? Can you try run it and see if anything installs?

@tom1209-netizen
Copy link

sorry I am not sure what you meant by default install directory since after I downloaded the .run file it would not run. This is the link of the model sim versions that I have downloaded

@vchernin
Copy link
Author

vchernin commented Feb 4, 2024

What was the error that you got? Make sure to run the file from the command line to be able to view errors clearly.

@tom1209-netizen
Copy link

I tried both way:

  • Using GUI to make it "run as program" and then press the icon
  • Using CLI to make it executable and ./[filenam] it but nothing happen
    For context I am using m1 mac, maybe because model sim is not supported on arm chips ?

@vchernin
Copy link
Author

vchernin commented Feb 4, 2024

For context I am using m1 mac, maybe because model sim is not supported on arm chips ?

I don't think quartus or modelsim support non-x86_64, so to get them to run you will need to emulate them with box64 or QEMU or similar. Unfortunately that is a whole new can of worms.

@tom1209-netizen
Copy link

Thanks you a lot, I will look into box64 and QEMU. Have a great day !

@micherciu
Copy link

Thanks @vchernin ! I successfully installed on Fedora 41 and it only works with your described method. I tried the old method too but it didn't worked, big problem of compiling shared libraries for fontconfig, like you said. Great job !

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