In this video, I will show you how to install Code Saturne and how to get it to work from within Salome CFD!
It’s a marathon, so go step by step and you can make it ;-)
Here’s the Video:
Here’s the big parts of the video:
- 00:00:10 Installing Code Saturne
- 00:16:08 Installing Salome
- 00:22:54 Installing Salome CFD Extensions (CFD Study module)
- 00:33:57 Handling the Errors you may have (PyQt5, OmniORB, PYTHONPATH)
Detailed Install Procedure:
1- Install Code Saturne
mkdir code_saturne
cd code_saturne/
git clone https://github.com/code-saturne/code_saturne.git
./sbin/bootstrap
#Install Pre-requisites if needed
Install Python and then PyQt5 (apt-get install python3-PyQt5)
#Create a build folder and launch the install script:
mkdir ../code_saturne_build
cd ../code_saturne_build
./install_saturne.py
#Edit the setup file and replace "no" by "yes" to download and install the pre-requisites
It should look like this
Name Use Install Path
hdf5 yes yes none
cgns yes yes none
med yes yes none
scotch yes yes none
parmetis yes yes none
#Then save and launch again the script
./install_saturne.py
If everything goes well, Code_Saturne should be installed now
If you get error messages, look at them to debug
#Open and past the following in your .bashrc
cspath=/home/cyprien/Code_Saturne/7.0.4/code_saturne-7.0.4/arch/Linux_x86_64/bin
alias code_saturne="$cspath/code_saturne"
You should now be able to open code_saturne with the "code_saturne" command
(reload your terminal first)
2- Install Salome
Download and untar the SALOME-9.8.0-native-UB20.04-SRC archive
#Check prerequisites
[code]cd SALOME-9.8.0-native-UB20.04-SRC
./sat config SALOME-9.8.0-native --check_system[/code]
#Install what's missing with synaptic
Launch the script ./install_bin.sh
This will create an INSTALL folder with all the binaries
#You should now be able to launch salome with:
./salome
#If you get problem with libQt5Core.so.5
i.e you get error message:
libqt5core.so.5 version qt_5.15 not found (or something similar)
You have 2 ways to install PyQt5
Either using pip (pip install PyQt5)
Or using apt-get (apt-get install python3-pyqt5)
If you install both, you will have some conflict, so uninstall the one installed with pip and that should solve the problem
pip uninstall PyQt5
3- Install Salome-CFD-Extension
#clone the repository
git clone https://github.com/code-saturne/salome_cfd_extensions.git
cd salome_cfd_extensions/
#If you are using Code_Saturne 7.0 or above you need to switch to the v7.0 branch
git checkout v7.0
Go into the salome_cfd_extensions repository
#This command is not mentioned in the doc, but it is important to initialize some files
./sbin/bootstrap
#Create an env variable to tell were your Salome folder is located
export SALOME_ROOT_DIR=/home/cyprien/salome/SALOME-9.8.0-native-UB20.04-SRC
#Load Salome Environment
$SALOME_ROOT_DIR/salome shell
You should see the beginning of the terminal promt change and display:
[NS=no_host:no_port]$
#From there, you need to create the following env variables so
export CS_ROOT_DIR=/home/cyprien/Code_Saturne/7.0.2/code_saturne-7.0.2/arch/Linux_x86_64/bin
export CFDMODULE_ROOT_DIR=/home/cyprien/salome/salome_cfd_extensions/cfd_study
#make sure you are located in the salome_cfd_extensions directory
#you can use the ubuntu "pwd" command to check
./configure --with-salome=$SALOME_ROOT_DIR
Check the log to make sure there is no error and check that you have the following at the end:
Configuration options:
use debugging code: no
SALOME KERNEL support: yes
SALOME GUI support: yes
make
sudo make install
----------------------------------------------
In case you are getting this error:
omniidl: ERROR!
omniidl: Could not open IDL compiler module _omniidlmodule.so
I realized that indeed _omniidlmodule.so was not present in the folder /home/cyprien/salome/SALOME-9.8.0-native-UB20.04-SRC/INSTALL/omniORB/lib
What I did is that I unzipped the omniORB-4.2.3.tar.gz archive present in /home/cyprien/salome/SALOME-9.8.0-native-UB20.04-SRC/ARCHIVES and then I compiled it using configure - make - make install
After that redo the previous sudo make install for the cfd_module_extension and it should work
-------------------------------------------------
an executable salome_cfd will be created at the location /usr/local/bin/
This is the one that should be used to launch salome_cfd
(not the one located in the bin folder of the salome_cfd_extensions directory)
#Launch Salome CFD
go out of the salome env with "exit"
(If you try to launch salome_cfd from within the Salome env, the CFD study module will not be found)
#In case the CFD study module can't find the code_saturne python module, you have to set the PYTHONPATH variable manually like this:
export PYTHONPATH=/home/cyprien/Code_Saturne/7.0.2/code_saturne-7.0.2/arch/Linux_x86_64/lib/python3.8/site-packages
#Launch Salome CFD
/usr/local/bin/salome_cfd
#This should work now!
#Now configure your bashrc file to load more easily salome CFD
emacs ~/.bashrc
#Paste the following code in it
export PYTHONPATH=/home/cyprien/Code_Saturne/7.0.2/code_saturne-7.0.2/arch/Linux_x86_64/lib/python3.8/site-packages
alias salome_cfd=/usr/local/bin/salome_cfd
Other installation problems that some users have signalled to me:
1) Cannot find PyQt5 dev tools
If you are getting the following error of something similar:
checking for PyQt5 version >= 5.0... yes checking for pyuic5... no checking for pyrcc5... noconfigure: error: in `/home/vonstein/saturne-src/code_saturne.build':configure: error: cannot find PyQt5 dev tools, Graphical User Interface cannot be installed See `config.log' for more details
You will need to install other pyqt5 modules. The following code should solve your issues:
sudo apt-get install qtcreator pyqt5-dev-tools
sudo apt-get update
sudo apt-get install qttools5-dev-tools
2) Error while loading shared libraries: libgfortran.so.3: cannot open shared object
If you are getting this error:
SALOME_Session_Server: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory
This is caused by the fact that you don't have the old libgfortran.so.3 library installed. Unfortunately, on Ubuntu 20.04, the only one you will be able to install by default is libgfortran.so.5 as the 3rd version is a bit outdated.
I think the first answer on this article should solve it (waiting for confirmation that it works):
https://stackoverflow.com/questions/62908955/how-to-install-libgfortran-so-3-on-ubuntu-20-04
I am copying the answer here for practicality:
The problem here is that 20.04 doesn't support g++-6. To get around this you need a multi-step process:
- Put a temporary repository into /etc/apt/sources.list. For me that was
deb http://gb.archive.ubuntu.com/ubuntu/ bionic main universe
- Now you can install gcc version 6
sudo apt-get install g++-6
- Make that the default version
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 6
- Now install gfortran
sudo apt-get install libgfortran3
- Make sure it works
strings /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0 | grep GFORTRAN*
If you have questions, you can leave them here, but the best is still to leave them on the Code Saturne Forum (Or the Salome Forum) where the developers can answer you directly.
Good luck! May the Force be with you
Cyprien “So happy to have Salome CFD Finally installed” Rusu
Rysling says
I am using Linux on Win11
your instructions do not show where I should be running commands???
so this is what I get!!!
rysling@DESKTOP-LK65OD1:~/code_saturne/code_saturne_build/saturne_build$ cd ..
rysling@DESKTOP-LK65OD1:~/code_saturne/code_saturne_build$ chown -R rysling:rysling /home/rysling/
rysling@DESKTOP-LK65OD1:~/code_saturne/code_saturne_build$ chmod -R 750 /home/rysling/
rysling@DESKTOP-LK65OD1:~/code_saturne/code_saturne_build$ cd saturne_build
rysling@DESKTOP-LK65OD1:~/code_saturne/code_saturne_build/saturne_build$ ./install_saturne.py
The ‘install_saturne.py’ installer script should not be run from inside the
‘/home/rysling/code_saturne/code_saturne_build/saturne_build’ code_saturne source directory,
but from a separate directory.
We recommend running for example:
cd /home/rysling/code_saturne/code_saturne_build/saturne_build/..
mkdir saturne_build
cd saturne_build
../saturne_build/install_saturne.py
or (using absolute paths):
mkdir /home/rysling/code_saturne/code_saturne_build/saturne_build_build
cd /home/rysling/code_saturne/code_saturne_build/saturne_build_build
/home/rysling/code_saturne/code_saturne_build/saturne_build/install_saturne.py
rysling@DESKTOP-LK65OD1:~/code_saturne/code_saturne_build/saturne_build$
All I want is to get to Combustion…..testing pulse jet engine!
Vikram says
Hi Cyprien, thanks I was able to install and get saturne cfd up and running.
I had the omniidl issue also, I found your comments here to solve the issue:
https://www.code-saturne.org/forum/viewtopic.php?f=3&t=2917&start=10
1. I did this:
“What I did is that I unzipped the omniORB-4.2.3.tar.gz archive present in /home/cyprien/salome/SALOME-9.8.0-native-UB20.04-SRC/ARCHIVES and then I compiled it using configure – make – make install.
This generated the library _omniidlmodule.so along with _omniidlmodule.so.4 and _omniidlmodule.so.4.2 that I copied and pasted in the original INSTALL path and that seemed to solve the problem”
2. and did this in the Salome Environment
instead of ./configure –with-salome=$SALOME_ROOT_DIR
I used :
./configure –with-salome=”/home/username/salome/SALOME-9.8.0-native-UB20.04-SRC”
Also I used git checkout v7.0.2 for code saturne and git checkout v7.0 for salome cfd extensions.
Goodluck,
Vikram
riya says
Hi, Cyprien,
Thank you so much for posting such a detailed procedure. I followed the process, and everything went smooth except one issue:
While opening salome_cfd using /usr/local/bin/salome_cfd, I got this:
Warning: module CFDSTUDY is improperly configured!
Module CFDSTUDY will not be available in GUI mode!
Please note, I am not inside Salome env, I opened a new command window. I feel I followed the process exactly for configuring cfd_study. This is what I used:
[NS=no_host:no_port]$ export CS_ROOT_DIR=/home/riya/code_saturne/7.2.0-patch/code_saturne-7.2.0-patch/arch/Linux_x86_64/bin
[NS=no_host:no_port]$ export CFDMODULE_ROOT_DIR=/home/riya/salome/salome_cfd_extensions/cfd_study
Can you please guide me what could be the possible reason for this? It will be really helpful..
Regards,
Riya
Mahesh says
Hi Riya, I am facing same issue. The installation of code_saturne and Salome are successful, but I get same error with configuring/ launching salome_cfd module.
I don’t see a salome_cfd button embedded in GUI.
If you are able to solve the above issue, any suggestions would help.
Regards,
Mahesh
Hansen says
same issue here with the debian version