-
-
Notifications
You must be signed in to change notification settings - Fork 234
173 lines (150 loc) · 6.43 KB
/
ci-spack.yml
File metadata and controls
173 lines (150 loc) · 6.43 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
name: "CI (RHEL clone: gcc, oneAPI)"
on:
push:
branches:
- release
pull_request:
branches:
- main
tags:
- "v*"
merge_group:
branches:
- main
workflow_dispatch:
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"
jobs:
ci-spack-build:
name: AlmaLinux build and test
runs-on: ubuntu-latest
container: ghcr.io/almalinux/almalinux:10
strategy:
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: Get Spack
uses: actions/checkout@v6
with:
repository: spack/spack
ref: develop
path: spack-src
- name: Get upstream Spack packages
uses: actions/checkout@v6
with:
repository: spack/spack-packages
ref: develop
path: spack-packages
- name: Add Spack packages repo
run: |
. $GITHUB_WORKSPACE/spack-src/share/spack/setup-env.sh
spack repo add --name builtin $GITHUB_WORKSPACE/spack-packages/repos/spack_repo/builtin
spack config get repos
spack repo list
- name: Checkout DOLFINx
uses: actions/checkout@v6
with:
path: dolfinx-src
- name: Create Spack environment
run: |
. ./spack-src/share/spack/setup-env.sh
spack env create py dolfinx-src/.github/workflows/spack-config/gh-actions-rh.yml
- name: Add dependencies to environment
run: |
. ./spack-src/share/spack/setup-env.sh
spack -e py add mpi petsc+mpi+shared+mumps+superlu-dist slepc parmetis pkgconfig hdf5+mpi boost pugixml spdlog
spack -e py add python@3.14 py-nanobind py-numpy py-mpi4py py-petsc4py py-slepc4py py-scikit-build-core+pyproject py-setuptools py-cffi
spack -e py add py-pip cmake catch2 py-pytest py-pytest-xdist ninja
spack -e py add openblas
- if: matrix.compiler == 'oneapi'
name: Add oneAPI compilers to environment
run: |
. ./spack-src/share/spack/setup-env.sh
spack -e py add intel-oneapi-compilers
- name: Install Spack packages
run: |
. ./spack-src/share/spack/setup-env.sh
spack -e py install -j4 -p2 --use-buildcache auto
- name: Push packages to Spack cache and update index
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
. ./spack-src/share/spack/setup-env.sh
spack -e py buildcache push --base-image ghcr.io/almalinux/almalinux:10 --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-src/share/spack/setup-env.sh
spack env activate py
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
pip install -Ccmake.define.CMAKE_INSTALL_RPATH_USE_LINK_PATH=on 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__))"
- name: Configure and build C++
run: |
. ./spack-src/share/spack/setup-env.sh
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
- name: Run tests without install (C++, serial and MPI np=2)
run: |
. ./spack-src/share/spack/setup-env.sh
spack env activate py
cd build
ctest -V --output-on-failure -R unittests_np_1
ctest -V --output-on-failure -R unittests_np_2
- name: Install C++
run: |
. ./spack-src/share/spack/setup-env.sh
spack env activate py
cmake --build build --target install
- name: Build and run C++ regression tests (serial and MPI (np=2))
run: |
. ./spack-src/share/spack/setup-env.sh
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 -R demo -R serial
ctest -V -R demo -R mpi_2
- name: Install gmsh and pyvista (and via package manager install dependencies)
run: |
dnf install -y mesa-libGLU libX11 libXrender mesa-libEGL libglvnd-glx libXcursor libXft libXinerama
. ./spack-src/share/spack/setup-env.sh
spack env activate py
pip install gmsh pyvista
- name: Build Python interface (editable install)
run: |
. ./spack-src/share/spack/setup-env.sh
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/[test]'
- 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-src/share/spack/setup-env.sh
spack env activate py
python -m pytest -n auto -m serial --durations=10 dolfinx-src/python/demo/test.py
python -m pytest -m mpi --num-proc=2 dolfinx-src/python/demo/test.py
- name: Run Python unit tests (serial and MPI)
run: |
. ./spack-src/share/spack/setup-env.sh
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/