From 079137f9f74de4480c0a5b5d07d4b697156f65f2 Mon Sep 17 00:00:00 2001 From: Popescu V <136721202+popescu-v@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:16:35 +0200 Subject: [PATCH 1/5] Use only conda-forge when building and testing the Conda packages This achieved by using Miniforge3 in the setup-miniconda GitHub action. Thus, only the `conda-forge` channel is used and there is no need of channel overriding. --- .github/workflows/conda.yml | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 7b61db626..d0e1952f9 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -45,10 +45,10 @@ jobs: - name: Install Miniconda uses: conda-incubator/setup-miniconda@v3 with: - miniconda-version: latest + miniforge-version: latest python-version: '3.12' - name: Install Dependency Requirements for Building Conda Packages - run: conda install conda-build conda-verify + run: conda install -y conda-build # We need MacOS SDK 10.10 to build for macOS Intel # See: https://docs.conda.io/projects/conda-build/en/3.21.x/resources/compiler-tools.html#macos-sdk - name: Install Mac OS SDK 10.10 @@ -68,7 +68,6 @@ jobs: KHIOPS_RAW_VERSION="$(./scripts/khiops-version)" fi echo "KHIOPS_VERSION=$(echo $KHIOPS_RAW_VERSION | sed 's/-//')" >> "$GITHUB_ENV" - # On tag and macOS: Set the environment variables to sign the binaries if [[ "${{ runner.os }}" == "macOS" && "${{ github.ref_type }}" == "tag" ]] then @@ -77,13 +76,9 @@ jobs: echo "KHIOPS_APPLE_CERTIFICATE_PASSWORD=${{ secrets.KHIOPS_APPLE_CERTIFICATE_PASSWORD }}" >> "$GITHUB_ENV" echo "KHIOPS_APPLE_TMP_KEYCHAIN_PASSWORD=${{ secrets.KHIOPS_APPLE_TMP_KEYCHAIN_PASSWORD }}" >> "$GITHUB_ENV" fi - - name: Build conda packages (Windows) - if: runner.os == 'Windows' - run: conda build --output-folder ./build/conda ./packaging/conda - # In Linux/macOS we need the conda-forge channel to install their pinned versions - - name: Build conda packages (Linux/macOS) - if: runner.os != 'Windows' - run: conda build --channel conda-forge --output-folder ./build/conda ./packaging/conda + - name: Build conda packages + run: | + conda build --output-folder ./build/conda ./packaging/conda - name: Upload conda packages artifact uses: actions/upload-artifact@v4 with: @@ -110,19 +105,17 @@ jobs: - name: Install Miniconda uses: conda-incubator/setup-miniconda@v3 with: - miniconda-version: latest # needed for macOS 13 + miniforge-version: latest # needed for macOS 13 python-version: ${{ matrix.python-version }} - name: Download Conda Package Artifact uses: actions/download-artifact@v4 with: name: khiops-conda-${{ matrix.env.os-family }} path: ./build/conda - - name: Install the Conda package (Windows) - if: runner.os == 'Windows' - run: conda install --channel ./build/conda khiops-core - # In Linux/macOS we need the conda-forge channel to install their pinned versions - - name: Install the Conda package (Linux/macOS) - if: runner.os != 'Windows' + - name: Install the Conda package + run: | + conda install --channel ./build/conda khiops-core + - name: Test that the executables are installed run: | conda install --channel conda-forge --channel ./build/conda khiops-core - name: Add CONDA_PREFIX to shared PATH @@ -157,10 +150,11 @@ jobs: - name: Install Miniconda uses: conda-incubator/setup-miniconda@v3 with: - miniconda-version: latest + miniforge-version: latest python-version: '3.12' - name: Install requirement packages - run: conda install -y anaconda-client conda-index + run: | + conda install -y anaconda-client conda-index - name: Reindex the package directory run: python -m conda_index ./build/conda - name: Upload the packages to anaconda.org From f86abbde93198e361311756cdcdf5381cc6296b8 Mon Sep 17 00:00:00 2001 From: Popescu V <136721202+popescu-v@users.noreply.github.com> Date: Tue, 2 Jul 2024 18:22:18 +0200 Subject: [PATCH 2/5] Build Windows Conda packages on the latest (windows-2022) Windows GitHub runner Thus, Ninja / VS interaction errors are partially mitigated. See https://github.com/actions/runner-images/issues/9701. --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index d0e1952f9..6d87f1379 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -31,7 +31,7 @@ jobs: # Linux: We use the Khiops dev debian:10 container to build with glibc 2.28 # It ensures compatibility with glibc >= 2.28 (in particular Rocky 8) - {os: ubuntu-22.04, os-family: linux-64, json-image: '{"image": "ghcr.io/khiopsml/khiops/khiopsdev-debian10:latest"}'} - - {os: windows-2019, os-family: win-64, json-image: '{"image": null}'} + - {os: windows-2022, os-family: win-64, json-image: '{"image": null}'} - {os: macos-13, os-family: osx-64, json-image: '{"image": null}'} - {os: macos-14, os-family: osx-arm64, json-image: '{"image": null}'} container: ${{ fromJSON(matrix.setup.json-image) }} From 9abd84fbfebbc90922e665875166c1c3c6db800a Mon Sep 17 00:00:00 2001 From: Popescu V <136721202+popescu-v@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:27:04 +0200 Subject: [PATCH 3/5] Set Windows CXX compiler dependency on the Conda recipe --- packaging/conda/conda_build_config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/conda/conda_build_config.yaml b/packaging/conda/conda_build_config.yaml index 185e09f7c..6fa1b4cf6 100644 --- a/packaging/conda/conda_build_config.yaml +++ b/packaging/conda/conda_build_config.yaml @@ -16,12 +16,14 @@ mpi: c_compiler: - gcc # [linux] - clang # [osx] + - vs2022 # [win] c_compiler_version: - 12 # [linux] - 16 # [osx] cxx_compiler: - gxx # [linux] - clangxx # [osx] + - vs2022 # [win] cxx_compiler_version: - 12 # [linux] - 16 # [osx] From 897ce6a829df208f14d3c48d7038e9b094533e1b Mon Sep 17 00:00:00 2001 From: Popescu V <136721202+popescu-v@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:06:06 +0200 Subject: [PATCH 4/5] Specify empty target platform and generator toolset for CMake with Ninja on Windows This is because Ninja does not expect target platform and generator toolset. However, CMake Windows presets set these, which results in Ninja failure. --- packaging/conda/bld.bat | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packaging/conda/bld.bat b/packaging/conda/bld.bat index 6830aeed6..24ddfb3f5 100644 --- a/packaging/conda/bld.bat +++ b/packaging/conda/bld.bat @@ -2,10 +2,13 @@ REM Echo all output @echo on REM Build the Khiops binaries -cmake --preset windows-msvc-release -DBUILD_JARS=OFF -DTESTING=OFF +REM Specify empty target platform and generator toolset for CMake with Ninja on +REM Windows +REM Ninja does not expect target platform and generator toolset. +REM However, CMake Windows presets set these, which results in Ninja failure. +cmake --preset windows-msvc-release -DBUILD_JARS=OFF -DTESTING=OFF -A "" -T "" cmake --build --preset windows-msvc-release --parallel --target MODL MODL_Coclustering KhiopsNativeInterface KNITransfer _khiopsgetprocnumber - mkdir %PREFIX%\bin REM Copy the khiops-core binaries to the Conda PREFIX path: MODL, MODL_Cocluetsring and _khiopsgetprocnumber. From c9c4ae5cc30f077cec93544997c830e3e814df0e Mon Sep 17 00:00:00 2001 From: bruno <97033386+bruno-at-orange@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:38:05 +0200 Subject: [PATCH 5/5] Disable math optimisation on clang and gcc for all UNIX build targets Disable "floating-point expression contraction" on clang and gcc to improve reproducibility between x86_64 and arm64. This change impacts: - Linux native builds - Conda builds for: - Linux - Mac OS: ARM and X86_64 architectures --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb402500f..9dd6083c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,6 +262,10 @@ function(set_unix_khiops_options target) # target_compile_options(${target} PRIVATE $<$:-fno-rtti> -fno-exceptions) + # Disable "floating-point expression contraction" on clang and gcc to improve reproducibility beetween x86_64 and + # arm64 + target_compile_options(${target} PRIVATE -ffp-contract=off) + endfunction(set_unix_khiops_options) # Sets the compiling options for MSVC