Skip to content
Snippets Groups Projects
Unverified Commit 2fb0d64e authored by Lars Bilke's avatar Lars Bilke
Browse files

[py] .envrc.ps1 for Windows.

parent 2a23de40
No related branches found
No related tags found
No related merge requests found
......@@ -234,19 +234,30 @@ if(OGS_WRITE_BENCHMARK_COMMANDS)
endif()
# cmake-lint: disable=E1126
set(_envrc_content
"[ -d \"${PROJECT_BINARY_DIR}/.venv\" ] && source ${PROJECT_BINARY_DIR}/.venv/bin/activate"
"export PATH=$PATH:${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}"
"export OGS_USE_PATH=1"
"export PYTHONPATH=${PROJECT_BINARY_DIR}/site-packages:$PYTHONPATH"
)
if(TFEL_WITH_PYTHON)
set(_envrc_content "${_envrc_content}"
"export PYTHONPATH=${TFEL_WITH_PYTHON}:$PYTHONPATH"
if(WIN32)
set(_envrc_file_ending ".ps1")
set(_envrc_content
"$Env:PYTHONPATH += \";${PROJECT_BINARY_DIR}/site-packages\""
"$Env:PATH += \";${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}\""
"$Env:PATH += \";C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler\""
"$Env:OGS_USE_PATH = \"1\""
)
string(REPLACE ";$" "\n$" _envrc_content "${_envrc_content}")
else()
set(_envrc_content
"[ -d \"${PROJECT_BINARY_DIR}/.venv\" ] && source ${PROJECT_BINARY_DIR}/.venv/bin/activate"
"export PATH=$PATH:${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}"
"export OGS_USE_PATH=1"
"export PYTHONPATH=${PROJECT_BINARY_DIR}/site-packages:$PYTHONPATH"
)
if(TFEL_WITH_PYTHON)
set(_envrc_content "${_envrc_content}"
"export PYTHONPATH=${TFEL_WITH_PYTHON}:$PYTHONPATH"
)
endif()
string(REPLACE ";" "\n" _envrc_content "${_envrc_content}")
endif()
string(REPLACE ";" "\n" _envrc_content "${_envrc_content}")
file(CONFIGURE OUTPUT .envrc CONTENT "${_envrc_content}")
file(CONFIGURE OUTPUT .envrc${_envrc_file_ending} CONTENT "${_envrc_content}")
check_header_compilation()
......
import os
import platform
import sys
import tempfile
from pathlib import Path
import numpy as np
import ogs.mesh as mesh # noqa: F401
import ogs
import pytest
......@@ -81,6 +82,14 @@ def checkCells(cells, celltypes, points):
@pytest.mark.skipif("OGS_USE_PATH" in os.environ, reason="Works in wheel only.")
def test_simulator():
if platform.system() == "Windows" and ogs.OGS_USE_MKL == "ON":
os.add_dll_directory(
Path(
"C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler"
)
)
import ogs.mesh as mesh # noqa: F401
from ogs import simulator
current_dir = Path(__file__).parent.resolve()
......
......@@ -12,7 +12,7 @@
- $log_file = $build_directory_full + "\make.txt"
- (rm -r -fo $build_directory_full)
- cmd /c if not exist $build_directory_full mkdir $build_directory_full
- mkdir build # We are inside the OGS source directory, now. This "build" dir will be, too.
- mkdir build # We are inside the OGS source directory, now. This "build" dir will be, too.
# Create symlink https://stackoverflow.com/a/34905638/80480
- cmd /c mklink /D $artifacts_dir $env:CI_PROJECT_DIR\$build_directory_full
- $cmake_cmd = "cmake --preset=$env:CMAKE_PRESET --log-level=VERBOSE -Wno-dev $env:CMAKE_ARGS"
......@@ -23,6 +23,7 @@
if (Test-Path $build_directory_full\.venv\Scripts\Activate.ps1) {
Invoke-Expression $build_directory_full\.venv\Scripts\Activate.ps1
}
- Invoke-Expression $build_directory_full\.envrc.ps1
- cmake --build --preset=$env:CMAKE_PRESET --target package | Tee-Object -FilePath $log_file
- if($env:BUILD_TESTS -eq "true") { cmake --build --preset=$env:CMAKE_PRESET --target tests }
- $ctest_group = "Experimental"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment