Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/build-khiops/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ runs:
- name: Setup MPI (Windows)
if: runner.os == 'Windows'
uses: mpi4py/setup-mpi@v1
with:
mpi: intelmpi
- name: debug info
shell: bash
run: |
echo "mpibindir=$mpibindir"
- name: Setup MPI (macOS)
if: runner.os == 'macOS'
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/test-khiops-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ runs:
echo --- Khiops environment with KHIOPS_PROC_NUMBER=%KHIOPS_PROC_NUMBER%
call khiops_env --env
call khiops_env
if not "%KHIOPS_MPI_COMMAND%". == "". (
if defined KHIOPS_MPI_COMMAND (
echo "::error::MPI is used even though there are only 2 procs available"
exit 1
)
Expand All @@ -117,11 +117,11 @@ runs:
echo --- Khiops environment with KHIOPS_PROC_NUMBER=%KHIOPS_PROC_NUMBER%
call khiops_env --env
call khiops_env
if not "%KHIOPS_MPI_ERROR%".=="". (
if defined KHIOPS_MPI_ERROR (
echo "::error::Unexpected MPI error: %KHIOPS_MPI_ERROR%"
exit 1
)
if "%KHIOPS_MPI_COMMAND%". == "". (
if not defined KHIOPS_MPI_COMMAND (
echo "::error::KHIOPS_MPI_COMMAND is not set"
exit 1
)
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pack-nsis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ jobs:
/DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_REDUCED_VERSION }} `
/DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release `
/DJRE_PATH=..\..\..\assets\jre `
/DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} `
/DMSMPI_VERSION=${{ env.MSMPI_VERSION }} `
/DINTEL_MPI_DIR="${{ env.I_MPI_ROOT }}\bin" `
/DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\visualization\${{ env.KHIOPS_VIZ_FILENAME }} `
/DKHIOPS_SAMPLES_DIR=..\..\..\samples `
/DINTEL_MPI_BIN_DIR=..\..\..\build\windows-msvc-release\tmp\mpi\bin `
/DINTEL_MPI_LICENSES_DIR=..\THIRD-PARTY-LICENSES `
/DSIGN `
/DPATH_TO_JSIGN=D:\\jsign.jar `
/DSM_CERT_ALIAS=$Env:CERTIFICATE `
Expand All @@ -178,10 +179,11 @@ jobs:
/DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_REDUCED_VERSION }} `
/DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release `
/DJRE_PATH=..\..\..\assets\jre `
/DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} `
/DMSMPI_VERSION=${{ env.MSMPI_VERSION }} `
/DINTEL_MPI_DIR="${{ env.I_MPI_ROOT }}\bin" `
/DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\visualization\${{ env.KHIOPS_VIZ_FILENAME }} `
/DKHIOPS_SAMPLES_DIR=..\..\..\samples `
/DINTEL_MPI_BIN_DIR=..\..\..\build\windows-msvc-release\tmp\mpi\bin `
/DINTEL_MPI_LICENSES_DIR=..\THIRD-PARTY-LICENSES `
khiops.nsi
- name: Sign installer
uses: digicert/code-signing-software-trust-action@v1.2.1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/run-standard-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ jobs:
- name: Setup MPI (windows)
if: runner.os == 'Windows'
uses: mpi4py/setup-mpi@v1
with:
mpi: intelmpi
- name: Setup MPI (macOS)
if: runner.os == 'macOS'
shell: bash
Expand Down
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,15 @@ if(MPI)
endif()

# Detects the mpi implementation
if(UNIX AND MPI)
if(MPI)
include(get_mpi_implementation)
get_mpi_implementation()

# Set MPI suffix if it is not defined with the environment variables (like on Fedora distros)
if(NOT MPI_SUFFIX AND MPI_IMPL)
# Set MPI suffix if it is not defined with the environment variables (like on Fedora distros) On Windows, the suffix
# is always empty
if(UNIX
AND NOT MPI_SUFFIX
AND MPI_IMPL)
set(MPI_SUFFIX "_${MPI_IMPL}")
endif()
endif()
Expand Down
34 changes: 34 additions & 0 deletions packaging/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,24 @@ else(IS_LINUX OR IS_MACOS)
set(BIN_INSTALL_DIR "bin")
endif()

if(IS_MSMPI)
file(READ packaging/windows/set_proc_number.cmd SET_PROC_NUMBER)
endif()

# For Intel MPI, we need to copy the redistributable files to a staging directory and install them from there. We
# cannot directly
if(IS_INTEL_MPI
AND NOT IS_PIP
AND NOT IS_CONDA)
get_filename_component(INTEL_MPI_BIN_DIR "${MPIEXEC_EXECUTABLE}" DIRECTORY)
set(INTEL_MPI_STAGING_BIN_DIR "${TMP_DIR}/mpi/bin")
file(MAKE_DIRECTORY ${INTEL_MPI_STAGING_BIN_DIR})
set(INTEL_MPI_REDISTRIBUTABLE_FILES hydra_bstrap_proxy.exe hydra_pmi_proxy.exe impi.dll mpiexec.exe)
foreach(INTEL_MPI_REDISTRIBUTABLE_FILE IN LISTS INTEL_MPI_REDISTRIBUTABLE_FILES)
configure_file(${INTEL_MPI_BIN_DIR}/${INTEL_MPI_REDISTRIBUTABLE_FILE}
${INTEL_MPI_STAGING_BIN_DIR}/${INTEL_MPI_REDISTRIBUTABLE_FILE} COPYONLY)
endforeach()
endif()
configure_file(${PROJECT_SOURCE_DIR}/packaging/windows/khiops_env.cmd.in ${TMP_DIR}/khiops_env.cmd @ONLY
NEWLINE_STYLE CRLF)

Expand All @@ -295,6 +313,22 @@ else(IS_LINUX OR IS_MACOS)

install(TARGETS MODL MODL_Coclustering _khiopsgetprocnumber RUNTIME DESTINATION ${BIN_INSTALL_DIR}
COMPONENT KHIOPS_CORE)
if(IS_INTEL_MPI
AND NOT IS_PIP
AND NOT IS_CONDA)
install(
FILES ${INTEL_MPI_STAGING_BIN_DIR}/hydra_bstrap_proxy.exe ${INTEL_MPI_STAGING_BIN_DIR}/hydra_pmi_proxy.exe
${INTEL_MPI_STAGING_BIN_DIR}/impi.dll ${INTEL_MPI_STAGING_BIN_DIR}/mpiexec.exe
DESTINATION ${BIN_INSTALL_DIR}
COMPONENT KHIOPS_CORE)
# Install Intel MPI license files
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/packaging/windows/THIRD-PARTY-LICENSES/
DESTINATION licenses
COMPONENT KHIOPS_CORE
FILES_MATCHING
PATTERN "*.txt")
endif()
install(
PROGRAMS ${TMP_DIR}/khiops.cmd ${TMP_DIR}/khiops_coclustering.cmd ${TMP_DIR}/khiops_env.cmd
DESTINATION ${BIN_INSTALL_DIR}
Expand Down
2 changes: 1 addition & 1 deletion packaging/linux/common/khiops.in
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ main () {
launch_khiops "$@"
local _RETCODE=$?
else
if [ "$_GUI_SUPPORTED" = true ] || [ -z "$DISPLAY" ]; then
if [ "$_GUI_SUPPORTED" = false ] || [ -z "$DISPLAY" ]; then
error "GUI is not available, please use the '-b' flag"
else
if [ -z "$KHIOPS_JAVA_PATH" ]; then
Expand Down
2 changes: 1 addition & 1 deletion packaging/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS ${CMAKE_BINARY_DIR}/lib/)

# We add mpi implementation to package name (khiops-core only)
if(MPI_IMPL)
if(UNIX AND MPI_IMPL)
string(REPLACE "_" "-" PACKAGE_SUFFIX ${MPI_SUFFIX})
else()
set(PACKAGE_SUFFIX "-serial")
Expand Down
40 changes: 40 additions & 0 deletions packaging/windows/THIRD-PARTY-LICENSES/Intel-MPI-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
================================================================================
Intel(R) MPI Library - Redistributable Components License
================================================================================

This license covers the following redistributable files included in Khiops:
- hydra_bstrap_proxy.exe
- hydra_pmi_proxy.exe
- impi.dll
- mpiexec.exe

================================================================================

Intel Simplified Software License (Version October 2022)

Intel(R) MPI Library: Copyright (C) 2009 Intel Corporation

Use and Redistribution. You may use and redistribute the software, which is provided in binary form only, (the "Software"), without modification, provided the following conditions are met:

* Redistributions must reproduce the above copyright notice and these terms of use in the Software and in the documentation and/or other materials provided with the distribution.
* Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived from this Software without specific prior written permission.
* No reverse engineering, decompilation, or disassembly of the Software is permitted, nor any modification or alteration of the Software or its operation at any time, including during execution.

No other licenses. Except as provided in the preceding section, Intel grants no licenses or other rights by implication, estoppel or otherwise to, patent, copyright, trademark, trade name, service mark or other intellectual property licenses or rights of Intel.

Third party software. "Third Party Software" means the files (if any) listed in the "third-party-software.txt" or other similarly-named text file that may be included with the Software. Third Party Software, even if included with the distribution of the Software, may be governed by separate license terms, including without limitation, third party license terms, open source software notices and terms, and/or other Intel software license terms. These separate license terms solely govern Your use of the Third Party Software.

DISCLAIMER. HIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND ATTORNEYS' FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE.

LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

No support. Intel may make changes to the Software, at any time without notice, and is not obligated to support, update or provide training for the Software.

Termination. Your right to use the Software is terminated in the event of your breach of this license.

Feedback. Should you provide Intel with comments, modifications, corrections, enhancements or other input ("Feedback") related to the Software, Intel will be free to use, disclose, reproduce, license or otherwise distribute or exploit the Feedback in its sole discretion without any obligations or restrictions of any kind, including without limitation, intellectual property rights or licensing obligations.

Compliance with laws. You agree to comply with all relevant laws and regulations governing your use, transfer, import or export (or prohibition thereof) of the Software.

Governing law. All disputes will be governed by the laws of the United States of America and the State of Delaware without reference to conflict of law principles and subject to the exclusive jurisdiction of the state or federal courts sitting in the State of Delaware, and each party agrees that it submits to the personal jurisdiction and venue of those courts and waives any objections. THE UNITED NATIONS CONVENTION ON CONTRACTS FOR THE INTERNATIONAL SALE OF GOODS (1980) IS SPECIFICALLY EXCLUDED AND WILL NOT APPLY TO THE SOFTWARE.
================================================================================
15 changes: 15 additions & 0 deletions packaging/windows/THIRD-PARTY-LICENSES/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Third-Party Software Licenses
==============================

Khiops includes redistributable components from third-party software.
This directory contains the license files for these components.

Contents:
- Intel-MPI-LICENSE.txt: Intel(R) MPI Library redistributable components
(hydra_bstrap_proxy.exe, hydra_pmi_proxy.exe, impi.dll, mpiexec.exe)
- Eclipse Adoptium/Temurin OpenJDK JRE 21 (packaged by JustJ)
License files are in the jre\legal\ directory of the installation.
Main license: GPL v2 with Classpath Exception (see jre\legal\java.base\LICENSE)
Source: https://adoptium.net/

For the Khiops main license, see LICENSE.txt in the installation directory.
2 changes: 1 addition & 1 deletion packaging/windows/khiops.cmd.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ for %%i in (%*) do (
)
:BREAK_LOOP

if "%KHIOPS_BATCH_MODE%" == "true" if not "%KHIOPS_JAVA_ERROR%". == "". goto ERR_JAVA
if "%KHIOPS_BATCH_MODE%" == "false" if not "%KHIOPS_JAVA_ERROR%". == "". goto ERR_JAVA
if "%_KHIOPS_GUI%" == "false" if not "%KHIOPS_BATCH_MODE%" == "true" goto ERR_NO_GUI

REM Set path
Expand Down
49 changes: 22 additions & 27 deletions packaging/windows/khiops_env.cmd.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,23 @@ set "KHIOPS_COCLUSTERING_PATH=%_KHIOPS_HOME%\@BIN_PATH@\MODL_Coclustering.exe"
REM KHIOPS_LAST_RUN_DIR
if "%KHIOPS_LAST_RUN_DIR%". == "". set "KHIOPS_LAST_RUN_DIR=%USERPROFILE%\khiops_data\lastrun"

REM KHIOPS_PROC_NUMBER
if "%KHIOPS_PROC_NUMBER%". == "". for /f %%i in ('"%~dp0_khiopsgetprocnumber"') do set "KHIOPS_PROC_NUMBER=%%i"
if "%KHIOPS_PROC_NUMBER%". == "". set "KHIOPS_PROC_NUMBER=1"
@SET_PROC_NUMBER@

REM Set MPI binary (mpiexec)
if %KHIOPS_PROC_NUMBER% LEQ 2 goto MPI_DONE
REM Determine MPI usage based on KHIOPS_PROC_NUMBER
REM - If KHIOPS_PROC_NUMBER <= 2: sequential mode (no MPI)
REM - If KHIOPS_PROC_NUMBER is unset or > 2: set MPI command

REM Set MPI command path
goto @SET_MPI@

:MPI_PARAMS
REM Add the MPI parameters
if not "%KHIOPS_MPI_COMMAND%." == "." set "KHIOPS_MPI_COMMAND="%KHIOPS_MPI_COMMAND%" -n %KHIOPS_PROC_NUMBER%"
:MPI_DONE
REM Append proc number to MPI command if defined (only if MPI command is not empty)
if defined KHIOPS_PROC_NUMBER (
if defined KHIOPS_MPI_COMMAND set "KHIOPS_MPI_COMMAND=%KHIOPS_MPI_COMMAND% -n %KHIOPS_PROC_NUMBER%"
REM If KHIOPS_PROC_NUMBER <= 2, clear MPI command (use serial mode)
if "%KHIOPS_PROC_NUMBER%"=="1" set "KHIOPS_MPI_COMMAND="
if "%KHIOPS_PROC_NUMBER%"=="2" set "KHIOPS_MPI_COMMAND="
)

set _KHIOPS_GUI=@GUI_STATUS@
if "%_KHIOPS_GUI%" == "false" GOTO SKIP_GUI
Expand Down Expand Up @@ -148,32 +153,22 @@ exit /b 0

REM Set mpiexec path for conda installation
:SET_MPI_CONDA
set "KHIOPS_MPI_COMMAND=%_KHIOPS_HOME%\bin\mpiexec.exe"
if not exist "%KHIOPS_MPI_COMMAND%" goto ERR_MPI
goto MPI_PARAMS
set "KHIOPS_MPI_COMMAND="%_KHIOPS_HOME%\bin\mpiexec.exe""
if not exist %KHIOPS_MPI_COMMAND% goto ERR_MPI
goto MPI_DONE

REM Set mpiexec path for pip installation
:SET_MPI_PIP
set "KHIOPS_MPI_COMMAND=%_KHIOPS_HOME%\Library\bin\mpiexec.exe"
set "KHIOPS_MPI_COMMAND="%_KHIOPS_HOME%\Library\bin\mpiexec.exe""
set "KHIOPS_MPI_DLL_PATH=%_KHIOPS_HOME%\Library\bin\"
if not exist "%KHIOPS_MPI_COMMAND%" goto ERR_MPI
goto MPI_PARAMS
if not exist %KHIOPS_MPI_COMMAND% goto ERR_MPI
goto MPI_DONE

REM Set mpiexec path for system wide installation
:SET_MPI_SYSTEM_WIDE
REM ... with the standard variable MSMPI_BIN
set "KHIOPS_MPI_COMMAND=%MSMPI_BIN%mpiexec.exe"
if exist "%KHIOPS_MPI_COMMAND%" goto MPI_PARAMS
REM ... if MSMPI_BIN is not correctly defined
REM ... we try to call directly mpiexec (assuming its path is in the 'path' variable)
set "KHIOPS_MPI_COMMAND=mpiexec"
where /q "%KHIOPS_MPI_COMMAND%"
if ERRORLEVEL 1 goto ERR_MPI
REM ... finally we check if it is the good MPI implementation: "Microsoft MPI"
"%KHIOPS_MPI_COMMAND%" | findstr /c:"Microsoft MPI" > nul
if ERRORLEVEL 1 goto ERR_MPI_IMPL
goto MPI_PARAMS

set "KHIOPS_MPI_COMMAND="%_KHIOPS_HOME%\@BIN_PATH@\mpiexec.exe""
if not exist %KHIOPS_MPI_COMMAND% goto ERR_MPI
goto MPI_DONE

:ERR_MPI
set "KHIOPS_MPI_ERROR=We didn't find mpiexec in the regular path. Parallel computation is unavailable: Khiops is launched in serial"
Expand Down
5 changes: 0 additions & 5 deletions packaging/windows/nsis/KhiopsGlobals.nsh

This file was deleted.

49 changes: 0 additions & 49 deletions packaging/windows/nsis/KhiopsPrerequisiteFunc.nsh

This file was deleted.

Loading
Loading