-
-
Notifications
You must be signed in to change notification settings - Fork 234
141 lines (123 loc) · 5.24 KB
/
macos.yml
File metadata and controls
141 lines (123 loc) · 5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: CI (macOS)
on:
pull_request:
branches:
- main
push:
branches:
- release
tags:
- "v*"
merge_group:
branches:
- main
workflow_dispatch:
jobs:
mac-os-build:
name: macOS Homebrew install and test
runs-on: macos-26
env:
PETSC_ARCH: arch-darwin-c-opt
PETSC_DIR: ${{ github.workspace }}/petsc
PETSC_VERSION: 3.24.4
PYTEST_ADDOPTS: "-W error"
steps:
- uses: actions/checkout@v6
- name: Load environment variables
run: |
cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV
echo DYLD_LIBRARY_PATH=/usr/local/lib >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v6
id: cp3
with:
python-version: "3.14"
- name: Install Homebrew dependencies
run: |
brew install adios2 boost catch2 hdf5-mpi make ninja open-mpi pkgconf pugixml spdlog # FEniCS
brew install bison flex gfortran scalapack scotch # PETSc
- name: Install Python dependencies (petsc4py)
run: |
pip install cython setuptools==80 wheel
pip install mpi4py numpy
- name: Restore cache PETSc and petsc4py
id: cache-petsc-restore
uses: actions/cache/restore@v5
with:
path: |
${{ env.PETSC_DIR }}
~/Library/Python/
key: ${{ runner.os }}-petsc-${{ env.PETSC_VERSION }}-${{ steps.cp3.outputs.python-version }}
- name: Install minimal PETSc and petsc4py
if: steps.cache-petsc-restore.outputs.cache-hit != 'true'
run: |
export PATH="$(brew --prefix gfortran)/bin:$(brew --prefix bison)/bin:$PATH"
export PATH="$(brew --prefix make)/libexec/gnubin:$PATH"
git clone --depth 1 --branch v${PETSC_VERSION} https://gitlab.com/petsc/petsc.git petsc
cd petsc
./configure \
--with-64-bit-indices=no \
--with-debugging=no \
--with-fortran-bindings=no \
--with-scalar-type=real \
--with-shared-libraries \
--with-scalar-type=real \
--with-ptscotch-dir=$(brew --prefix scotch) \
--with-scalapack-dir=$(brew --prefix scalapack) \
--download-metis \
--download-mumps \
--download-mumps-avoid-mpi-in-place \
--download-parmetis \
--download-superlu_dist
make all
cd src/binding/petsc4py
arch -arm64 pip -v install --user --no-build-isolation .
- name: Save cache PETSc and petsc4py
id: cache-petsc-save
uses: actions/cache/save@v5
with:
path: |
${{ env.PETSC_DIR }}
~/Library/Python/
key: ${{ steps.cache-petsc-restore.outputs.cache-primary-key }}
- name: Install FEniCSx dependencies
run: |
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
pip install --config-settings=cmake.build-type="Developer" git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
pip install git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }}
- name: Configure (C++)
working-directory: cpp
run: >
cmake -B build -S . -Werror=dev --warn-uninitialized -G Ninja \
-DCMAKE_BUILD_TYPE=Developer -DBUILD_TESTING=true \
-DDOLFINX_ENABLE_SCOTCH=true -DDOLFINX_ENABLE_PARMETIS=true \
-DDOLFINX_ENABLE_PETSC=true -DDOLFINX_ENABLE_SUPERLU_DIST=true
- name: Build and install (C++)
working-directory: cpp/build
run: |
cmake --build .
sudo cmake --install .
- name: Run tests (C++)
working-directory: cpp/build
run: |
ctest -V --output-on-failure -R unittests_np_1
ctest -V --output-on-failure -R unittests_np_3
- name: Build and install DOLFINx Python interface
working-directory: python
run: |
pip install pyamg pybind11>=2.8.0 setuptools_scm[toml]==8.3.0
pip install scikit-build-core
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Developer" './[test]'
- name: Basic test
run: |
mpiexec -np 1 python -c "from mpi4py import MPI; import dolfinx; assert dolfinx.has_parmetis and dolfinx.has_petsc and dolfinx.has_superlu_dist and dolfinx.has_ptscotch"
mpiexec -np 1 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
mpiexec -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Run tests (Python)
run: |
pip install pytest-xdist
mkdir -p ~/.config/dolfinx
echo '{ "cffi_extra_compile_args": ["-g0", "-O0" ] }' > ~/.config/dolfinx/dolfinx_jit_options.json
mpiexec -np 1 python -m pytest -n=auto --durations=50 python/test/unit/
mpiexec -np 3 python -m pytest python/test/unit/