diff --git a/CMakePresets.json b/CMakePresets.json index 931a98bed5bde5a76c0fa76d074046d7b4cc64d0..ea9a3e0a04572848ac8c9cb5685dc7460aa4158d 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}", diff --git a/GeoLib/SensorData.cpp b/GeoLib/SensorData.cpp index 984d2c4993cfc8f837fd0cf5e5211f7538464850..4dcb4124008b8566aca554961bcd6d2ef433d185 100644 --- a/GeoLib/SensorData.cpp +++ b/GeoLib/SensorData.cpp @@ -14,6 +14,7 @@ #include "SensorData.h" +#include <algorithm> #include <cstdlib> #include <fstream> diff --git a/MathLib/Curve/CreatePiecewiseLinearCurve.h b/MathLib/Curve/CreatePiecewiseLinearCurve.h index b1b7a1246904b1478341ca307c528459d5483061..a0e56943727990a56a131d9dd4e228eed7eb3b34 100644 --- a/MathLib/Curve/CreatePiecewiseLinearCurve.h +++ b/MathLib/Curve/CreatePiecewiseLinearCurve.h @@ -13,6 +13,7 @@ #pragma once #include <memory> +#include <string> #include <vector> namespace BaseLib diff --git a/Tests/ParameterLib/Parameter.cpp b/Tests/ParameterLib/Parameter.cpp index f28fb2dc41529e73a0b9858b56100ae91e9d4e32..a6821e0afa52aff8abc5c8c43a489dbc53c2c805 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<double>(e->getNode(local_node_id)->getID()); }; + { + return static_cast<double>( + e->getNode(static_cast<unsigned>(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<double>(e->getNode(local_node_id)->getID()) * t; }; + { + return static_cast<double>( + e->getNode(static_cast<unsigned>(local_node_id))->getID()) * + t; + }; ASSERT_TRUE(testNodalValuesOfElement(meshes[0]->getElements(), expected_value, *parameter, t)); diff --git a/pyproject.toml b/pyproject.toml index 113abb2a11c0c7dd47ae36e8dc57e13d84ee880f..4a0a95cc0843399e7c857e6742e067187c6b02ee 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"] diff --git a/scripts/ci/extends/vs2019-environment.yml b/scripts/ci/extends/vs2019-environment.yml index fdcda29d0e70401eedf1ce88982bc916c867645b..fc6fbcb592a8300dc095fa55fedb0e611e730066 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 +.load_vs_env: &load_vs_env - | - pushd $env:VS160COMNTOOLS + pushd $env:VS170COMNTOOLS cmd /c "VsDevCmd.bat -arch=amd64 -host_arch=amd64&set" | foreach { if ($_ -match "=") { @@ -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 f40f09c80cdb85de5686782ab77d3579dc34d4e2..0000000000000000000000000000000000000000 --- 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 5a8e2b4ded0a46a8e0e970869f65bff204b034b5..014297cc2a92ed6bb97ddbfb1e7990f0a6081a82 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 305cdb5af376152300e92a578c4cbcf7e98a882e..8617cc2d384a810a77524ef9749af349459bf209 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: @@ -55,17 +55,17 @@ 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 + - .vs-environment variables: SKBUILD_BUILD_OPTIONS: "/m" # TODO not supported yet in scikit-build-core <<: *wheels_template 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/jobs/build-win.yml b/scripts/ci/jobs/build-win.yml index f84ade6b177bdda1a56d3644bf56117a4441cd45..dc7ff5a782841efebc07aece3725c3a813a126de 100644 --- a/scripts/ci/jobs/build-win.yml +++ b/scripts/ci/jobs/build-win.yml @@ -1,20 +1,21 @@ build win: extends: - .template-build-win - - .vs2019-mkl-environment + - .vs-environment + # oneAPI 2024 results in Stack overflow during compilation of MathLib + # - .vs-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: 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]/ diff --git a/scripts/ci/pipelines/regular.yml b/scripts/ci/pipelines/regular.yml index c3e359b0309a7978faade81399b3472ef4c70dbd..8fdc940da96c71533eb7fc24f298b62d16a13acf 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" diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 4af819824d8742fcbacd53e4300a18fb65d4ed2f..0a55707966405a340031355aa9cc43aeaded796a 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"