How to build HELLO.dll and HELLOEngine.dll for Hello Module in Salome

Hello,

I’m currently attempting to compile the HELLO.dll and HELLOEngine.dll from the source code available in the Git repository. It appears that the CMake files provided for both HELLO and HELLOGUI are configured for generating static libraries (.lib) with the following commands:

Could you confirm if this is the intended setup? Additionally, I’m wondering if there are separate CMake files available specifically for building .dll files.

ADD_LIBRARY(HELLOEngine ${HELLO_SOURCES})
ADD_LIBRARY(HELLO ${HELLOGUI_SOURCES})

Kevin

if you look at the top CMakeLists.txt file, you can see the presence of BUILD_SHARED_LIBS which ensures that DLL are generated.

Hello NabilG,

I appreciate your prompt response. I’ve successfully generated the SalomeHELLO.sln for Visual Studio and built the solution. However, I seem to be missing the .dll files. Could you please verify this? I’ve attached further details for your reference.
salome_forum_1.pdf (280.5 KB)

Kevin

can you confirm that your CMakeLists.txt is the nominal one. This later implements the SHARED library generation: line 57

Hello NabilG,

Yes, the CMakeLists.txt file I am using matches yours. Please see attached.
CMakeLists.txt (8.3 KB)

can you try to follow the recipe described at this link: SF-505

Note that there is no need here to apply the suggested patches.

Hello NabilG,

I successfully followed the attached instructions until the step where it prompted to clone the HELLO and CONFIGURATION. Please see attached error message. The issue derives from the presence of a ‘rm’ command, designed for Linux systems, while I am operating on Windows. Is there a script available that I can adjust to use ‘rmdir’ for Windows?

I extracted the HELLO and CONFIGURATION source manually into the SALAME-9.12.0\W64 folder, followed by executing the compilation command. Here’s the resulting output.

The BUILD and SOURCES folders that were generated remained empty.

Kevin

Have a look at file named LOGS\HELLO\cmake to see the error message or upload this file.

More generally SAT saves log files in LOGS

Regards.

Here is cmake file in LOG\HELLO folder.

build_dir = C:\S\SALOME-9.12.0\BUILD\HELLO
install_dir = C:\S\SALOME-9.12.0\W64\HELLO

LIBS = C:\S\SALOME-9.12.0\W64\EXT\lib

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=“Visual Studio 15 2017 Win64” -DCMAKE_INSTALL_PREFIX=C:\S\SALOME-9.12.0\W64\HELLO C:\S\SALOME-9.12.0\SOURCES\HELLO
CMake Warning:
Ignoring extra path from command line:

“C:\S\SALOME-9.12.0\SOURCES\HELLO”

CMake Error: The source directory “C:/S/SALOME-9.12.0/SOURCES/HELLO” does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

The directory SOURCES\HELLO
Is empty.
You can proceed as follows in a cmd terminal

cd SOURCES
rmdir /Q /S HELLO
git clone https://git.salome-platform.org/gitpub/samples/hello.git HELLO

Then repeat the compile step.

Here is the new cmake file in the LOG\HELLO folder after recompiled:

build_dir = C:\S\SALOME-9.12.0\BUILD\HELLO
install_dir = C:\S\SALOME-9.12.0\W64\HELLO

LIBS = C:\S\SALOME-9.12.0\W64\EXT\lib

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=“Visual Studio 15 2017 Win64” -DCMAKE_INSTALL_PREFIX=C:\S\SALOME-9.12.0\W64\HELLO C:\S\SALOME-9.12.0\SOURCES\HELLO
CMake Deprecation Warning at CMakeLists.txt:19 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a … suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Error at CMakeLists.txt:24 (PROJECT):
Generator

Visual Studio 15 2017 Win64

could not find any instance of Visual Studio.

– Configuring incomplete, errors occurred!
See also “C:/S/SALOME-9.12.0/BUILD/HELLO/CMakeFiles/CMakeOutput.log”.

Either install visual studio communauty 2017.
Or use a more recent one and set cmake generator to the corresponding value.

If installed. Source its setup script as described in reference thread.

I am using Visual Studio 2022 and I am setting the cmake generator and here is the error.

PS C:\S> cmake -G “Visual Studio 17 2022” C:\S\SALOME-9.12.0\SOURCES\HELLO
CMake Deprecation Warning at CMakeLists.txt:19 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a … suffix to tell
CMake that the project does not need compatibility with older versions.

– Selecting Windows SDK version 10.0.22621.0 to target Windows 6.2.9200.
CMake Error at CMakeLists.txt:35 (MESSAGE):
We absolutely need the Salome CMake configuration files, please define
CONFIGURATION_ROOT_DIR !

– Configuring incomplete, errors occurred!
PS C:\S>

Hi NabilG,

Were you able to successfully build the HELLO.dll and HELLOEngine.dll with provided source code in git repository?

Kevin

Here you’re trying to compile by command line.
If you use SAT, edit SALOME-9.12.0(windows).pyconf and fix the cmake generator.
If you aim to do it wirhout SAT, then you need to setup SALOME environment by running call env_launch.bat first.

I tried to do it without SAT so I run env_launch.bat then
PS C:\S> SALOME-9.12.0\W64\Python\python.exe SAT\sat compile SALOME-9.12.0 -p HELLO,CONFIGURATION --clean_all

Is this the expected result?

I will give it a try on my side and share the output - later this week.

Thank you, NabilG. :+1:

Here is what I did:

  • Install Visual 2017 available at this link

  • Install git available at this link: Git

  • download SALOME-9.12.0 and install it on D:\S (you can install it on C:\S)

  • download script SALOMEConfigTool.bat from this link: SALOMEConfigTool.bat

  • Start CMD terminal

  • go to the directory in which SALOME-9.12.0 was extracted, then run (and be patient):
    call SALOMEConfigTool.bat --application SALOME-9.12.0 --use-gitpub --products CONFIGURATION,HELLO

    This command will:

    • clone SAT and SAT_SALOME
    • patch SAT_SALOME to remove some non public products
    • target gitpub repositories and clone CONFIGURATION and HELLO products
    • set up visual 2017 by running:
      call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
  • You can then check that CONFIGURATION and HELLO are in directory SALOME-9.12.0\SOURCES

  • compile HELLO module:
    SALOME-9.12.0\W64\Python\python.exe SAT\sat compile SALOME-9.12.0 -p HELLO,CONFIGURATION --clean_all

Hello NablG,

Thank you for the detail instructions. I followed your instructions to set it up but I am not getting the same result. Do you know why?
Here is the result I got.

For “Compilation of HELLO”, I got CONFIGURE instead of OK and I only got Compilation : OK (1/2) not 2/2.