-
-
Notifications
You must be signed in to change notification settings - Fork 259
181 lines (159 loc) · 7.5 KB
/
Copy pathci-spack.yml
File metadata and controls
181 lines (159 loc) · 7.5 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: "CI (RHEL clone: gcc, oneAPI)"
on:
push:
branches:
- release
pull_request:
branches:
- main
tags:
- "v*"
merge_group:
branches:
- main
workflow_dispatch:
# Cancel superseded runs: a new commit on a pull request makes the
# previous run's result irrelevant. Pushes to 'main' and 'release' are
# left to finish, since they populate caches and publish artefacts.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
PYTEST_ADDOPTS: "-W error"
# Spack environment activation does not add the view's library
# directories to the runtime linker search path, so packages that are
# only present in the environment (not linked via RPATH into a
# consuming package, e.g. mesa-glu's libGLU.so.1 for gmsh) are not
# found at runtime without this.
LD_LIBRARY_PATH: /opt/view/lib:/opt/view/lib64
jobs:
ci-spack-build:
name: AlmaLinux build and test
runs-on: ubuntu-26.04
container: ghcr.io/almalinux/almalinux:10
strategy:
# One compiler failing must not cancel the other: the legs share a
# build cache, so a cancelled leg loses its diagnostics and its
# pushed binaries.
fail-fast: false
matrix:
compiler: ["gcc", "oneapi"]
steps:
- name: Install Spack requirements
run: |
dnf -y install file bzip2 ca-certificates git gzip patch python3 tar \
unzip xz zstd gcc gcc-c++ gcc-gfortran
- name: Set up Spack
uses: spack/setup-spack@16b756799ede8b28951287f89bcd3fdb32ec1ca3 # v3.0.0
with:
spack_ref: v1.2.2
# spack-packages 'develop' at 2026-08-17. Bumping re-solves the
# graph and can invalidate cached binaries; warm the cache first.
packages_ref: 1ccf95574922e2a7f7ef0351bd67758ad4634b7a
- name: Checkout DOLFINx
uses: actions/checkout@v7
with:
path: dolfinx-src
- name: Create Spack environment
run: spack env create py dolfinx-src/.github/workflows/spack-config/gh-actions-rh.yml
- name: Add dependencies to environment
run: |
spack -e py add mpi petsc+mpi+shared+mumps+superlu-dist slepc parmetis pkgconfig \
hdf5+mpi boost pugixml spdlog
spack -e py add python py-nanobind py-numpy py-mpi4py py-petsc4py py-slepc4py \
py-scikit-build-core@1+pyproject py-setuptools py-cffi
spack -e py add py-pip cmake catch2 py-pytest py-pytest-xdist ninja
spack -e py add py-gmsh ^gmsh~fltk~med~mmg+external ^opencascade~draw py-pyvista ^mesa~llvm \
py-networkx py-matplotlib py-pyamg py-numba ^llvm~clang~lldb~lld~offload~libomptarget~polly targets=x86 \
py-scipy
# gmsh's compiled library dlopens libGLU.so.1 and several X11
# libraries unconditionally at runtime (its native file-chooser
# and OpenGL-based drawing code are always built in), but the
# gmsh Spack recipe only declares depends_on("glu"/"gl") when
# +fltk is set. We build gmsh ~fltk, so Spack's dependency graph
# never gets these libraries, and none of them are RPATH-linked
# in by any package either — hence they must be added explicitly
# here and put on LD_LIBRARY_PATH (see env above) so gmsh can
# find them at runtime.
spack -e py add mesa-glu libx11 libxcursor libxft libxinerama libxrender
- if: matrix.compiler == 'oneapi'
name: Add oneAPI compilers to environment
run: spack -e py add intel-oneapi-compilers
- name: Install Spack packages
run: spack -e py install -j $(nproc) --use-buildcache auto
- name: Push packages to Spack cache and update index
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
spack debug report
spack -d -e py buildcache push --base-image ghcr.io/almalinux/almalinux:10 --allow-missing --update-index local-buildcache
if: ${{ !cancelled() }}
- name: Load FEniCS testing environment variables
run: cat dolfinx-src/.github/workflows/fenicsx-refs.env >> $GITHUB_ENV
- name: Install FEniCS Python components
run: |
spack env activate py
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
pip install git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
pip install git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }}
python -c "import basix, os, sys; sys.stdout.write(os.path.dirname(basix.__file__))"
shell: spack-bash {0}
- name: Configure and build C++
run: |
spack env activate py
cmake -Werror=dev --warn-uninitialized -G Ninja -DBUILD_TESTING=true -DCMAKE_BUILD_TYPE=Developer \
-DDOLFINX_ENABLE_PETSC=on -DDOLFINX_ENABLE_SLEPC=true \
-DDOLFINX_ENABLE_PARMETIS=true -DDOLFINX_ENABLE_SUPERLU_DIST=true -B build -S dolfinx-src/cpp/
cmake --build build
shell: spack-bash {0}
- name: Run tests without install (C++, serial and MPI np=2)
run: |
spack env activate py
cd build
ctest -V --output-on-failure -R unittests_np_1
ctest -V --output-on-failure -R unittests_np_2
shell: spack-bash {0}
- name: Install C++
run: |
spack env activate py
cmake --build build --target install
shell: spack-bash {0}
- name: Build and run C++ regression tests (serial and MPI (np=2))
run: |
spack env activate py
cmake -Werror=dev --warn-uninitialized -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/demo/ -S dolfinx-src/cpp/demo/
cmake --build build/demo
cd build/demo
ctest -V --output-on-failure -R "demo_.*_np_1"
ctest -V --output-on-failure -R "demo_.*_np_2"
shell: spack-bash {0}
- name: Build Python interface (editable install)
run: |
spack env activate py
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type=Developer --config-settings=build-dir="build" -e 'dolfinx-src/python/'
shell: spack-bash {0}
- name: Set default DOLFINx JIT options
run: |
mkdir -p ~/.config/dolfinx
echo '{ "cffi_extra_compile_args": ["-g0", "-O0" ] }' > ~/.config/dolfinx/dolfinx_jit_options.json
- name: Run demos (Python, serial and MPI)
run: |
spack env activate py
python -m pytest -n auto -m serial --durations=10 dolfinx-src/python/demo/test.py
# demo_navier-stokes.py deadlocks at np=2 in its MUMPS direct solve
# (singular-system ICNTLs); it passes in the serial run above.
# Deselected by name, not node id, whose path index follows glob order.
python -m pytest -m mpi --num-proc=2 -k "not navier-stokes" dolfinx-src/python/demo/test.py
shell: spack-bash {0}
- name: Run Python unit tests (serial and MPI)
run: |
spack env activate py
python -m pytest -n auto -m "not adios2" --durations=50 dolfinx-src/python/test/unit/
mpirun -np 2 python -m pytest -m "not adios2" dolfinx-src/python/test/unit/
shell: spack-bash {0}