Code_saturne Installation on Alma Linux 9


How it all began or “Le vieil amour ne rouille jamais.”

Motivated by the Code_saturne installation instruction on **GitHub ** and by some good videos from experienced community members, I decided to try my luck :)

Since the most available installation instructions are for Ubuntu Linux or Scibian, I needed to investigate my own way to get it running on my favorite Linux distro: Alma Linux 9 (Kernel 5.14), which runs without any issues on my very old Laptop: Lenovo ThinkPad T530i. (2 cores, 16 GiB RAM)

After several trials and after studying all available descriptions, I got it compiled! Here is the order of the individual installation steps. I’m not entirely sure if all the intermediate steps are necessary, but this is how it works for me.

And instead of doing all the installation steps manually, you might try my experimental Le Chat / Mistral AI assistent I created especiall for this project.

Blog picture above taken from the offical code_saturne homepage


Distro Installation

I downloaded and installed the available version AlmaLinux 9.6 - (Sage Margay) from the official website. You need to be aware of which file system you choose during the installation process; I chose LVM right away.

I prioritize long-term support, stability, and RHEL compatibility, which is why I use this distro.


Prerequisites

Update to the latest version & activate repos

sudo dnf install -y epel-release
sudo /usr/bin/crb enable
sudo dnf groupinstall "Development Tools"
sudo dnf install environment-modules
source /usr/share/Modules/init/bash
sudo dnf update
sudo dnf upgrade

This might take some extra minutes and requires extra GiB of drive space.

Some standard tools

sudo dnf install gedit nano wget make cmake zlib-devel
sudo dnf install python3-devel python3-qt5
sudo dnf install tcl tcl-devel tk tk-devel
Regarding PyQt5

(AI explanation): Choosing the correct PyQt5 version for your Linux distribution, such as AlmaLinux 9, and its kernel is essential for stable operation of CAE/CFD tools like Code_Saturne or SALOME. PyQt5 depends on the system’s Qt libraries — for example, AlmaLinux 9 provides Qt 5.15 as a long-term support version. If you install a newer PyQt5 build designed for Qt 6, it will try to link against libraries that do not exist on your system, leading to errors like ImportError: libQt5Core.so.5: cannot open shared object file. Since Qt 5 and Qt 6 are not binary-compatible, using the wrong combination often results in crashes or segmentation faults in graphical interfaces. Furthermore, AlmaLinux 9 keeps Qt fixed at version 5.15 for stability reasons, so manually installing mismatched PyQt versions via pip can create conflicts with system packages and cause unpredictable behavior in tools that explicitly depend on Qt 5.15.

Modify system’s search paths

Those lines make your shell find executables and libraries installed in /usr/local (like code_saturne and its dependencies) by adding them to your system’s search paths.

echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc
source ~/.bashrc

Create a snapshot (optional)

⚠ For experienced users only!

Now would be a good time to use a nice feature of the operating system and create a snapshot, in case further installation steps fail and you want to return to this step.

I recommend studying the documentation before starting this process.

sudo vgdisplay almalinux # check free space in the volume group "almalinux"
# example
sudo lvcreate --size 5G --snapshot --name root_snap /dev/almalinux/root
sudo lvs # double-check the created snapshot 

MPI - required for parallel simulations

sudo dnf install -y openmpi openmpi-devel
module load mpi/openmpi-x86_64
which mpicc
mpicc --version
echo "module load mpi/openmpi-x86_64" >> ~/.bashrc
rpm -qa | grep openmpi # check installed packages

Compile MedCoupling

(AI explanation): MEDCoupling is required for mesh and field operations, such as data mapping, partitioning, and post-processing — for example, when Code_saturne reads or writes MED files or exchanges data with SALOME for pre- and post-processing.

sudo dnf --enablerepo=crb
sudo dnf install cppunit cppunit-devel
# sudo dnf install cppunit-config
# should be already included in ccpunit-devel on AL9

Continue with the installation instruction from GitHub!


Download and compile code_saturne

It might be, that not every version of code_saturne is compatible with Alma Linux 9. I’ve opted for version 8.0 for now and will test higher versions later.

A very important note beforehand: If the script can’t download some software packages, save it to your cloud storage or website. It worked for me as a workaround. I’ll show you how I did it later. -> few days

wget https://www.code-saturne.org/releases/code_saturne-8.0.0.tar.gz
tar -xzf code_saturne-8.0.0.tar.gz
cd code_saturne-8.0.0

./sbin/bootstrap
cd /home/anyawesomeuser/code_saturne-8.0.0/..
mkdir saturne_build
cd saturne_build

My best choice: modify the install_saturne.py file and modify up to your needs. This file needs to be stated twice. (see official instructions)

../code_saturne-8.0.0/install_saturne.py
# modify the file and restart !
../code_saturne-8.0.0/install_saturne.py

For example I modified the file as follows:

# FROM:
url="https://files.salome-platform.org/Salome/other/%s")
# INTO:
url="https://virengos.com/software/%s")

At the end: Good things take a while or - “Les bonnes choses prennent du temps.” ;)


Add the alias to your bashrc

alias code_saturne="/home/anyawesomeuser/code_saturne/8.0.0/code_saturne-8.0.0/arch/Linux_x86_64/bin/code_saturne"

In case you get stuck somewhere

Check what has been installed so far. I added the installed versions on my system in October 2025.

gcc --version # gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5)
gfortran --version # GNU Fortran (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5)
make --version # GNU Make 4.3
cmake --version # cmake version 3.26.5
python3 --version # Python 3.9.21
mpicc --version
mpif90 --version

First start

Start and enjoy (IMHO) one of the best CFD software packages ever!

code_saturne gui

Next Steps

And as you might expect, even more tools will be added to run my next project.

Fully automated workflow for pre-training AI surrogate models in CFD, featuring:

  • Geometry and mesh generation via headless Salome scripts
  • Mesh optimization using Dakota
  • Integrated CFD simulations with Code_Saturne
  • End-to-end automation managed by Snakemake (Snakefile)

It’s going to be exciting—stay tuned!


Further Reading


Disclaimer

Free and Open Source Software (FOSS)

I rely on Free and Open Source Software (FOSS), where “free” refers to liberty, not price—for simulations, automation, and engineering workflows. FOSS guarantees the four essential freedoms (use, study, share, modify) as defined by the Free Software Foundation.

License Notices

Unless stated otherwise, my scripts and code examples (e.g., on my GitLab repositories) are typically licensed under the MIT License to encourage reuse and learning. Always check the individual license files in repositories before using code—especially for commercial applications. Compliance with license terms (attribution, restrictions, etc.) is your responsibility.

Purpose and Liability

My examples are practical, simplified demonstrations designed for educational sharing, not production use. They reflect my best knowledge but are unreviewed by third parties. Use them at your own risk; I assume no liability for errors, omissions, or consequences in professional/commercial contexts.