Skip to content
Nabil Ghodbane edited this page Jan 31, 2025 · 18 revisions

How to compile SALOME with 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
List of supported platforms by SAT and corresponding SAT tags.

Building SALOME on Linux

To build SALOME on Linux, you need to proceed as follows:

  1. 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
  1. 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
  1. Run the following command to expose SAT_SALOME to SAT
cd $SALOME_WORKSPACE
SAT/sat init --add_project $PWD/SAT_SALOME/salome.pyconf
  1. Check that SALOME-master-native is exposed:
cd $SALOME_WORKSPACE
SAT/sat config --list |grep SALOME
  1. 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
  1. 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 or rpm 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

  1. Compile SALOME by running:
cd $SALOME_WORKSPACE
SAT/sat -o "APPLICATION.properties.git_server='github'"  compile SALOME-master-native --clean_all
  1. 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
  1. Launch SALOME by running either salome or mesa_salome:
cd $SALOME_WORKSPACE
SALOME-master-native-<PLATFORM TAG>/salome
  1. Launch SALOME and type in the python prompt :
import salome_test

This command line will run several basic tests.

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

Compiling a SALOME module in Debug mode

To compile a SALOME module in Debug mode:

  1. Edit file SALOME-master-native.pyconf and set debug to yes

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

Debugging SALOME on Linux operating system

To debug SALOME on Linux, you need to have gdb installed on your Linux platform and you can proceed as follows:

  1. 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
  1. Launch SALOME
cd $SALOME_WORKSPACE
SALOME-master-native-<PLATFORM TAG>/salome
  1. Attach gdb to the SALOME_Session_NoServer process

Building SALOME on Windows

To build SALOME on Windows, a certain number of prerequisites need to be met.

Then, you need to proceed as follows:

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

  2. Extract SALOME-master.zip to a directory like e.g. C:\S\SALOME-master

  3. clone SAT and SAT_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
  1. Expose SAT_SALOME to SAT
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
  1. Check that SALOME applications are exposed to SAT
cd %SALOME_WORKSPACE%
SALOME-master\W64\Python\python.exe SAT\sat config --list
  1. 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
  1. 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
  1. 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
  1. 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

Debugging SALOME on Windows operating system

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.