singularity Salome_Meca CFD extension install

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
olav2
Posts: 1
Joined: Sun Oct 15, 2023 7:45 pm

singularity Salome_Meca CFD extension install

Post by olav2 »

Hello,

what is the correct way to use the CFD extension for salome meca 2022 with singularity on debian11 ?

thank you!
Yvan Fournier
Posts: 4164
Joined: Mon Feb 20, 2012 3:25 pm

Re: singularity Salome_Meca CFD extension install

Post by Yvan Fournier »

Hello,

I am no familiar with salome_meca 2022. From discussions with code_aster developpers and you post, I understand it is built using Singularity ?

Depending on whether the Singularity container includes all the tools needed for configuration, compilation and build (see code_saturne install guide for prerequisites and recommended packages), you may be able to simply follow the regular build procedure from the container or need a more advanced setup procedure.

This is not something we have tried/tested so far (the work on code_saturne/code_saturne coupling has been tested on cluster install, native at least on the code_saturne side).

Other people who have more knowledge concerning the salome_meca container are welcome to contribute to this thread...

Best regards,

Yvan
seirov
Posts: 11
Joined: Tue Jul 07, 2015 6:42 pm

Re: singularity Salome_Meca CFD extension install

Post by seirov »

Hello! This is an old issue, but I think that I can add my little contribution ;)
I've trying to couple Aster + saturne at salome platform for so many years... and now I am still trying, but I feel that I am closer than ever :mrgreen:

What I have done up to now:

1. Installing salome + aster + saturne from sources:
Installing salome + saturne doesn't give much trouble (I have done it in the past). The real problem is aster, I have tried to compile but given up at what I considered a death end:
https://forum.code-aster.org/public/d/2 ... on-manjaro

2. Installing salome-meca (singularity) + saturne (from sources):
I think this is the less painful approach. Singularity can be installed according to the instructions in aster web, although it is out-of-date:
https://code-aster.org/spip.php?article303
Then the recipe I have followed is:
  1. "unzip" the singularity container in a sandbox, so that you can browse the filesystem, and get into its shell:

    Code: Select all

    singularity build --sandbox sandbox/ salome_meca-lgpl-2023.1.0-4-20240327-scibian-10.sif
    singularity shell salome_meca-lgpl-2023.1.0-4-20240327-scibian-10.sif
    
  2. "sandbox" is now a folder in your filesystem, you need to chroot it as if it was the root filesystem:

    Code: Select all

    cd sandbox/
    chroot . /bin/sh
  3. In my system, if I chroot, internet doesn't work in the shell, so I had to do:

    Code: Select all

    echo "nameserver 8.8.8.8" > /etc/resolv.conf
  4. Install saturne pre-requisites (note: it doesn't matter the system you are using, the singularity is built in scibian, a fork of debian, so you have to use apt as package manager):

    Code: Select all

    apt install pyqt5-dev-tools
  5. Install code saturne with the following setup file:

    Code: Select all

    prefix    /opt/salome_meca/2023.1.0_scibian_univ/tools/
    salome    /opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/
    hdf5       yes   no       /opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/BINARIES-DB10/hdf5
    cgns       yes   no       /opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/BINARIES-DB10/cgns
    med        yes   no       /opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/BINARIES-DB10/medfile
  6. Install salome_cfd_extensions pre-requisites

    Code: Select all

    apt install libomniorb4-dev qttools5-dev-tools
  7. Install salome_cfd_extensions. I would like to detail this step, because (spoiler) although it installs without error it doesn't work:

    Code: Select all

    cd opt/salome_meca/2023.1.0_scibian_univ/tools/
    mkdir cfdstudy_src && cd cfdstudy_src
    git clone https://github.com/code-saturne/salome_cfd_extensions
    salome_cfd_extensions/sbin/bootstrap
    mkdir build && cd build
    ../salome_cfd_extensions/configure --prefix=/opt/salome_meca/2023.1.0_scibian_univ/tools/salome_cfd_extensions --with-salome=/opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/ CS_ROOT_DIR=/opt/salome_meca/2023.1.0_scibian_univ/tools/code_saturne-8.2.0 --with-env-id=120 OMNIIDL=/opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/BINARIES-DB10/omniORB/bin/omniidl
    make && make install
    
  8. Last step would be "zip" again the singularity container, not done yet because it doesn't work.
So, it compiles but when I launch salome (from within the container and shell), it outputs:

Code: Select all

Traceback (most recent call last):
  File "/opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/mesa_salome", line 1073, in <module>
    main(args)
  File "/opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/mesa_salome", line 1042, in main
    module.init(context, out_dir_Path)
  File "/opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/extra.env.d/120_s_cfd_study.py", line 29, in init
    context.appendVariable(r"SalomeAppConfig", os.path.join(s_cfd_study_ROOT_INSTALL_DIR, r"share/salome/resources/cfdstudy"))
AttributeError: 'SalomeContext' object has no attribute 'appendVariable'
Line 29 at file "/opt/salome_meca/2023.1.0_scibian_univ/prerequisites/Cea_archive-9100/extra.env.d/120_s_cfd_study.py" is:

Code: Select all

context.appendVariable(r"SalomeAppConfig", os.path.join(s_cfd_study_ROOT_INSTALL_DIR, r"share/salome/resources/cfdstudy"))
and if I comment it, it works but without cfd_extension. What is wrong with this code?

Unluckily I can't try "salome_cfd", as it seems to be an out-dated command, not used any more. What can I do now? Any clue will be welcome!

P.S: Some data about my system:
Linux: manjaro
kernel: 6.6.54-2-MANJARO
salome: salome_meca-lgpl-2023.1.0-4-20240327-scibian-10.sif
saturne: 8.2.0
Yvan Fournier
Posts: 4164
Joined: Mon Feb 20, 2012 3:25 pm

Re: singularity Salome_Meca CFD extension install

Post by Yvan Fournier »

Hello,

Thanks for the feedback.

Regarding coupling between code_saturne and code_aster, the old coupling based on Salome's YACS module has been broken since 2019 I believe (I last tested it with salome_meca 2017), and its architecture was a dead end (defined more for project constraints which are not relevant anymore).

The coupling was rewritten about a year ago using saner technical choices, based on MEDCoupling, but had not been tested in recent months, and required some code_aster changes developements which had not been merged. A colleague has been working on it again recently, so hopefully we should finally have a robust, industrial coupling in code_saturne 9.0 (to be released June 2025), with matching updates for the 2025 code_aster release.

Best regards,

Yvan
seirov
Posts: 11
Joined: Tue Jul 07, 2015 6:42 pm

Re: singularity Salome_Meca CFD extension install

Post by seirov »

ok, I thought there was a problem with a path or something else, because the installation was successful... It's a pity, I felt it so close. Anyway, I can't wait for the next version ;)
Post Reply