LongCut logo

[Tutorial] Installing Salome CFD in 2022 with Code Saturne 7.0

By Cyprien Rusu

Summary

Topics Covered

  • One-Click CFD Installer Is Dead
  • Bootstrap Is the Hidden Missing Step
  • PyQt5 Pip Installs Break Everything
  • Version Mismatch Breaks the Entire Workflow
  • OMNI_ORB Is Hidden and Must Be Built Manually

Full Transcript

[Music] hello guys cyber here from ffo and in today's video i'll show you how to install salome cfd so if you don't know

what salome cfd is well it's a specific version of the pre-post processor salome which is an open source pre-pass processor and

you have added to that the cfd study module that uh will allow you to run code saturn from within cellmate so

i used to make a lot of videos about about xiaomi cld in the past but i realized that the way to install it has changed

and right now there is no uh one installer that you can just click and run and and get it so it's uh the installation procedure is now become

very complicated so that's why i decided to make this video i had a lot of requests through the comments on youtube asking me can you show us how to install

this xiaomi cfd extension so here this is what i will do in this video and the first thing i will do is to install code saturn which you need to be able to run the the studies then you

need to install salome itself and then you need to install the salome cfd extension so that's why it's a pretty long process so let's start by going to the download page

and have a look at what are the option to download code saturn so you can see that first you can download it as a tarball so it's a basically an archive that contains a

source code of code saturn so i was using this way before to install it but i found find out that you can

also install it using github and this is actually this will give you access to the latest master code of code saturn also you can have access

to several versions of the the code so i'll show you how you can get the v7 version right after when i downloaded this code so let's go and get

let's [Music] copy this link okay so now that i've copied this link let's open a new terminal prompt

let's see the inner folder that i already created called saturn src so if you don't have this folder you can create with mkdir and the name of the folder or you can call it whatever you

want and then let's get clone and paste the repository the link of the repository in it now i just have to so you need to have git install if you

don't have it you'll need to install with apt-get so that's pretty easy but i guess you have git already so uh click on enter

and now you just need to wait for the the project to be cloned into the repository okay so once this is downloaded we have to cd into

the code saturn folder that has been downloaded and there are two things we need to do first is to check out the version of the code we'll be using so if you go back on

github you'll see here that you have a lot of versions of code saturn so you can either default will be the master branch so that's the one which is continually being developed

but you know staying on the master branch just um it has some risks because if the developers are adding some small changes and you know or there is a currently a

bug or something on it then you will download this and you know you won't know what is uh wrong so i'm not saying the master branch has a bug it probably doesn't right now but

it's better to check out a specific version you will be using and also if you want to you know use an older version or something like this it's better to to choose so

i will be using the v7 because it's the same than the one you will download if you download the tar file and that way um you know

the procedure for installation with git or with the tar file will be the same so how do you check out this um well you use

get again git check out and you just give it the the name of the branch so v 7.0 now if you do that it tells that this

switch to the new branch you can check at any time using git status on which branch you are on and this tells you that you're on origin v7

so that's fine and once you do that there's an important step which is actually not mentioned anywhere um if you download the code from git you

will need to do this in order to um to be able to use this and compile this code and this there is a script which is located in

s-bin which is bootstrap and you'll need to launch this script in order to generate some files which are required

for the installation so you need to do s-bin and bootstrap and that's kind of the line that i was missing because it's not explained in the in the

read me or any anywhere that you have to do this so uh before i i knew how to do this i was never able to install it using the get repository code and this is because i was missing that

so yeah don't forget to do this let's come back on the main code and you have some installation

so installation can be done through install saturn.py script so that's what that's

saturn.py script so that's what that's what we'll be doing in the meantime make sure you have the prerequisite for code saturn so this is go back on the website and you have a

page consultant prerequisites so you have to check that those software that you see here are or the install and

the most is important is um pi qt5 you need to have this and cgns and med

hdf5 so all of this can be installed automatically by the install script so i'll show you how to do this but you need to have pyq t5 so to install pi cute if you don't have

it do an apt-get install and i think the command is python

3 dash by five something like this or maybe there there are some matches

there are some capital letters here like this and uh so if you install that you should have it now of course you you need to

have python 3 installed so i have if you type python 3.8 for example which is the version i have you see that a python prompt

appears so i have python installed i have by qt5 installed now a small note is that if you have python there is another way to install

pyqt5 which is using pip so probably pip or pip3 install pi qt5 don't do this don't use this command if

you have installed it using this and install it just uninstall it and there's a reason for this is because if you have that

plus you install it also using the apt-get uh the two version of pi cute on your computer will enter in conflict and then you'll have some error message when

you launch salome so i search for what the reason was for very very long time before i actually found uh you shouldn't install it using pip so this is uh this is important

information okay for the other prerequisites we'll see how to install this using the installation script so now that code saturn is

configured and i did the bootstrap let's let's have a look so this is my folder so if i go into this folder

so i'm already in it actually uh let's let's try to use python so python

i think let's see python's three if i type just python yeah it's open python two so that's not the one i want

so python 3.8 and i want to launch this install saturn py and now

read well what is written here because it tells you that it can cannot be run from within this folder so what is recommended is that you go

out of this folder and you create a folder called saturn build and then you see the intuit and you launch the script from that folder

so that's what um so actually it's it gives you the the lines of code you have to to do this to to create this so i can add directly copy that

mk there okay so you see it executed it created the build folder um well i i don't really have to copy that to cd into it but um

here and now we can launch this so i can using the absolute path or i can use double dot to go out of the folder

code saturn and install dot py okay and after it launched this it tells you the process will take several minutes

blah blah blah um and you have a setup file that appears into the build folder so that's

important so let's open this file and this file will basically ask you some of the configuration option you want so

setup files for installation download packages don't so if you don't have the packages it will install them and download them for you

so it recognized that i have a c compiler and a mpi option so it's fine it's written here

i have the fortran compiler as well i have the c plus plus compiler i have python 3 so this is the the link of my python

um so it will not disable the gui now uh optional solomon platform install pass so if you want to install it with salome

so which will do after that you'll have to um you'll have to change those option here so but yes

and then you'll need to have those optional packages met hdf5 cjs scotch and to get those

um what you need to do to go down to this line and replace basically all the nodes by yes here

so use install yes so you don't need to put the pass because it will download it automatically if you already downloaded and you want to tell it okay install

don't install this you can paste the path to this but i highly not recommend to do this because there are many versions of fgh5 and

basically you never know which version will be the correct one so you will you will have a lot of troubles doing this so use auto med

yes yes scotch let's install scotch and parmes also okay so once you have all that save this

file and now we could go back to this and just rerun this installation script and now

let's see what it says um salome directory is provided in the setup but is not present okay

okay so maybe i won't need to okay i know i don't need to to put the yes here i'll put no for a moment

so okay and now it starts to download so you see it will download hdf and all the package it needs and then

it will install them so this will take quite some time so you know be patient and uh we'll come back when everything is uh

downloaded and installed okay so once this is finished you should see um the following message thank you for choosing code saturn

and you know basically there should be no error so if you have an error on the installation of one of those uh modules go back look at the you know the specific module that was downloaded and

installed and try to solve you know what kind of error this might be and i had some errors before when i was trying to install a specific version of

hdf or stuff like this but you know i don't recommend you to do this just use the download option to download automatically the version which is required okay so once you have that

you should be able to use code saturn but before you actually do this i recommend you to take those two lines copy them and paste them into your bash

rc file so you can open your bash rc with any text editor so i'm using emacs but you know you can use anything and it should be

bash rc like that go down and so yeah those are the two lines so i have a previous code saturn installation

so i i'm using the previous one so let's just remove those two lines and instead put this one

okay save and now you should be able to launch code saturn just like this saturn

oh you may have to reload right the rc so you have to open a new prompt so in a new prompt if you type code saturn and

so if i just type cursor like that you see i i will get the kind of option i can use so i have the help the study manager and everything and if i type concert on gui

you should see the gui of codes that are opening right now and it should be ready to to launch a simulation so now that code saturn is installed

we'll have to install salome so if you want you can sell salmon first and go saturn after there's no order so let's click on salome cfd

and here you have um so you need to install the salome platform the general uh platform and then use the salmon cfd extension to add

a cfd study module to the platform so that's kind of what is complicated here so let's go to the salome platform website

and i think xiaomi has also changed the way to install xiaomi since last time i looked at it so it's uh it was it used to be pretty easy

but right now it's more difficult as well so here you have the latest xiaomi 9.8 so let's go on

so let's download it on the version of ubuntu you're using so i'm using ubuntu 20.

and just let's wait that this folder gets downloaded so after you download it

you have to unzip it so uh use the tar xvf command so basically you know tar

xvf and the name of the full name of the the archive and then it will automatically unzip it so i've already done it so i'm not doing it again

and what you have to do is first let's look at the readme and what the readme tells you is that you have binaries which has or which are

already compiled in it and those binaries they [Music] they contain what is needed to launch the application

now there's something this script is not this readme is not telling you is that you have to launch the install bin sh script to actually generate the install folder which is not available by

default so and first when you do that you have to check your system that you have or what is required to launch xiaomi so because there are a lot of

prerequisites for xiaomi and this is kind of the the boring part of the installation so you see you have this sat script so what you have to do

is take this copy put a dot and then paste that and launch this

and then it will automatically check for the dependencies which are installed on your computer so in my case i already installed it so

i i've gone through this list you see some of them are still not installed but that's because i couldn't find those packages and they weren't really useful

or needed to launch xiaomi so some of those package are maybe not used for every salome module so you don't need to have everything installed but some of them are

required so just wait that this completes and when this completes i'll show you what you need to do okay so

uh here it still it tells me that i need to install those model actually i don't really need them but you know most i have most of the package installed in your case you

probably have many uh no or ko ko in red means that you don't have it so what you you need to do is um open synaptic so if you don't have

synaptic a pt get or sudo aptit get install synaptic okay if you don't have it

if you have it just open it with sudo so synaptic is a very very useful package manager and it's a visual

so you get this interface and this will allow you to search for all the stuff that you know you don't have so for example let's say it tells you you don't have

you don't have i don't know graph this install so you just copy that here you paste it here and you search for it

and you see you have a module here so i already have it so it's it displays in green it means that i have it if you don't have it just check mark for installation and then click on

apply and this will automatically install it on your computer so do that for all the modules that you don't have um

and and when this is this seems like a bit like me that almost everything is here uh you're ready to install xiaomi so

now you just launch the install.bean.sh

script so like this and basically what it's doing is that it's copying the binaries from this folder into an install

folder so wait that this completes okay so now that the files are all copied let's have a look in the in the install

folder you see that you have all um basically the version of the binaries that were here have been copied into install

now we should be able to run salme by dash dot dash xiaomi like this sound should be launching okay well that's great

and now that xiaomi is installed we're ready for the third step with to install the salome cmd module now one note i don't know why every time

i leave xiaomi right now i'm getting this double free or corruption um i don't know it still works fine it's just that when i leave it it just gives me that

but that i don't think this is a big problem so if we go back on the salome cod website on the sonoma cfd tab you see that you need to have this salmon cfd

extension module so if you click on that this will lead you to another git repository so it's not the same than the previous one and

so i have to git clone this repository again so let's do this let's do let's open a new prompt

let's go in my salome folder and let's do a git clone and take this code here

to clone that into the folder okay so that was pretty fast so let's cd into this salome cfd extension and now if um

so there are several things to do so the first one is to check out the right version so as we have installed xiaomi 7 version you see that there is a branch v7 so that's

we have to check out and use this code if you're using the master branch then you can just use the master code that's fine but i'm using the seven version so i'll do a git

check out v 7.0 okay it's switched to the new branch and here again we have also to do the

s-bin bootstrap has been bootstrap to prepare the repository and generate

the files which are not by default in this repository okay so now this is done now what we have to do

is to create um is to basically to go into the salome environment so

let's go so what we we can do is to cd back cd into salome folder

and you see that i have the salome executable here and what i can do is salome and if you add shell like this

you see that the prompt changes and this means that it actually loaded the salome environment into my folder so now i have to go back

into my previous folder so let me see of the extensions and there's something more to do um which is

so salamis you have the extension let's have a look at the readme oh let's have a look at the configure so we'll have to to launch the configure but there are some options for this

configure that have to be set up so if you go down so it's a bit um difficult to find where are those extension defined

so let's let's do a search with salme and you you see that um there is a there is a whis salome tag that has to

be given to to to this executable and at the same time you need to have also some

environment variables to tell where the cfd study will be installed so what what i've done so let me check quickly

so here i put some of those instruction um into a text file because it's easier now even if i'm logged in the xylem environment i need to define some environment

variables that are required for the configure and i don't think they are automatically given all the time so that's why

i've done that so i have done first let's let's create a salome root deer

environment variable and this variable will contain the path to my salmay salmi folder so you can check that this variable has

been created using echo dollar and then the name of the variable cell may root here and you see that it contains the right

path so that's fine now i need to create two more variables so one will contain the pass to my code saturn install so

export copy paste and i think i change in my case i changed the install so it's um let me check

home code saturn so i had before 7.02 and i have 7.04

and basically the pass to this should be our clinic's bin so you see you have the executable here so that's let's take this

pass ctrl a to select everything copy let's paste that here okay so i have defined the cs root d here now i need to define cfd module root

deer and this is the pass to okay salome so i have my

salome cfd extension and you see you have cfd study here so i don't actually think this this variable is needed maybe it's not

needed but by just security i'm just defining it okay so now that i have those three environment variable i'm ready to uh to

launch the configure script so for that i'm using this configure paste configure dash dash with salome salme

so let's launch this and now if you have some errors you have to be careful and look at what is written here because it will tell you if you have some problems

so now you should see this salome kernel support yes salami ui support yes so that means that it's fine i'm not in debugging mode so this is no

so this should be fine now now you should just do make and sudo make install and i'm telling you in advance i will have an error and i will show you how to solve it so make

okay so it works until here sudo make install okay so it actually

seems like it worked but i'm not really sure if it did so yeah that's weird then

it actually worked right out the bat so that's fine um let's try now to to launch it so and i will talk a bit later about the

error i was getting before in case you are uh getting the same error so um let's go so once you do sudo install you can launch xiaomi so if you

the one of the area i was doing before is that i was thinking that you have to launch the binary which is here psalm cfd in order to launch salome cmd but actually

it's not this one um if you look carefully at what has been written here you see that it has been installed

at this pass use usr local bin so this is the actual pass of my install

um so let's copy this and i have to exit i have to exit the salome environment now let's paste this

and use salome cmd and now they should be launching xiaomi cfd and you have

the you see you have now the cfd study model here but not that fast if you click here i'm oh it actually works well uh well i'm quite surprised because the

first time uh i did this it didn't work so maybe um oh i know it's because i already have the okay i have the

the correct uh variable in my uh bash rc file so let's yeah yeah yeah that's why let's i i'm cheating basically so

and that's you know that's why sometimes the developers don't realize there are such problems because they already have the environment set up and they would say yeah it works why it doesn't work for you and

you realize that actually yeah there are some things so yeah i i let's remove this those two lines here is

what actually make it works and so i want to show you what you should be getting if you don't have that so

now let's launch that again okay and now if i click here it works also wow okay cool well um [Music]

how to say that i must be very good to install at the second time because the first time i tried to install it i had a lot of problems and now it works right away

so let me tell you a few things that in case you're getting those errors so um let me let me take

so light works so you know you you're supposed to be able to to use some cfd normally but i was getting some errors before and i

want to tell you about this so the first error i was getting is that i had a weird error message telling me about leap qt5

core.5 version cutie not found so this

core.5 version cutie not found so this error i already told you about it at the beginning if you get this just uninstall pi qt

5 the pip version of pyqt5 and install it with apt-get instead that's what is causing this problem

now uh the second thing if um if you are getting this area so the second area i was getting is that

i had this omni dll error could not open ideal compiler module only model. so

and i didn't know what i had this error but basically it was telling me that it couldn't find this module into my asylum install folder so

if we go into my xiaomi install omni where is it on the orb library

yeah it actually it's still not here so i know why why it's working right now but it wasn't working because i i didn't

have this this file in in this directory here and what i did is that i went back to my archives

and you have you have this omni or b so you have a tar file so you have to untar this one and you have basically to

to create a build folder and then configure make install and this will generate um well let's actually do it for you

because it's it's not very complicated how can i open this um [Music] open in terminal

so so in case you're getting this omni rb error so what you have to do is to um

let's remove this build folder for now let's move to trash this so you have to mkdir

build folder then cd into the build folder then you have to do a dash dash slash configure like this

then you do make maybe it installed it in my in my computer somewhere else so that's why i'm i cannot you know my install can you can

find it right now but in cases you're getting this error you just have to do what i'm doing right now you see into the builds you make and then make install

and if you're wondering this omni orb is it's a kind of program that is making it's using corba which is a norm of

communication between programs and that's what is making a communication between the different modules of salme so it's an absolutely necessary program

to to have a communication between code saturn the cfd study module and salome um so if your computer cannot find it

you just have to install it manually like i'm doing right now okay and and then you do a pseudo make

install okay and then it should be working so and then if you go in the build directory then um

the lib1 yeah so in this case you are finding so those are the three modules that we're missing from um

from the previous error message so they are here and i believe those those files should have been provided in the initial salome install but they are not

so what you can do is just copy them go into the install folder find the omni orb and lib

and you just paste them here and uh and then it should work right this should solve the omni or b error now and then another error i was getting

is that um basically if your salome doesn't know where you have installed code saturn um when you when you actually open you click on the

module in the xiaomi it will give you an error and say okay um i can i cannot find the the right mojo so you'll get an error like this

like this one and it will tell you there is no module called code saturn.gui or something like this so if you are getting this error it means

that your salome cannot find where your um your code saturn is installed so what you have to do

in this case if you're getting this is to basically find where your code saturn is installed

so in my case it's um it's uh here saturn and you have a lib python 3 site packages

code saturn and this is the python module that you know the xiaomi install requires so just go on properties

copy this pass here and open a new prompt and create create a python pass variable

equal that would be equal to this path basically and if you do that your python installation will be able to find this code certain module

now another i was getting also is that if you're using two different version so in in this video i showed you how to do a git checkout to get the same seven

version of um code saturn and of the salmon cfd module so you have it should be working but in case you didn't do that you might have an error like this saying that you're not have the you

don't have the right module and that's because you have to compile with the the right version if you're using console and master you have to open you have to use sonoma cfd extension master

as well and once you have up you have this python pass you should be able to um so it worked already on my computer here local

bin salme cfd and now you should be able to have like me um

the sum a cfd module cfd study model into your summit so so this is the same cfd module and so you can just you know

create a new cfd case and and work with code certain within salme instead of working without now if despite

all the information i give you in this video you're still not able to get this um don't worry what you can do is work separately with code saturn and with salome that works as well if you cannot

get the module into it um you can simply you know generate your your med file export it then you open you know code saturn in the prompt with concerts on gui and then you

you will be able to work in this way it's a bit annoying because you have to go back and forth between xiaomi and kurtzer turn and everything but it should be working

and now the last thing i want to show you is again open your bash rc oh sorry there's a dot here and we'll create an alias for this link

so you see i have an alias already for code to turn so i'll create an alias for cell may cmd

equal and here i can put the the pass to my sound missing the install like that and in case you you need to have this python pass to

well in this case but it also here um that way you won't have to to reload the python pass every time so in my case seems like i don't need it

so that's fine and if you do this you save it you can now load salome cfd

with this comment here right and there you have it right so i hope it wasn't too difficult to follow and you know

if you have problems um either leave some comment on the video or i would advise you to go on the salome forum community forum

register an account here and just you know ask the problems the uh the guys here are very very nice so you know they will help you

for sure so thank you very much for watching this video i hope this was uh useful and i'll see you in another video

where i'll probably do some tutorials and other stuffs and don't forget to give a like the video because it took me a lot of time to to make this one

thank you thank you again thank you very much

Loading...

Loading video analysis...