# coupling with salome-meca 2019

**URL:** <https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980>\
**Category:** Installation issues\
**Created:** [December 27, 2020, 10:03am UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980 "2020-12-27T10:03:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![seirov](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@seirov](https://code-saturne.org/forum/u/seirov)\
**Post date:** [December 27, 2020, 10:03am UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/1 "2020-12-27T10:03:39Z")

</div>

Hello all,

From time to time, I try to install CS coupled with salome-meca, and always with no success 😢

I am an aeronautical and mechanical engineer, using linux for years but no idea about python, so it would be great if saturne and salome-meca came already coupled together in one package, from a real developer…

In any case, I have tried it to do it myself, so first I edit the .configure and add

```plaintext
--with-salome=/opt/salome_meca/V2019.0.3_universal

```

launch the compilation and it stops with

```plaintext
  program name = '/usr/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python'
  sys.base_prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.base_exec_prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.executable = '/usr/bin/python'
  sys.prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.exec_prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.path = [
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Lxml-340/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_lm-07/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Otgui-v61/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_morris-05/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_svm-05/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/EUROPLEXUS_201901/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/EUROPLEXUS_201901/lib/python3.6/site-packages/salome',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Mfront-TFEL321/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_mixmod-07/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/SHAPER_V9_3_0/bin/salome',
    '/opt/salome_meca/V2019.0.3_universal/modules/SHAPER_V9_3_0/lib/salome',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Xlrd-120/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_wrapy-07_EDF/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Pillow-342/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Gnuplotpy-183k/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Zcracks-292p2/plugin',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Xlwt-130/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_pmml-16/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/H5py-280/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Cython-0252/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Xlutils-200/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_robopt-04/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/SMESH_V9_3_0/share/salome/plugins/smesh/Verima',
    '/opt/salome_meca/V2019.0.3_universal/modules/ASTERSTUDY_201903/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/ASTERSTUDY_201903/lib/python3.6/site-packages/salome',
    '/opt/salome_meca/V2019.0.3_universal/tools/Code_aster_frontend-20190/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Medcoupling-V9_3_0/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Medfichier-400/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Code_aster_frontend-20190/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Adao-V9_3_0_0/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Paraview-v560p1/lib/paraview-5.6/site-packages/vtkmodules',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Paraview-v560p1/lib/paraview-5.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Paraview-v560p1/lib/paraview-5.6',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorbpy-422/lib/python3.6/site-packages/omniidl_be',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorbpy-422/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Libbatch-V2_4_1/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_fftw-06/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_tool-112/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Jinja-273/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Docutils-012/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Scipy-0191/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Nlopt-242/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Matplotlib-222/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Pyqt-590/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Numpy-1151/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Pygments-202/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorb-422/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Sip-4193/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python38.zip',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f275807eb80 (most recent call first):
<no Python frame>
make[4]: *** [Makefile:1101: CFDSTUDY_GenSK.cc] Error 1
make[4]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study/idl'
make[3]: *** [Makefile:640: all-recursive] Error 1
make[3]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study'
make[2]: *** [Makefile:641: all-recursive] Error 1
make[2]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome'
make[1]: *** [Makefile:1595: all-recursive] Error 1
make[1]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5'
make: *** [Makefile:1039: all] Error 2
==> ERROR: Se produjo un fallo en build().
    Cancelando...
error compilando: code_saturne

```

So, these weird 3 last lines of the “sys.path” make me think that it is looking for python3.8, so I do

```plaintext
ln -s /opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8 /opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6

```

When I try again, it moves forward until I get

```plaintext
usr/bin/python /opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorb-422/bin/omniidl -bcxx -Wba -nf -I/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorb-422/idl -I/opt/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0/idl/salome -I/opt/salome_meca/V2019.0.3_universal/modules/GUI_smeca_gui/idl/salome CFDSTUDY_Gen.idl
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Lxml-340/lib/python3.6/site-packages/site.py", line 73, in <module>
    __boot()
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Lxml-340/lib/python3.6/site-packages/site.py", line 26, in __boot
    import imp # Avoid import loop in Python >= 3.3
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8/imp.py", line 19, in <module>
    from importlib._bootstrap import _ERR_MSG, _exec, _load, _builtin_from_name
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8/importlib/ __init__.py", line 51, in <module>
    _w_long = _bootstrap_external._w_long
AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'
make[4]: *** [Makefile:1101: CFDSTUDY_GenSK.cc] Error 1
make[4]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study/idl'
make[3]: *** [Makefile:640: all-recursive] Error 1
make[3]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study'
make[2]: *** [Makefile:641: all-recursive] Error 1
make[2]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome'
make[1]: *** [Makefile:1595: all-recursive] Error 1
make[1]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5'
make: *** [Makefile:1039: all] Error 2
==> ERROR: Se produjo un fallo en build().
    Cancelando...
error compilando: code_saturne

```

Reading some posts, it seems that there is a conflict between python versions. I tried different combinations of exporting PYHTONPATH, but it doesn’t matter what I write, it always answers:

```plaintext
checking for PyQt5 version >= 5.0... ./configure: line 22998: 2895843 Segmentation fault (core dumped) ${PYTHON} -c "${prog}"
no
checking for PyQt4 version >= 4.5... no
configure: error: in `/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5':
configure: error: cannot find PyQt5 support (>= 5.0) or PyQt4 support (>= 4.5), Graphical User Interface cannot be installed
See `config.log' for more details
==> ERROR: Se produjo un fallo en build().
    Cancelando...
error compilando: code_saturne

```

Is it really a problem of python versions? What shoud I write for PYTHONPATH then?

Some other help would be really apreciated. Thanks.

P.S. My system runs Manjaro, python3.8 and salome-meca 2019 and CS 6.0.5 (compilation without coupling works perfectly).

---

<div class="post-metadata">

**Author:** ![Yvan\_Fournier](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/y/4bbf92/32.png) [@Yvan\_Fournier](https://code-saturne.org/forum/u/Yvan_Fournier)\
**Post date:** [December 27, 2020, 6:33pm UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/2 "2020-12-27T18:33:57Z")

</div>

Hello,

To avoid Python issues, if your Salome\_meca install uses a separate Python install from the system default, you should do force that version for code\_saturne install.

You can do this by installing cofe\_saturne from within “salome shell”. To avoid needing the full Salome environnement when using code\_saturne, you could source only the part of the environnement required, and use the --with-shell-env configure option.  
But I recommend trying the simplest opt ok n first.

If you check some posts from several months ago, you may see we have not managed to run the coupling test case with salome\_meca 2019. It works with the 2017 version, and has not been tested with the 2018 version. The install works, but one code\_aster command fails. Maybe an expert code\_aster user would know how to adapt it.

Starting with code\_saturne 6.1, the code\_aster coupling has been rewritten, as it was fragile and would have been broken by the HPC version of code\_aster. The work is not finished on the code\_aster side (i.e. there is no example) but I could guide an advanced code\_aster user through the necessary steps.

Best regards,

Yvan

---

<div class="post-metadata">

**Author:** ![seirov](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@seirov](https://code-saturne.org/forum/u/seirov)\
**Post date:** [December 31, 2020, 10:13am UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/3 "2020-12-31T10:13:02Z")

</div>

Hi,

I have tried what you indicated (although already warned that might be useless), so:

```plaintext
$ salome shell
>>> ./configure --with-hdf5=/usr --with-cgns=/usr --with-med=/usr --without-metis --without-scotch PYTHON=/usr/bin/python --with-salome=/opt/salome_meca/V2019.0.3_universal --with-shell-env

```

and it answers:

```plaintext
checking whether /usr/bin/python version is >= "2.6"... no
configure: error: Python interpreter is too old

```

Due to fact that I am using built-in python, I removed the option “PYTHON=/usr/bin/python” from configure. Then it went on, so when finished I typed

```plaintext
make
make install

```

Note: For the last command, I had to login as root, and then enter in the “salome shell”.

So, installation is completed ![:mrgreen:](https://code-saturne.org/uploads/default/original/1X/442e459c5ced45cb70e8a05e77e07cea6fee4928.gif "Mr. Green") however, I have realised that commands “code\_saturne gui” or “code\_saturne salome” from a terminal results in:

```plaintext
/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/bin/python: error while loading shared libraries: libpython3.6.so.1.0: cannot open shared object file: No such file or directory

```

but if I enter in “salome shell” and execute code\_saturne from there they both work. Is this the expected behaviour?

Now I have to try some calculation. Does anyone have any easy case to try the coupling?

Thanks.

---

<div class="post-metadata">

**Author:** ![Yvan\_Fournier](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/y/4bbf92/32.png) [@Yvan\_Fournier](https://code-saturne.org/forum/u/Yvan_Fournier)\
**Post date:** [January 1, 2021, 3:05pm UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/4 "2021-01-01T15:05:16Z")

</div>

Hello,

You need to log in as root for “make install” only if you install to a system folder. By default, this us the case (/usr/local), but if you specify --prefix at onfigure time, with a user directory to which you have write access as a regula user, root is not necessary. This is independent of Salome.

The reason why you need to load the salome environment is so the the library search path for the Python installed with salome is found. Using LD\_LIBRARY\_PATH and just that pathe would be sufficient, though is is simpler to just load everything.

And there is a test case here : [code\_aster coupling example - code\_saturne User's Forum](https://www.code-saturne.org/forum/viewtopic.php?f=12&t=2583).

Regards,

Yvan

---

<div class="post-metadata">

**Author:** ![seirov](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@seirov](https://code-saturne.org/forum/u/seirov)\
**Post date:** [January 3, 2021, 10:33am UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/5 "2021-01-03T10:33:22Z")

</div>

Hello, thanks for your answer. Using the LD\_LIBRARY\_PATH tip worked like a charm.

Regarding the calculation, first I have tried a saturne case

> **[ShearDrivenCavityFlow.pdf](https://www.code-saturne.org/cms/sites/default/files/file_attach/Tutorial/version-6.0/ShearDrivenCavityFlow.pdf)**
>
> 4.54 MB

and it worked… more or less. I couldn’t create a case from salome, a pop-up window said

```plaintext
/home/user/saturne/study1 must be a directory

```

which I don’t understand because I was trying to create this directory. In any case, I could launch “code\_saturne gui”, create the case, go back to salome and open it, and go on in salome.

However, when I wanted to try the FSI case, I realised that when launching

```plaintext
code_saturne salome

```

I get the typical salome window with the icon for code saturne, but no icon for code aster (I expected to have both, as my salome flavour is salome\_meca). Does it mean that coupling is not done (as you already warned)?

Thanks.

---

<div class="post-metadata">

**Author:** ![Yvan\_Fournier](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/y/4bbf92/32.png) [@Yvan\_Fournier](https://code-saturne.org/forum/u/Yvan_Fournier)\
**Post date:** [January 4, 2021, 2:33am UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/6 "2021-01-04T02:33:13Z")

</div>

Hello,

No, this is simply the way the virtual application run with “code\_saturne salome” works. Salome does not provide for an easy way to add applications inside an existing version without modifying it’s build scripts.

The FSI coupling works in script mode, so you need to run “salome shell” only first.

Regards,

Yvan

---

<div class="post-metadata">

**Author:** ![seirov](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@seirov](https://code-saturne.org/forum/u/seirov)\
**Post date:** [January 19, 2021, 3:11pm UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/7 "2021-01-19T15:11:57Z")

</div>

Hello, during last days I have been testing saturne, I have followed tutorial fsi

> **[Fluid-structure-interaction.pdf](https://www.code-saturne.org/cms/sites/default/files/file_attach/Tutorial/Fluid-structure-interaction.pdf)**
>
> 5.04 MB

and I got the solution using the option “Boundary conditions -\>fluid solid interaction → internal coupling”, as indicated in the tutorial. However, I have seen a tab “external coupling with aster” but I don’t know how it works. By using this option, how can I transfer the fluid solution to aster? Should I use yacs?

Thanks.

---

<div class="post-metadata">

**Author:** ![Yvan\_Fournier](https://code-saturne.org/forum/letter_avatar_proxy/v4/letter/y/4bbf92/32.png) [@Yvan\_Fournier](https://code-saturne.org/forum/u/Yvan_Fournier)\
**Post date:** [January 19, 2021, 9:59pm UTC](https://code-saturne.org/forum/t/coupling-with-salome-meca-2019/1980/8 "2021-01-19T21:59:17Z")

</div>

Hello,

The presence of this tab is actually a bit “optimistic” (we should hide it in the current versions). Coupling with code\_aster was operational (though installation was tricky) up to a code\_saturne v6.0/salome\_meca 2017 combination.  
It might work (not tested) with salome\_meca 2018, but is broken by changes in code\_aster in salome\_meca 2019.  
In that case the tab allows setting the related code\_saturne options.

Starting with code\_saturne 6.1, the coupling is modified, so as to be able to prepare for changes on the code\_aster side (and be simpler to set up) but the code\_aster side of things had not been done yet (though everything should be feasible in a user setup, so an advanced code\_aster user could handle it with a bit of support on this forum, and proovide a first working example).

If you simply need to transfer static/steady code\_saturne results to code\_aster, exporting the boundary postprocessing output (including pressure / surface stresses) in MED format should allow reading them from code\_aster.

Regards,

Yvan
