Skip to content

Commit

Permalink
Merge branch 'enable-win' into 'master'
Browse files Browse the repository at this point in the history
[ci] Re-enable win

See merge request ogs/ogs!5143
  • Loading branch information
bilke committed Oct 29, 2024
2 parents f924b75 + e9509b5 commit fcef847
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{
"name": "_msvc",
"hidden": true,
"generator": "Visual Studio 16 2019",
"generator": "Visual Studio 17 2022",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
Expand Down
1 change: 1 addition & 0 deletions GeoLib/SensorData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "SensorData.h"

#include <algorithm>
#include <cstdlib>
#include <fstream>

Expand Down
1 change: 1 addition & 0 deletions MathLib/Curve/CreatePiecewiseLinearCurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#pragma once

#include <memory>
#include <string>
#include <vector>

namespace BaseLib
Expand Down
11 changes: 9 additions & 2 deletions Tests/ParameterLib/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
license = { file = "LICENSE.txt" }
authors = [{ email = "[email protected]" }, { name = "OpenGeoSys Community" }]
requires-python = ">=3.9"
dependencies = [ "pandas" ]
dependencies = ["pandas"]

[project.urls]
homepage = "https://opengeosys.org"
Expand Down Expand Up @@ -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"]
Expand Down
12 changes: 6 additions & 6 deletions scripts/ci/extends/vs2019-environment.yml
Original file line number Diff line number Diff line change
@@ -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 "=") {
Expand All @@ -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"
13 changes: 0 additions & 13 deletions scripts/ci/extends/vs2022-environment.yml

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/ci/jobs/build-gui-win.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build gui win:
extends:
- .template-build-win
- .vs2019-environment
- .vs-environment
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
variables:
Expand Down
8 changes: 4 additions & 4 deletions scripts/ci/jobs/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions scripts/ci/jobs/build-win.yml
Original file line number Diff line number Diff line change
@@ -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]/
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/pipelines/regular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions scripts/cmake/Find.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fcef847

Please sign in to comment.