-
-
Notifications
You must be signed in to change notification settings - Fork 181
116 lines (102 loc) · 3.75 KB
/
macos.yml
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
name: macOS build
on:
pull_request:
branches:
- main
push:
branches:
- "main"
tags:
- "v*"
merge_group:
branches:
- main
workflow_dispatch:
jobs:
mac-os-build:
name: macOS Homebrew install and test
runs-on: macos-14
env:
PETSC_ARCH: arch-darwin-c-opt
PETSC_DIR: ${{ github.workspace }}/petsc
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Homebrew dependencies
run: |
brew install adios2 boost cmake hdf5-mpi make ninja open-mpi pkg-config pugixml spdlog # FEniCS
brew install bison flex gfortran # PETSc
- name: Install Python dependencies (petsc4py)
run: |
python -m pip install mpi4py numpy
python -m pip install cython setuptools wheel
- name: Install minimal PETSc and petsc4py
run: |
export PATH="$(brew --prefix gfortran)/bin:$(brew --prefix bison)/bin:$PATH"
git clone -b release https://gitlab.com/petsc/petsc.git petsc
cd petsc
python ./configure \
--with-64-bit-indices=no \
--with-debugging=no \
--with-fortran-bindings=no \
--with-scalar-type=real \
--with-shared-libraries \
--with-scalar-type=real \
--download-metis \
--download-parmetis \
--download-ptscotch \
--download-scalapack \
--download-mumps \
--download-mumps-avoid-mpi-in-place
make all
cd src/binding/petsc4py
arch -arm64 python -m pip -v install --no-build-isolation --no-cache-dir .
- name: Install FEniCSx dependencies
run: |
python -m pip install git+https://github.com/FEniCS/basix.git
python -m pip install git+https://github.com/FEniCS/ufl.git
python -m pip install git+https://github.com/FEniCS/ffcx.git
- uses: actions/checkout@v4
with:
path: dolfinx
- name: Build and install DOLFINx C++ library
working-directory: dolfinx
run: |
cmake -G Ninja -B build -S cpp/
cmake --build build
sudo cmake --install build
- name: Build C++ unit tests
working-directory: dolfinx
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S cpp/test/
cmake --build build/test --parallel 3
- name: Run C++ unit tests (serial)
working-directory: dolfinx
run: |
cd build/test
ctest -V --output-on-failure -R unittests
- name: Run C++ unit tests (MPI)
working-directory: dolfinx
run: |
cd build/test
mpiexec -np 3 ctest -V --output-on-failure -R unittests
- name: Build and install DOLFINx Python interface
working-directory: dolfinx
run: |
python -m pip install -r python/build-requirements.txt
python -m pip install --check-build-dependencies --no-build-isolation 'python/[test]'
- name: Basic test
run: |
python -c "import dolfinx; from mpi4py import MPI; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
mpirun -np 2 python -c "import dolfinx; from mpi4py import MPI; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Run Python unit tests (serial)
working-directory: dolfinx
run: |
python -m pip install pytest-xdist
python3 -m pytest -n=auto --durations=50 python/test/unit/
- name: Run Python unit tests (MPI, np=3)
working-directory: dolfinx
run: |
mpirun -np 3 python3 -m pytest python/test/unit/