Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fix Windows CI #3517

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 27 additions & 31 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Windows build

on:
# push:
# branches:
# - main
push:
branches:
- "**"
# tags:
# - "v*"
# pull_request:
Expand Down Expand Up @@ -46,28 +46,29 @@ jobs:
- name: Insert add_dll_directory calls into Basix
working-directory: basix/python/basix
run: |
(Get-Content __init__.py).Replace('# WINDOWSDLL', 'import os; os.add_dll_directory("D:/a/dolfinx/basix-install/bin")') | Set-Content __init__.py
(Get-Content __init__.py).Replace('# WINDOWSDLL', 'import os; os.add_dll_directory("${{ github.workspace }}/basix-install/bin")') | Set-Content __init__.py
Get-Content __init__.py

- name: Set up CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.30.0"

- name: Install Basix (C++)
working-directory: basix
working-directory: basix/cpp
run: |
cd cpp
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -B build-dir -S .
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -B build-dir -S .
cmake --build build-dir --config Release
cmake --install build-dir --config Release --prefix D:/a/dolfinx/basix-install
cmake --install build-dir --config Release --prefix "$env:GITHUB_WORKSPACE/basix-install"
echo "D:/a/dolfinx/basix-install/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Install build dependencies (workaround)
run: |
python -m pip install git+https://github.com/jhale/nanobind.git@jhale/msvc2022-workaround
python -m pip install scikit-build-core[pyproject] setuptools wheel
python -m pip install scikit-build-core[pyproject] setuptools wheel nanobind
- name: Install Basix (Python)
working-directory: basix
working-directory: basix/python
run: |
cd python
python -m pip -v install --check-build-dependencies --no-build-isolation --no-cache-dir .[ci] --config-settings=cmake.args=-DBasix_DIR=D:/a/basix/install/lib/cmake/basix
cd ../
python -m pip -v install --check-build-dependencies --no-build-isolation --no-cache-dir .[ci] --config-settings=cmake.args=-DBasix_DIR="$env:GITHUB_WORKSPACE/basix-install/lib/cmake/basix"

- name: Checkout FFCx
uses: actions/checkout@v4
Expand All @@ -80,7 +81,7 @@ jobs:
run: |
cmake -B build-dir -S cmake/
cmake --build build-dir --config Release
cmake --install build-dir --config Release --prefix D:/a/dolfinx/ufcx-install
cmake --install build-dir --config Release --prefix "$env:GITHUB_WORKSPACE/ufcx-install"

- name: Install FFCx
working-directory: ffcx
Expand All @@ -95,48 +96,45 @@ jobs:
- name: Insert add_dll_directory calls into DOLFINx
working-directory: dolfinx/python/dolfinx
run: |
(Get-Content __init__.py).Replace('# WINDOWSDLL', 'import os; os.add_dll_directory("D:/a/dolfinx/dolfinx-install/bin"); os.add_dll_directory("C:/Program Files (x86)/Intel/oneAPI/mpi/2021.12/opt/mpi/libfabric/bin")') | Set-Content __init__.py
(Get-Content __init__.py).Replace('# WINDOWSDLL', 'import os; os.add_dll_directory("${{ github.workspace }}/dolfinx-install/bin"); os.add_dll_directory("C:/Program Files (x86)/Intel/oneAPI/mpi/2021.12/opt/mpi/libfabric/bin")') | Set-Content __init__.py
Get-Content __init__.py

- uses: mpi4py/[email protected].7
- uses: mpi4py/[email protected].2
with:
mpi: "intelmpi"

- name: Install DOLFINx (C++)
working-directory: dolfinx
run: |
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DDOLFINX_BASIX_PYTHON=OFF -DBasix_DIR=D:/a/dolfinx/basix-install/share/basix -DDOLFINX_UFCX_PYTHON=OFF -Dufcx_DIR=D:/a/dolfinx/ufcx-install/share/ufcx/cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_OVERLAY_PORTS="cpp/.vcpkg-overlay" -B build-dir -S cpp
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DDOLFINX_BASIX_PYTHON=OFF -DBasix_DIR="$env:GITHUB_WORKSPACE/basix-install/lib/cmake/basix" -DDOLFINX_UFCX_PYTHON=OFF -Dufcx_DIR="$env:GITHUB_WORKSPACE/ufcx-install/share/ufcx/cmake" -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_OVERLAY_PORTS="cpp/.vcpkg-overlay" -B build-dir -S cpp
cmake --build build-dir --config Release
cmake --install build-dir --config Release --prefix D:/a/dolfinx/dolfinx-install
echo "D:/a/dolfinx/dolfinx-install/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build unit tests (C++)
working-directory: dolfinx
run: |
cmake -DBasix_DIR=D:/a/dolfinx/basix-install/share/basix -Dufcx_DIR=D:/a/dolfinx/ufcx-install/share/ufcx/cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_OVERLAY_PORTS="cpp/.vcpkg-overlay" -B build/test/ -S cpp/test/
cmake -DBasix_DIR=D:/a/dolfinx/basix-install/share/basix -Dufcx_DIR="$env:GITHUB_WORKSPACE/ufcx-install/share/ufcx/cmake" -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -B build/test/ -S cpp/test/
cmake --build build/test --config Release --parallel 3

- name: Run unit tests (C++, MPI, np=1)
working-directory: dolfinx
working-directory: dolfinx/build/test
run: |
cd build/test
mpiexec -n 1 ctest -V --output-on-failure -R unittests
- name: Run C++ tests (C++, MPI, np=3)
working-directory: dolfinx
working-directory: dolfinx/build/test
run: |
cd build/test
mpiexec -n 3 ctest -V --output-on-failure -R unittests

- name: Install build dependencies
working-directory: dolfinx
run: |
pip -v install --no-binary mpi4py -r python/build-requirements.txt
pip -v install --no-binary mpi4py -r "mpi4py<4"

- name: Install DOLFINx (Python)
working-directory: dolfinx
working-directory: dolfinx/python
run: |
cd python
pip -v install --check-build-dependencies --no-build-isolation .[test] --config-settings=cmake.args=-DBasix_DIR=D:/a/dolfinx/basix-install/lib/cmake/basix --config-settings=cmake.args=-Dufcx_DIR=D:/a/dolfinx/ufcx-install/share/ufcx/cmake --config-settings=cmake.args=-DDOLFINX_DIR=D:/a/dolfinx/dolfinx-install/lib/cmake/dolfinx --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake --config-settings=cmake.args=-DVCPKG_OVERLAY_PORTS="../cpp/.vcpkg-overlay"
pip -v install --check-build-dependencies --no-build-isolation .[test] --config-settings=cmake.args=-DBasix_DIR="$env:GITHUB_WORKSPACE/basix-install/lib/cmake/basix" --config-settings=cmake.args=-Dufcx_DIR="$env:GITHUB_WORKSPACE/ufcx-install/share/ufcx/cmake" --config-settings=cmake.args=-DDOLFINX_DIR="$env:GITHUB_WORKSPACE/dolfinx-install/lib/cmake/dolfinx" --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"

- name: Run units tests (Python, serial)
working-directory: dolfinx
Expand All @@ -149,12 +147,10 @@ jobs:
mpiexec -n 3 python -m pytest -m "not petsc4py and not adios2" python/test/unit

- name: Run Python demos (serial)
working-directory: dolfinx
working-directory: dolfinx/python/demo
run: |
cd python/demo
python3 -m pytest -n auto -m serial --durations=10 test.py
- name: Run Python demos (MPI, np=3)
working-directory: dolfinx
working-directory: dolfinx/python/demo
run: |
cd python/demo
python3 -m pytest -m mpi --num-proc=3 test.py
38 changes: 13 additions & 25 deletions cpp/dolfinx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,39 +152,27 @@ endif()

# ------------------------------------------------------------------------------
# Install dolfinx library and header files
if(WIN32)
install(
install(
TARGETS dolfinx
EXPORT DOLFINXTargets
RUNTIME_DEPENDENCY_SET dependencies
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeExecutables
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
)
)

if(INSTALL_RUNTIME_DEPENDENCIES)
list(APPEND PRE_EXCLUDE_REGEXES "api-ms-.*")
list(APPEND PRE_EXCLUDE_REGEXES "ext-ms-.*")
install(
RUNTIME_DEPENDENCY_SET
dependencies
DESTINATION
${CMAKE_INSTALL_BINDIR}
PRE_EXCLUDE_REGEXES
${PRE_EXCLUDE_REGEXES}
POST_EXCLUDE_REGEXES
".*system32/.*\\.dll"
DIRECTORIES
$<TARGET_FILE_DIR:Basix::basix>
)
endif()
else()
if(INSTALL_RUNTIME_DEPENDENCIES AND WIN32)
install(
TARGETS dolfinx
EXPORT DOLFINXTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeExecutables
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
RUNTIME_DEPENDENCY_SET
dependencies
DESTINATION
${CMAKE_INSTALL_BINDIR}
PRE_EXCLUDE_REGEXES
[[api-ms-win-.*]] [[ext-ms-.*]]
POST_EXCLUDE_REGEXES
[[.*(\\|/)system32(\\|/).*\.dll]]
DIRECTORIES
$<TARGET_FILE_DIR:Basix::basix>
)
endif()

Expand Down
8 changes: 4 additions & 4 deletions cpp/dolfinx/graph/ordering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ gps_reorder_unlabelled(const graph::AdjacencyList<std::int32_t>& graph,
std::vector<std::array<int, 2>> lvp(n);
for (int i = 0; i < k; ++i)
{
for (int w : lv.links(i))
lvp[w][0] = i;
for (int w : lu.links(i))
lvp[w][1] = k - 1 - i;
for (std::size_t w : lv.links(i))
(lvp[w])[0] = i;
for (std::size_t w : lu.links(i))
(lvp[w])[1] = k - 1 - i;
}

assert(lvp[v][0] == 0 and lvp[v][1] == 0);
Expand Down
Loading