-
Notifications
You must be signed in to change notification settings - Fork 1
SAT
Building and compiling SALOME is made more convenient with the SALOME Tool (SAT). SAT, developed in Python, offers a universal and unified solution to prepare, compile, and package the various components of SALOME.
Currently, the following Linux and Windows distributions are supported.
Operating system | Distribution | Version | SALOME Identifier |
---|---|---|---|
Linux | Debian | 10, 11, 12 | DB10, DB11, DB12 |
Ubuntu | 20.04, 22.04, 24.04 | UB20.04, UB22.04, UB24.04 | |
Fedora | 32,34,36,38,40 | FD32, FD34, FD36, FD38, FD40 | |
Centos, Rocky | 7, 8, 9 | CO7, CO8, CO9 | |
Windows | 10 | W10 |
To build SALOME on Linux, you need to proceed as follows:
- Ensure that you have
python-is-python3
installed on your Linux distribution, otherwise, install it with this command line:
sudo apt install python-is-python3
or:
sudo dnf install python-is-python3
- First, you need to clone SAT and SAT_SALOME:
export SALOME_WORKSPACE=$PWD
git clone https://github.com/SalomePlatform/sat.git SAT
git clone https://github.com/SalomePlatform/sat_salome.git SAT_SALOME
- Run the following command to expose
SAT_SALOME
toSAT
cd $SALOME_WORKSPACE
SAT/sat init --add_project $PWD/SAT_SALOME/salome.pyconf
- Check that
SALOME-master-native
is exposed:
cd $SALOME_WORKSPACE
SAT/sat config --list |grep SALOME
- check that all SALOME prerequisites are present and install all missing ones. To do this, run:
cd $SALOME_WORKSPACE
SAT/sat config SALOME-master-native --check_system
- Prepare SALOME source code
cd $SALOME_WORKSPACE
SAT/sat -o "APPLICATION.properties.git_server='github'" prepare SALOME-master-native
This command will:
- retrieve all SALOME sources from their official GitHub repositories in directory
SALOME-master-native-<PLATFORM TAG>/SOURCES
- retrieve some prerequisites from the official CEA ftp anonymous repository
- check whether some mandatory system packages are present by running either
dpkg-check
orrpm
commands. - exclude closed-source sources
- patch sources if required.
Note that you can target permanently GitHub repository by editing the SALOME-master-native.pyconf file and set git_server to github
- Compile SALOME by running:
cd $SALOME_WORKSPACE
SAT/sat -o "APPLICATION.properties.git_server='github'" compile SALOME-master-native --clean_all
- Generate an environment script in bash and a SALOME launcher
cd $SALOME_WORKSPACE
SAT/sat -o "APPLICATION.properties.git_server='github'" environ SALOME-master-native
SAT/sat -o "APPLICATION.properties.git_server='github'" launcher SALOME-master-native --name salome
SAT/sat -o "APPLICATION.properties.git_server='github'" launcher SALOME-master-native --use_mesa --name mesa_salome
- Launch SALOME by running either
salome
ormesa_salome
:
cd $SALOME_WORKSPACE
SALOME-master-native-<PLATFORM TAG>/salome
- Launch SALOME and type in the python prompt :
import salome_test
This command line will run several basic tests.
- In addition, run a series of SALOME tests as follows.
To view the list of available tests, run:
SALOME-master-native-<PLATFORM TAG>/salome test -N
To run tests about KERNEL module only, type:
SALOME-master-native-<PLATFORM TAG>/salome test -R KERNEL
To run tests about SHAPER module only, type:
SALOME-master-native-<PLATFORM TAG>/salome test -R SHAPER
To compile a SALOME module in Debug mode:
- Edit file
SALOME-master-native.pyconf
and setdebug
toyes
Then compile the module (e.g. SHAPER) with the following command line:
cd $SALOME_WORKSPACE
SAT/sat -o "APPLICATION.properties.git_server='github'" -o compile SALOME-master-native -p SHAPER --clean_all
- Once this is done and in order to improve development cycles, do:
cd $SALOME_WORKSPACE
SAT/sat -o "APPLICATION.properties.git_server='github'"environ SALOME-master-native
source SALOME-master-native-<PLATFORM TAG>/env_build.sh
cd SALOME-master-native-<PLATFORM TAG>/BUILD/SHAPER
make -j$(nproc)
make install
To debug SALOME on Linux, you need to have gdb installed on your Linux platform and you can proceed as follows:
- Ensure that on Linux, you can use advanced features of gdb by checking that the following command line returns
0
.
cat /proc/sys/kernel/yama/ptrace_scope
otherwise as sudo run:
# enable process tracking
sudo echo 0 > /etc/sysctl.d/10-ptrace.conf
# reload configuration
sudo sysctl --system
- Launch SALOME
cd $SALOME_WORKSPACE
SALOME-master-native-<PLATFORM TAG>/salome
- Attach gdb to the
SALOME_Session_NoServer
process
To build SALOME on Windows, a certain number of prerequisites need to be met.
- git needs to be installed
- visual Studio C++ 2017 or 2019
Then, you need to proceed as follows:
-
retrieve the latest SALOME official Windows distribution. Below, we illustrate the approach with
SALOME-master.zip
, while the same recipe applies to any SALOME Windows installation like e.g.SALOME-9.13.0.zip
which can be downloaded from the SALOME platform official download page. -
Extract
SALOME-master.zip
to a directory like e.g.C:\S\SALOME-master
-
clone
SAT
andSAT_SALOME
:
cd C:\S
set SALOME_WORKSPACE=%CD%
git clone https://github.com/SalomePlatform/sat.git SAT
git clone https://github.com/SalomePlatform/sat_salome.git SAT_SALOME
- Expose
SAT_SALOME
toSAT
cd %SALOME_WORKSPACE%
copy /Y SAT_SALOME\salome-W10.pyconf SAT_SALOME\salome.pyconf
SALOME-master\W64\Python\python.exe SAT\sat init --add_project %CD%\SAT_SALOME\salome.pyconf
- Check that SALOME applications are exposed to
SAT
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat config --list
- Fix several paths. To do this, download this Batch script install_bin.bat and execute it in
%SALOME_WORKSPACE%
. This script is distributed with SALOME archive.
cd %SALOME_WORKSPACE%
call install_bin.bat --application SALOME-master
The install_bin.bat script will simply parse all files and fix path to the one in use.
Note that you can also use the install_bin.bat script to do steps 2 to 4
cd %SALOME_WORKSPACE%
call install_bin.bat --clone-sat --application SALOME-master
The script install_bin.bat implements a series of options. To list the available options, run:
cd %SALOME_WORKSPACE%
call install_bin.bat --help
- Generate a SALOME launcher as well as environment files
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat environ SALOME-master-windows
SALOME-master\W64\Python\python.exe SAT\sat launcher SALOME-master-windows
- Prepare SALOME sources
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat -o "APPLICATION.properties.git_server='github'" prepare SALOME-master-windows
To prepare only SALOME modules, run:
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat -o "APPLICATION.properties.git_server='github'" prepare SALOME-master-windows --properties "is_SALOME_module:yes"
To prepare only one SALOME module e.g. SHAPER, run:
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat -o "APPLICATION.properties.git_server='github'" prepare SALOME-master-windows -p SHAPER
You can also prepare the sources for several modules, to do this, add the list of modules separated by commas. For instance, to prepare SHAPER and SMESH, run:
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat -o "APPLICATION.properties.git_server='github'" prepare SALOME-master-windows -p SHAPER,SMESH
- To compile one SALOME module, run:
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat -o "APPLICATION.properties.git_server='github'" compile SALOME-master-windows -p SHAPER --clean_all
To compile several SALOME modules, run:
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat -o "APPLICATION.properties.git_server='github'" compile SALOME-master-windows -p SHAPER,SMESH --clean_all
We recommand to use either Qt Creator or Visual Code which ease the debugging process. As done for Linux, attach to the MSVC debugger, the process SALOME_Session_NoServer.exe
.
Compiling the entire SALOME application is tedious, thus, as an alternative, you can compile SALOME modules in Release mode with debug symbols. To do this, edit the application configuration file and set cmake_build_type to ReleaseWithDebInfo
. Then recompile the module, e.g. SHAPER:
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat -o "APPLICATION.properties.git_server='github'" compile SALOME-master-windows -p SHAPER --clean_all
Visual C++ solutions are available in: SALOME-master\BUILD\SHAPER
.
Log files associated to the compilation are available in: SALOME-master\LOGS\SHAPER
.