Troubles with "Salome-CFD extension"

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Yvan Fournier
Posts: 4168
Joined: Mon Feb 20, 2012 3:25 pm

Re: Troubles with "Salome-CFD extension"

Post by Yvan Fournier »

Hello,

The OSpray plugin should only affect ParaView, so does not seem related to your issue.

So I am not sure what is wrong here.

2 tests may be interesting:

- sourcing the SALOME environment before running salome_cfd
- sourcing the salome environment before running the install.

Though in both cases, I am not sure of the name of the file you need to source, as it has changed across salome versions and builds (things are becoming more unified, but there may be a backlog here).
You can search for salome_modules.sh and salome_prerequisites.sh in the salome install, and run "source" with either or both of these files (I am not sure whether one or both are present).

Normally, this is done automatically by the salome_cfd_extensions "configure" step, which searches for those files, so I doubt forcing this in the install may help. But it is easy to test at least for the execution step.

Also, if you have no other error logs, SALOME might log some errors under /tmp, so you may check there.

I have tested the salome_cfd_extensions build with Ubuntu 18.04 if I remember correctly, but I do not think I have tested it on Ubuntu 20.04, so there might be some other issues. I'll check with a colleaguer who recently did an Ubuntu install.

Best regards,

Yvan
CyprienR
Posts: 4
Joined: Wed Mar 16, 2022 10:02 am

Re: Troubles with "Salome-CFD extension"

Post by CyprienR »

Hello Yvan and Mayank,

I was also trying to install the salome-cfd module in the last days on Ubuntu 20.04 and I was getting the same error message than Mayank:

Code: Select all

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
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

After that I loaded the salome shell environment and used the following commands to compile the salome cfd extension

Code: Select all

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
./configure --with-salome="/home/cyprien/salome/SALOME-9.8.0-native-UB20.04-SRC"
make
sudo make install
This generated a script salome_cfd at the location /usr/local/bin/

So everything when well up to that point

Then to launch, I first loaded the code_saturne python with:
export PYTHONPATH=/home/cyprien/Code_Saturne/7.0.2/code_saturne-7.0.2/arch/Linux_x86_64/lib/python3.8/site-packages

And I then executed /usr/local/bin/salome_cfd

Salome opens and I can see the CFD study module icon in the menu bar

However when I click on it a pop-up window tells me "Failed to activate the module CFD study"
and I get the following errors in the terminal

Code: Select all

runSalome running on cyprien-bpro
Searching for a free port for naming service: 2811 - OK
Searching Naming Service  + found in 0.1 seconds 
Searching /Kernel/Session in Naming Service  +Warning, no type found for resource "localhost", using default value "single_machine"
++ found in 1.5 seconds 
Start SALOME, elapsed time :   1.7 seconds
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/salome/CFDSTUDYGUI.py", line 43, in <module>
    from code_saturne.gui.base.QtCore    import *
ModuleNotFoundError: No module named 'code_saturne.gui'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/salome/CFDSTUDYGUI.py", line 43, in <module>
    from code_saturne.gui.base.QtCore    import *
ModuleNotFoundError: No module named 'code_saturne.gui'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/salome/CFDSTUDYGUI.py", line 43, in <module>
    from code_saturne.gui.base.QtCore    import *
ModuleNotFoundError: No module named 'code_saturne.gui'
I have tried to launch python3.8 and I can import code_saturne.Base.QtCore...
But there is no module code_saturne.gui.base.QtCore

Is it because the installation of code_saturne 7.0.2 I am using is not compatible with the Salome CFD module ?
Or is there something else I missed?
Yvan Fournier
Posts: 4168
Joined: Mon Feb 20, 2012 3:25 pm

Re: Troubles with "Salome-CFD extension"

Post by Yvan Fournier »

Hello,

There are 2 branches for the salome_cfd_extensions module:

- the master branch is compatible with the code_saturne master branch
- the 7.0 branch should be compatible with code_saturne versions 7.1 - 7.0.

Some Python files have been reorganized, so crossing branches will lead to incorrect file loads.

Best regards,

Yvan
CyprienR
Posts: 4
Joined: Wed Mar 16, 2022 10:02 am

Re: Troubles with "Salome-CFD extension"

Post by CyprienR »

Thank you Yvan,
I was finally able to install Salome CFD
I will make a video about it

In the meantime, I can share here the full install procedure on Ubuntu 20.04 that I tried to detail as much as possible:



1- Install Code Saturne

Code: Select all

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:

Code: Select all

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

Code: Select all

./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

Code: Select all

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: Select all

cd SALOME-9.8.0-native-UB20.04-SRC
./sat config  SALOME-9.8.0-native --check_system
#Install what's missing with synaptic

Launch the script

Code: Select all

./install_bin.sh
This will create an INSTALL folder with all the binaries

You should now be able to launch salome with:

Code: Select all

./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

Code: Select all

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

Code: Select all

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

Code: Select all

./sbin/bootstrap
#Create an env variable to tell were your Salome folder is located

Code: Select all

export SALOME_ROOT_DIR=/home/cyprien/salome/SALOME-9.8.0-native-UB20.04-SRC
#Load Salome Environment

Code: Select all

$SALOME_ROOT_DIR/salome shell
You should see the beginning of the terminal prompt change and display:

Code: Select all

[NS=no_host:no_port]$
#From there, you need to create the following env variables so

Code: Select all

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

Code: Select all

./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

Code: Select all

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)

4- 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:

Code: Select all

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

Code: Select all

/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

Code: Select all

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
SimBu
Posts: 30
Joined: Tue Sep 13, 2022 4:13 pm

Re: Troubles with "Salome-CFD extension"

Post by SimBu »

Helo Cyprien and Yvan,
Thank you so much for your message Cyprien, it helped me a lot !
To solve the omniidle issue, I read in the README that we can add at the configure command :

./configure --with-salome=$SALOME_ROOT_DIR OMNIIDL=$SALOME_ROOT_DIR/INSTALL/omniORB/bin/omniidl

It solved my problem.

But during the make, I always have this issue :

Code: Select all

Configuration options:
 use debugging code: no
 SALOME KERNEL support: yes
 SALOME GUI support: yes

The package has been configured. Type:
 make
 make install

To generate and install the salome CFD extensions

[NS=no_host:no_port]$ make
make  all-recursive
make[1]: Entering directory '/home/simeon/salome/salome_cfd_extensions'
Making all in cfd_study
make[2]: Entering directory '/home/simeon/salome/salome_cfd_extensions/cfd_study'
Making all in idl
make[3]: Entering directory '/home/simeon/salome/salome_cfd_extensions/cfd_study/idl'
; \
/usr/bin/python /home/simeon/salome/SALOME-9.9.0-native-UB20.04-SRC/BINARIES-UB20.04/SALOME/INSTALL/omniORB/bin/omniidl -bcxx  -I/home/simeon/salome/SALOME-9.9.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/idl/salome -I/home/simeon/salome/SALOME-9.9.0-native-UB20.04-SRC/BINARIES-UB20.04/GUI/idl/salome CFDSTUDY_Gen.idl
/bin/bash: -c: line 0: syntax error near unexpected token `;'
/bin/bash: -c: line 0: `; \'
make[3]: *** [Makefile:903: CFDSTUDY_GenSK.cc] Error 1
make[3]: Leaving directory '/home/simeon/salome/salome_cfd_extensions/cfd_study/idl'
make[2]: *** [Makefile:429: all-recursive] Error 1
make[2]: Leaving directory '/home/simeon/salome/salome_cfd_extensions/cfd_study'
make[1]: *** [Makefile:613: all-recursive] Error 1
make[1]: Leaving directory '/home/simeon/salome/salome_cfd_extensions'
make: *** [Makefile:510: all] Error 2

I am running a VM with Ubuntu 20, I tried also on other distro but it is the same,
If you can help me,
Regards,
Yvan Fournier
Posts: 4168
Joined: Mon Feb 20, 2012 3:25 pm

Re: Troubles with "Salome-CFD extension"

Post by Yvan Fournier »

Hello,

Is the default python (/usr/bin/python) in Ubuntu 2020 Python 3 or 2 ? I hope it is 3, but if it is 3, you might force PYTHON=python3 to see if that helps.

Otherwise I'm not sure. I have had issues with omniidl also, and am not sure tha packaged omniidl in the Salome binaries are OK (I don't have the time to look now, and I don't remember the details, but I do remember I wasted some time on this issue or a very similar one).

Unless you need to run sensitivity analysis with OpenTURNS/Persalys, the Salome_CFD extensions are not essential they are mostly cosmetic), and a standalone code_saturne install (using Salome libraries such as MED) works fine...
SimBu
Posts: 30
Joined: Tue Sep 13, 2022 4:13 pm

Re: Troubles with "Salome-CFD extension"

Post by SimBu »

I checked, Python version is 3.8, so I tried with PYTHON=python3 and the same error occurs so I give up, you are rigt Code standalone code saturne is adequate. I don't really understand why it does not work.
Yvan Fournier
Posts: 4168
Joined: Mon Feb 20, 2012 3:25 pm

Re: Troubles with "Salome-CFD extension"

Post by Yvan Fournier »

Hello,

If my memory is correct, some paths for omniidl were not updated by the installer, and were those of the build machine, or something similar.

I'll probably check that again in a few weeks, but not immediately (I have other developments planned that will need re-testing with SALOME builds, so I'll try do those first).

Best regards,

Yvan
Post Reply