From 94c837ad527ea7990bb1e026d2615b1c433c7a27 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Thu, 24 Oct 2024 15:52:23 +0200 Subject: [PATCH 01/10] Revert "[ci] Disable win jobs temporarily due to runner hardware failure." This reverts commit 2b7dba96b80cf466e7eefcd446e30c226a3e9b8c. --- scripts/ci/jobs/build-wheels.yml | 4 ++-- scripts/ci/pipelines/regular.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ci/jobs/build-wheels.yml b/scripts/ci/jobs/build-wheels.yml index 305cdb5af37..59f5e700edc 100644 --- a/scripts/ci/jobs/build-wheels.yml +++ b/scripts/ci/jobs/build-wheels.yml @@ -55,7 +55,7 @@ build wheels mac: CMAKE_OSX_DEPLOYMENT_TARGET: "10.15" <<: *wheels_template -.build wheels win: # disabled temporarily due to runner hardware failure +build wheels win: tags: [windows] extends: - .vs2019-environment @@ -65,7 +65,7 @@ build wheels mac: publish wheels: stage: release - needs: ["build wheels linux", "build wheels mac"] # , "build wheels win", # disabled temporarily due to runner hardware failure + needs: ["build wheels linux", "build wheels mac", "build wheels win"] tags: [envinf, shell] rules: - if: $CI_COMMIT_TAG diff --git a/scripts/ci/pipelines/regular.yml b/scripts/ci/pipelines/regular.yml index c3e359b0309..8fdc940da96 100644 --- a/scripts/ci/pipelines/regular.yml +++ b/scripts/ci/pipelines/regular.yml @@ -5,7 +5,7 @@ include: - local: "/scripts/ci/jobs/pre-commit.yml" - local: "/scripts/ci/pipelines/linux.yml" - local: "/scripts/ci/pipelines/mac.yml" - # - local: "/scripts/ci/pipelines/win.yml" # disabled temporarily due to runner hardware failure + - local: "/scripts/ci/pipelines/win.yml" - local: "/scripts/ci/jobs/build-docs.yml" - local: "/scripts/ci/jobs/jupyter.yml" - local: "/scripts/ci/jobs/code-quality.yml" From 225bb040f63f8d87529274094e9a0964e52aafb2 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Thu, 24 Oct 2024 15:53:28 +0200 Subject: [PATCH 02/10] [cmake] Fix MKL finding on newer (2024) oneAPI versions. --- scripts/ci/extends/vs2019-environment.yml | 2 +- scripts/cmake/Find.cmake | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/ci/extends/vs2019-environment.yml b/scripts/ci/extends/vs2019-environment.yml index fdcda29d0e7..6b6160282b5 100644 --- a/scripts/ci/extends/vs2019-environment.yml +++ b/scripts/ci/extends/vs2019-environment.yml @@ -1,6 +1,6 @@ .load_vs2019_env: &load_vs2019_env - | - pushd $env:VS160COMNTOOLS + pushd $env:VS170COMNTOOLS cmd /c "VsDevCmd.bat -arch=amd64 -host_arch=amd64&set" | foreach { if ($_ -match "=") { diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 4af819824d8..0a557079664 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -77,6 +77,10 @@ if(OGS_USE_MKL) if(APPLE) set(_mac_ld_prefix "DY") endif() + # newer MKLs define ONEAPI_ROOT + if(NOT DEFINED ENV{MKLROOT} AND DEFINED ENV{ONEAPI_ROOT}) + set(ENV{MKLROOT} "$ENV{ONEAPI_ROOT}") + endif() if(NOT GUIX_BUILD AND (NOT DEFINED ENV{MKLROOT} OR (NOT "$ENV{${_mac_ld_prefix}LD_LIBRARY_PATH}" MATCHES "intel" From 674f5a033f97a70c32dbbca13baeb21ba6883bc2 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Fri, 25 Oct 2024 11:40:55 +0200 Subject: [PATCH 03/10] [cmake] bump msvc preset to Visual Studio 2022. --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 931a98bed5b..ea9a3e0a045 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -37,7 +37,7 @@ { "name": "_msvc", "hidden": true, - "generator": "Visual Studio 16 2019", + "generator": "Visual Studio 17 2022", "condition": { "type": "equals", "lhs": "${hostSystemName}", From 3048566614ed4dff005e807de676783fc14dc857 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Fri, 25 Oct 2024 12:44:32 +0200 Subject: [PATCH 04/10] missing include. --- GeoLib/SensorData.cpp | 1 + MathLib/Curve/CreatePiecewiseLinearCurve.h | 1 + 2 files changed, 2 insertions(+) diff --git a/GeoLib/SensorData.cpp b/GeoLib/SensorData.cpp index 984d2c4993c..4dcb4124008 100644 --- a/GeoLib/SensorData.cpp +++ b/GeoLib/SensorData.cpp @@ -14,6 +14,7 @@ #include "SensorData.h" +#include #include #include diff --git a/MathLib/Curve/CreatePiecewiseLinearCurve.h b/MathLib/Curve/CreatePiecewiseLinearCurve.h index b1b7a124690..a0e56943727 100644 --- a/MathLib/Curve/CreatePiecewiseLinearCurve.h +++ b/MathLib/Curve/CreatePiecewiseLinearCurve.h @@ -13,6 +13,7 @@ #pragma once #include +#include #include namespace BaseLib From 19660b59caf5d54b0af6913d8f60c77f7eca025e Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Fri, 25 Oct 2024 15:01:51 +0200 Subject: [PATCH 05/10] [ci,win] Disable MKL. --- scripts/ci/jobs/build-win.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ci/jobs/build-win.yml b/scripts/ci/jobs/build-win.yml index f84ade6b177..6499ecdce27 100644 --- a/scripts/ci/jobs/build-win.yml +++ b/scripts/ci/jobs/build-win.yml @@ -1,14 +1,16 @@ build win: extends: - .template-build-win - - .vs2019-mkl-environment + - .vs2019-environment + # oneAPI 2024 results in Stack overflow during compilation of MathLib + # - .vs2019-mkl-environment variables: CHECK_WARNINGS: "true" CMAKE_PRESET: release + # -DOGS_USE_MKL=ON CMAKE_ARGS: >- -DOGS_CI_TESTRUNNER_REPEAT=1 -DOGS_USE_PIP=ON - -DOGS_USE_MKL=ON -DOGS_USE_UNITY_BUILDS=OFF build win msvc: From 88655f621ba4cd4a52ef39d04bd712dc016f73c7 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Fri, 25 Oct 2024 15:02:17 +0200 Subject: [PATCH 06/10] [ci,win] Enable unity builds. --- scripts/ci/jobs/build-win.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci/jobs/build-win.yml b/scripts/ci/jobs/build-win.yml index 6499ecdce27..d0aaa0a72dd 100644 --- a/scripts/ci/jobs/build-win.yml +++ b/scripts/ci/jobs/build-win.yml @@ -11,7 +11,6 @@ build win: CMAKE_ARGS: >- -DOGS_CI_TESTRUNNER_REPEAT=1 -DOGS_USE_PIP=ON - -DOGS_USE_UNITY_BUILDS=OFF build win msvc: extends: From e0a8f108f86b1f75f55e5d2ab90a90e1355267af Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 29 Oct 2024 08:49:43 +0100 Subject: [PATCH 07/10] [T] Fix warnings on Windows. --- Tests/ParameterLib/Parameter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tests/ParameterLib/Parameter.cpp b/Tests/ParameterLib/Parameter.cpp index f28fb2dc415..a6821e0afa5 100644 --- a/Tests/ParameterLib/Parameter.cpp +++ b/Tests/ParameterLib/Parameter.cpp @@ -183,7 +183,10 @@ TEST_F(ParameterLibParameter, GetNodalValuesOnElement_node) // For all elements all nodes have the value of the node id. auto expected_value = [](MeshLib::Element* const e, std::size_t const local_node_id) - { return static_cast(e->getNode(local_node_id)->getID()); }; + { + return static_cast( + e->getNode(static_cast(local_node_id))->getID()); + }; ASSERT_TRUE(testNodalValuesOfElement(meshes[0]->getElements(), expected_value, *parameter, t)); @@ -246,7 +249,11 @@ TEST_F(ParameterLibParameter, GetNodalValuesOnElement_curveScaledNode) // For all elements all nodes have the value of the node id times the time. auto expected_value = [&t](MeshLib::Element* const e, std::size_t const local_node_id) - { return static_cast(e->getNode(local_node_id)->getID()) * t; }; + { + return static_cast( + e->getNode(static_cast(local_node_id))->getID()) * + t; + }; ASSERT_TRUE(testNodalValuesOfElement(meshes[0]->getElements(), expected_value, *parameter, t)); From 9755355ecf0e93710739ef9531527ec44bd252b8 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 29 Oct 2024 10:07:50 +0100 Subject: [PATCH 08/10] [ci] Renaming vs env helper script. --- scripts/ci/extends/vs2019-environment.yml | 10 +++++----- scripts/ci/extends/vs2022-environment.yml | 13 ------------- scripts/ci/jobs/build-gui-win.yml | 2 +- scripts/ci/jobs/build-wheels.yml | 2 +- scripts/ci/jobs/build-win.yml | 6 +++--- 5 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 scripts/ci/extends/vs2022-environment.yml diff --git a/scripts/ci/extends/vs2019-environment.yml b/scripts/ci/extends/vs2019-environment.yml index 6b6160282b5..fc6fbcb592a 100644 --- a/scripts/ci/extends/vs2019-environment.yml +++ b/scripts/ci/extends/vs2019-environment.yml @@ -1,4 +1,4 @@ -.load_vs2019_env: &load_vs2019_env +.load_vs_env: &load_vs_env - | pushd $env:VS170COMNTOOLS cmd /c "VsDevCmd.bat -arch=amd64 -host_arch=amd64&set" | @@ -10,13 +10,13 @@ popd Write-Host "`nVisual Studio Command Prompt variables set." -ForegroundColor Yellow -.vs2019-environment: +.vs-environment: before_script: - - *load_vs2019_env + - *load_vs_env -.vs2019-mkl-environment: +.vs-mkl-environment: before_script: - - *load_vs2019_env + - *load_vs_env # Load MKL environment - '& "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"' - $env:PATH += ";C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler" diff --git a/scripts/ci/extends/vs2022-environment.yml b/scripts/ci/extends/vs2022-environment.yml deleted file mode 100644 index f40f09c80cd..00000000000 --- a/scripts/ci/extends/vs2022-environment.yml +++ /dev/null @@ -1,13 +0,0 @@ -.vs2022-environment: - before_script: - # Load VS environment - - | - pushd $env:VS170COMNTOOLS - cmd /c "VsDevCmd.bat -arch=amd64 -host_arch=amd64&set" | - foreach { - if ($_ -match "=") { - $v = $_.split("=", 2); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" - } - } - popd - Write-Host "`nVisual Studio Command Prompt variables set." -ForegroundColor Yellow diff --git a/scripts/ci/jobs/build-gui-win.yml b/scripts/ci/jobs/build-gui-win.yml index 5a8e2b4ded0..014297cc2a9 100644 --- a/scripts/ci/jobs/build-gui-win.yml +++ b/scripts/ci/jobs/build-gui-win.yml @@ -1,7 +1,7 @@ build gui win: extends: - .template-build-win - - .vs2019-environment + - .vs-environment rules: - if: '$CI_COMMIT_BRANCH == "master"' variables: diff --git a/scripts/ci/jobs/build-wheels.yml b/scripts/ci/jobs/build-wheels.yml index 59f5e700edc..9b8f7de0523 100644 --- a/scripts/ci/jobs/build-wheels.yml +++ b/scripts/ci/jobs/build-wheels.yml @@ -58,7 +58,7 @@ build wheels mac: build wheels win: tags: [windows] extends: - - .vs2019-environment + - .vs-environment variables: SKBUILD_BUILD_OPTIONS: "/m" # TODO not supported yet in scikit-build-core <<: *wheels_template diff --git a/scripts/ci/jobs/build-win.yml b/scripts/ci/jobs/build-win.yml index d0aaa0a72dd..dc7ff5a7828 100644 --- a/scripts/ci/jobs/build-win.yml +++ b/scripts/ci/jobs/build-win.yml @@ -1,9 +1,9 @@ build win: extends: - .template-build-win - - .vs2019-environment + - .vs-environment # oneAPI 2024 results in Stack overflow during compilation of MathLib - # - .vs2019-mkl-environment + # - .vs-mkl-environment variables: CHECK_WARNINGS: "true" CMAKE_PRESET: release @@ -15,7 +15,7 @@ build win: build win msvc: extends: - .template-build-win - - .vs2019-environment + - .vs-environment rules: - if: '$CI_COMMIT_BRANCH == "master"' - if: $CI_COMMIT_BRANCH =~ /^v[0-9]\.[0-9]\.[0-9]/ From 7733328e119ff3ee9e923baf99a174a220443150 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 29 Oct 2024 10:08:34 +0100 Subject: [PATCH 09/10] [ci] Use uvx for running cibuildwheel. New Windows machine has uv-only installed (no pipx). --- scripts/ci/jobs/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/jobs/build-wheels.yml b/scripts/ci/jobs/build-wheels.yml index 9b8f7de0523..8617cc2d384 100644 --- a/scripts/ci/jobs/build-wheels.yml +++ b/scripts/ci/jobs/build-wheels.yml @@ -30,7 +30,7 @@ include: .wheels_template: &wheels_template stage: build script: - - pipx run cibuildwheel + - uvx cibuildwheel rules: - if: $CI_MERGE_REQUEST_LABELS =~ /.*ci::wheels only.*/ variables: From e9509b59265f484bdc97b0141349333f1929be13 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 29 Oct 2024 10:38:53 +0100 Subject: [PATCH 10/10] [wheel] Use MSVC 2022. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 113abb2a11c..4a0a95cc084 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ readme = "README.md" license = { file = "LICENSE.txt" } authors = [{ email = "info@opengeosys.org" }, { name = "OpenGeoSys Community" }] requires-python = ">=3.9" -dependencies = [ "pandas" ] +dependencies = ["pandas"] [project.urls] homepage = "https://opengeosys.org" @@ -80,7 +80,7 @@ environment-pass = [ "cmake.define.OGS_USE_MFRONT" = "OFF" # Generator needs to be set here, CMAKE_GENERATOR env var does not work. # Ninja generator does not select the host64 compiler. -"cmake.args" = "-G;Visual Studio 16 2019;--preset;wheel" +"cmake.args" = "-G;Visual Studio 17 2022;--preset;wheel" [tool.ruff] include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]