Skip to content

Commit 99b4604

Browse files
authored
Fix Spack in install in CI (#4087)
* Add some debug * Test * Install blas * Small fixes * Updates * Test * Remove pyamg * Fix for pyamg * Fixes * Updates
1 parent df1d68f commit 99b4604

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.github/workflows/ci-spack.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,11 @@ jobs:
4949
repository: spack/spack-packages
5050
ref: develop
5151
path: spack-packages
52-
- name: Get FEniCS Spack packages
53-
uses: actions/checkout@v6
54-
with:
55-
repository: fenics/spack-fenics
56-
ref: main
57-
path: spack-fenics
5852

5953
- name: Add Spack packages repo
6054
run: |
6155
. $GITHUB_WORKSPACE/spack-src/share/spack/setup-env.sh
6256
spack repo add --name builtin $GITHUB_WORKSPACE/spack-packages/repos/spack_repo/builtin
63-
spack repo add --name fenics $GITHUB_WORKSPACE/spack-fenics/spack_repo/fenics
6457
spack config get repos
6558
spack repo list
6659
@@ -77,9 +70,10 @@ jobs:
7770
- name: Add dependencies to environment
7871
run: |
7972
. ./spack-src/share/spack/setup-env.sh
80-
spack -e py add mpi petsc+mpi+shared+mumps+superlu-dist slepc parmetis pkgconfig python hdf5+mpi boost pugixml spdlog
81-
spack -e py add python py-nanobind py-numpy py-mpi4py py-petsc4py py-slepc4py py-scikit-build-core+pyproject py-setuptools py-cffi
73+
spack -e py add mpi petsc+mpi+shared+mumps+superlu-dist slepc parmetis pkgconfig hdf5+mpi boost pugixml spdlog
74+
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
8275
spack -e py add py-pip cmake catch2 py-pytest py-pytest-xdist ninja
76+
spack -e py add openblas
8377
8478
- if: matrix.compiler == 'oneapi'
8579
name: Add oneAPI compilers to environment
@@ -109,8 +103,9 @@ jobs:
109103
. ./spack-src/share/spack/setup-env.sh
110104
spack env activate py
111105
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
112-
pip install -Ccmake.build-type="Developer" git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
106+
pip install -Ccmake.define.CMAKE_INSTALL_RPATH_USE_LINK_PATH=on git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
113107
pip install git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }}
108+
python -c "import basix, os, sys; sys.stdout.write(os.path.dirname(basix.__file__))"
114109
115110
- name: Configure and build C++
116111
run: |

python/demo/demo_pyamg.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import numpy as np
2929
import numpy.typing as npt
30-
import pyamg
3130

3231
import ufl
3332
from dolfinx import fem, io
@@ -42,6 +41,13 @@
4241
)
4342
from dolfinx.mesh import CellType, create_box, locate_entities_boundary
4443

44+
try:
45+
import pyamg
46+
except ImportError:
47+
print("This demo requires pyamg.")
48+
exit(0)
49+
50+
4551
if MPI.COMM_WORLD.size > 1:
4652
print("This demo works only in serial.")
4753
exit(0)

python/pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ demo = [
3434
"numba",
3535
"matplotlib",
3636
"scipy",
37-
"pyamg",
3837
"pyvista",
3938
]
4039
docs = [
@@ -50,7 +49,7 @@ docs = [
5049
"fenics-dolfinx[demo]",
5150
]
5251
lint = ["ruff>=0.2.0"]
53-
optional = ["numba", "pyamg"]
52+
optional = ["numba"]
5453
petsc4py = ["petsc4py"]
5554
test = [
5655
"matplotlib",
@@ -125,7 +124,7 @@ allowed-confusables = ["σ", "ρ"]
125124

126125
[tool.ruff.lint.isort]
127126
known-first-party = ["basix", "dolfinx", "ffcx", "ufl"]
128-
known-third-party = ["gmsh", "numba", "numpy", "pytest", "pyvista", "pyamg"]
127+
known-third-party = ["gmsh", "numba", "numpy", "pytest", "pyvista"]
129128
section-order = [
130129
"future",
131130
"standard-library",

0 commit comments

Comments
 (0)