Spack Installation Issue for FEniCSx 0.9.0 (py-fenics-basix): CMake Version Mismatch

Dear all,

I am attempting to install FEniCSx@0.9.0 on an HPC system using Spack. I’m running into a consistent issue during the installation of py-fenics-basix where the build process seems to ignore the Spack-managed or external CMake version and fall back to an older system version.

I am struggling with the installation on an HPC using Spack v1.1.0.dev0. Whichever external compiler I load (gcc@11.2.0 or gcc@13.2.0) alongside an external cmake@3.27.6, I consistently encounter the following error:

Installation Failure Log

==> Installing py-nanobind-2.8.0-mgaloxvosujk5lkk6fu2oye3caipveem [110/113]
==> No binary for py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt found: installing from source
# ... (intermediate lines) ...
==> Error: ProcessError: Command exited with status 1:
    '/gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/python-venv-1.0-o7bao2deumk7rspdwiqqtmki6n63p4zk/bin/python3' '-m' 'pip' '-vvv' 'install' '--no-deps' ... '.'
See build log for details:
  /tmp/SLURM_JOB_17394454/tlavigne002/spack-stage/spack-stage-py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt/spack-build-out.txt
# ... (subsequent packages fail) ...
==> Error: py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt: ProcessError: Command exited with status 1:
# ... (command repeated) ...

Critical Error from spack-build-out.txt

The core issue appears to be a CMake version requirement mismatch within the py-fenics-basix build process (which uses scikit-build-core using CMake 3.20.2 and pip):

Created temporary directory: /tmp/SLURM_JOB_17394454/pip-unpack-4uul2_z0
Building wheels for collected packages: fenics-basix
  Created temporary directory: /tmp/SLURM_JOB_17394454/pip-wheel-9osd2jrg
  Destination directory: /tmp/SLURM_JOB_17394454/pip-wheel-9osd2jrg
  Building wheel for fenics-basix (pyproject.toml): started
  Running command Building wheel for fenics-basix (pyproject.toml)
  *** scikit-build-core 0.11.5 using CMake 3.20.2 (wheel)
  *** Configuring CMake...
  loading initial cache file /tmp/SLURM_JOB_17394454/tmp6uob3xca/build/CMakeInit.txt
  CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
    CMake 3.21 or higher is required.  You are running version 3.20.2


  -- Configuring incomplete, errors occurred!

  *** CMake configuration failed
  error: subprocess-exited-with-error

  × Building wheel for fenics-basix (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.

Spack Configuration & Debugging Steps

Despite the error, Spack has correctly detected and concretized a sufficient CMake version:

  • Spack External Packages (spack find -c):
    – linux-rocky8-x86_64 / no compilers ---------------------------
    [e]  cmake@3.27.6  [e]  gcc@13.2.0  [e]  glibc@2.28  [e]  openmpi@5.0.2
    
  • Concretized Spec (spack spec py-fenics-basix):
    The spec correctly shows the dependency on the external CMake:
    -   py-fenics-basix@0.9.0 ...
    [e]       ^cmake@3.27.6 ...
    

What I have tried so far:

  1. Forcing a newer CMake: I tried building an internal Spack cmake@3.31.9, but the installation still failed with the same error, indicating a fallback to the system version.
  2. Explicit Dependency: I explicitly tried to force the dependency in spack.yaml: py-fenics-basix@0.9.0 ^cmake@3.27.6. As shown above, Spack correctly concretizes this, but the error persists during the pip install phase.

Hypothesis and Request for Help

It appears that when pip executes the build command for py-fenics-basix, the Spack-managed environment variables (which should point to the $SPACK_ROOT/opt/.../cmake/bin/cmake path) are not correctly propagating to the underlying build system (likely due to the interaction between Spack’s environment setup, the Python virtual environment, and scikit-build-core). It looks like it is falling back to a pre-existing /usr/bin/cmake (version 3.20.2).

This issue seems similar to the problems discussed in the older post but I have not succeeded to correct my install process based on it, since I am not very used to spack:

Similarly to Installing v0.9.0 via spack on HPC, I have the following spack debug report:

* **Spack:** 1.1.0.dev0 (https://github.com/spack/spack/commit/b1ed39ae38e8c6939eeb7bdf3f2920984445975b)
* **Builtin repo:** https://github.com/spack/spack-packages/commit/d434948b26119179058e2cb2749b32b36eb4247b
* **Python:** 3.6.8
* **Platform:** linux-rocky8-skylake_avx512

My question is: How can I ensure that the pip install command (called by Spack) for py-fenics-basix correctly uses the Spack-managed CMake@3.27.6 instead of the system’s older CMake@3.20.2 (and the newly installed python and dependencies?)?

I will attach packages.yaml, spack.yaml, and the full spack-build-out.txt for complete context.

Thank you for your help!

1 Like

spack.yaml

# spack.yaml for fenicsx/0.9.0/shared
spack:
  specs:
  # - cmake
  - python
  - py-pip
  - py-setuptools
  - py-wheel
  - python-venv
  - fenics-dolfinx@0.9.0+adios2+petsc
  - py-fenics-dolfinx@0.9.0+petsc4py+slepc4py
  - py-fenics-basix@0.9.0
  - fenics-basix@0.9.0
  - py-fenics-ufl@2024.2.0
  - py-fenics-ffcx@0.9.0
  - petsc+mumps+fortran+superlu-dist~trilinos
  - adios2~sst+python

  config:
    concretizer:
      unify: true
    # env_vars:
    #   set:
    #     SKBUILD_CMAKE_EXECUTABLE: /gpfs/softs/contrib/apps/cmake/3.27.6/bin/cmake

packages.yaml

packages:
  # 1. Compiler (Garde les modules car c'est un compilateur)
  gcc:
    externals:
    - spec: gcc@13.2.0+binutils languages='c,c++,fortran'
      prefix: /gpfs/softs/compilers/gcc/13.2.0
      extra_attributes:
        compilers:
          c: /gpfs/softs/compilers/gcc/13.2.0/bin/gcc
          cxx: /gpfs/softs/compilers/gcc/13.2.0/bin/g++
          fortran: /gpfs/softs/compilers/gcc/13.2.0/bin/gfortran
      modules:
      - compilers/gcc/13.2.0
    buildable: false
  # 3. Core Dependencies
  cmake:
    externals:
    - spec: cmake@3.27.6
      prefix: /gpfs/softs/contrib/apps/cmake/3.27.6
      modules:
      - cmake/3.27.6
    buildable: false
  mpi:
    buildable: false
  openmpi:
    variants: fabrics=ofi,ucx schedulers=slurm
    externals:
    - spec: openmpi@5.0.2
      prefix: /gpfs/softs/mpi/openmpi/5.0.2
      modules:
      - mpi/openmpi/5.0.2
    buildable: false
  pmix:
    externals:
    - spec: pmix@5.0.1
      prefix: /gpfs/softs/lib/pmix/5.0.1
      modules:
      - lib/pmix/5.0.1
    buildable: false
  python:
    buildable: true
  py-pip:
    buildable: true
  python-venv:
    buildable: true
  py-setuptools:
    buildable: true
  py-wheel:
    buildable: true
  py-scikit-build-core:
    buildable: true
  slurm:
    externals:
    - spec: slurm@23.11.5 sysconfdir=/etc/slurm
      prefix: /usr
    buildable: false
  ucx:
    externals:
    - spec: ucx@1.15.0
      prefix: /gpfs/softs/lib/ucx/1.15.0
      modules:
      - lib/ucx/1.15.0
    buildable: false

spack-build-out.txt

==> py-fenics-basix: Executing phase: 'install'
==> [2025-11-02-22:21:49.434931] '/gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/python-venv-1.0-o7bao2deumk7rspdwiqqtmki6n63p4zk/bin/python3' '-m' 'pip' '-vvv' '--no-input' '--no-cache-dir' '--disable-pip-version-check' 'install' '--no-deps' '--ignore-installed' '--no-build-isolation' '--no-warn-script-location' '--no-index' '--prefix=/gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt' '--config-settings=build.tool-args=-j20' '--config-settings=build.verbose=true' '.'
Using pip 25.1.1 from /gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/py-pip-25.1.1-mx5fhxufxfhe7pi3oi64ngqy3m7abypd/lib/python3.12/site-packages/pip (python 3.12)
Non-user install due to --prefix or --target option
Ignoring indexes: https://pypi.org/simple
Created temporary directory: /tmp/SLURM_JOB_17394454/pip-build-tracker-ue1btdjd
Initialized build tracking at /tmp/SLURM_JOB_17394454/pip-build-tracker-ue1btdjd
Created build tracker: /tmp/SLURM_JOB_17394454/pip-build-tracker-ue1btdjd
Entered build tracker: /tmp/SLURM_JOB_17394454/pip-build-tracker-ue1btdjd
Created temporary directory: /tmp/SLURM_JOB_17394454/pip-install-1r7mm__g
Created temporary directory: /tmp/SLURM_JOB_17394454/pip-ephem-wheel-cache-j4z6luzj
Processing /tmp/SLURM_JOB_17394454/tlavigne002/spack-stage/spack-stage-py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt/spack-src/python
  Added file:///tmp/SLURM_JOB_17394454/tlavigne002/spack-stage/spack-stage-py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt/spack-src/python to build tracker '/tmp/SLURM_JOB_17394454/pip-build-tracker-ue1btdjd'
  Created temporary directory: /tmp/SLURM_JOB_17394454/pip-modern-metadata-3qlr05uk
  Preparing metadata (pyproject.toml): started
  Running command Preparing metadata (pyproject.toml)
  *** scikit-build-core 0.11.5 using CMake 3.20.2 (metadata_wheel)
  Preparing metadata (pyproject.toml): finished with status 'done'
  Source in /tmp/SLURM_JOB_17394454/tlavigne002/spack-stage/spack-stage-py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt/spack-src/python has version 0.9.0, which satisfies requirement fenics-basix==0.9.0 from file:///tmp/SLURM_JOB_17394454/tlavigne002/spack-stage/spack-stage-py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt/spack-src/python
  Removed fenics-basix==0.9.0 from file:///tmp/SLURM_JOB_17394454/tlavigne002/spack-stage/spack-stage-py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt/spack-src/python from build tracker '/tmp/SLURM_JOB_17394454/pip-build-tracker-ue1btdjd'
Created temporary directory: /tmp/SLURM_JOB_17394454/pip-unpack-4uul2_z0
Building wheels for collected packages: fenics-basix
  Created temporary directory: /tmp/SLURM_JOB_17394454/pip-wheel-9osd2jrg
  Destination directory: /tmp/SLURM_JOB_17394454/pip-wheel-9osd2jrg
  Building wheel for fenics-basix (pyproject.toml): started
  Running command Building wheel for fenics-basix (pyproject.toml)
  *** scikit-build-core 0.11.5 using CMake 3.20.2 (wheel)
  *** Configuring CMake...
  loading initial cache file /tmp/SLURM_JOB_17394454/tmp6uob3xca/build/CMakeInit.txt
  CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
    CMake 3.21 or higher is required.  You are running version 3.20.2


  -- Configuring incomplete, errors occurred!

  *** CMake configuration failed
  error: subprocess-exited-with-error

  × Building wheel for fenics-basix (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/python-venv-1.0-o7bao2deumk7rspdwiqqtmki6n63p4zk/bin/python3 /gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/py-pip-25.1.1-mx5fhxufxfhe7pi3oi64ngqy3m7abypd/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/SLURM_JOB_17394454/tmpmkqfzf1t
  cwd: /tmp/SLURM_JOB_17394454/tlavigne002/spack-stage/spack-stage-py-fenics-basix-0.9.0-cop3tv4grvr3uj6e7h6mhghglxzbzjkt/spack-src/python
  Building wheel for fenics-basix (pyproject.toml): finished with status 'error'
  ERROR: Failed building wheel for fenics-basix
Failed to build fenics-basix
ERROR: Failed to build installable wheels for some pyproject.toml based projects (fenics-basix)
Exception information:
Traceback (most recent call last):
  File "/gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/py-pip-25.1.1-mx5fhxufxfhe7pi3oi64ngqy3m7abypd/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
    status = _inner_run()
             ^^^^^^^^^^^^
  File "/gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/py-pip-25.1.1-mx5fhxufxfhe7pi3oi64ngqy3m7abypd/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
    return self.run(options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/py-pip-25.1.1-mx5fhxufxfhe7pi3oi64ngqy3m7abypd/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 68, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gpfs/softs/contrib/apps/fenicsx/spack-src-28.10.2025/opt/spack/linux-skylake_avx512/py-pip-25.1.1-mx5fhxufxfhe7pi3oi64ngqy3m7abypd/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 436, in run
    raise InstallationError(
pip._internal.exceptions.InstallationError: Failed to build installable wheels for some pyproject.toml based projects (fenics-basix)
Removed build tracker: '/tmp/SLURM_JOB_17394454/pip-build-tracker-ue1btdjd'

spack find -c for versions

==> In environment /gpfs/softs/contrib/apps/fenicsx/spack-config-28.10.2025/envs/fenicsx/0.9.0/shared
==> 13 root specs
-- no arch / no compilers ---------------------------------------
[+] adios2+python~sst                  [+] petsc+fortran+mumps+superlu-dist~trilinos   -  py-fenics-ffcx@0.9.0    [+] py-setuptools  [+] python-venv
[+] fenics-basix@0.9.0                  -  py-fenics-basix@0.9.0                      [+] py-fenics-ufl@2024.2.0  [+] py-wheel
[+] fenics-dolfinx@0.9.0+adios2+petsc   -  py-fenics-dolfinx@0.9.0+petsc4py+slepc4py  [+] py-pip                  [+] python

-- linux-rocky8-skylake_avx512 / %c,cxx,fortran=gcc@13.2.0 ------
[+]  adios2@2.10.2    [+]  libcatalyst@2.0.0  [+]  petsc@3.24.0                 [+]  slepc@3.24.0        [+]  zfp@0.5.5
[+]  arpack-ng@3.9.1  [+]  openblas@0.3.30    [+]  py-scikit-build-core@0.11.5  [+]  superlu-dist@9.1.0

-- linux-rocky8-skylake_avx512 / %c,cxx=gcc@13.2.0 --------------
[+]  berkeley-db@18.1.40  [+]  fenics-dolfinx@0.9.0  [+]  libffi@3.5.2   [+]  mgard@compat-2023-12-09  [+]  openssl@3.6.0            [+]  py-mpi4py@4.0.1  [+]  sz@2.1.12.5
[+]  bison@3.8.2          [+]  fmt@12.0.0            [+]  libpng@1.6.47  [+]  ncurses@6.5-20250705     [+]  parmetis@4.0.3           [+]  py-numpy@2.3.4   [+]  yaml-cpp@0.8.0
[+]  boost@1.88.0         [+]  gettext@0.23.1        [+]  lz4@1.10.0     [+]  nghttp2@1.67.1           [+]  protobuf@3.28.2          [+]  python@3.12.12   [+]  zlib-ng@2.2.4
[+]  curl@8.15.0          [+]  krb5@1.21.3           [+]  m4@1.4.20      [+]  ninja@1.13.0             [+]  py-cython@3.1.3          [+]  re2c@3.1         [+]  zstd@1.5.7
[+]  expat@2.7.3          [+]  libarchive@3.8.0      [+]  metis@5.1.0    [+]  openssh@9.9p1             -   py-fenics-dolfinx@0.9.0  [+]  snappy@1.2.1

-- linux-rocky8-skylake_avx512 / %c,fortran=gcc@13.2.0 ----------
[+]  mumps@5.8.1  [+]  netlib-scalapack@2.2.2  [+]  py-petsc4py@3.24.0

-- linux-rocky8-skylake_avx512 / %c=gcc@13.2.0 ------------------
[+]  automake@1.16.5   [+]  gdbm@1.25      [+]  libedit@3.1-20240808  [+]  libtool@2.4.7     [+]  lzo@2.10       [+]  py-cffi@1.16.0          [+]  sqlite@3.50.4
[+]  bzip2@1.0.8       [+]  git@2.48.1     [+]  libiconv@1.18         [+]  libunistring@1.2  [+]  pcre2@10.44    [+]  py-meson-python@0.18.0  [+]  tar@1.35
[+]  c-blosc2@2.15.1   [+]  gmake@4.4.1    [+]  libidn2@2.3.7         [+]  libxcrypt@4.4.38  [+]  perl@5.42.0    [+]  py-pycparser@2.23       [+]  util-linux-uuid@2.41
[+]  diffutils@3.12    [+]  hdf5@1.14.6    [+]  libmd@1.1.0           [+]  libxml2@2.13.5    [+]  pigz@2.8       [+]  readline@8.3            [+]  xz@5.6.3
[+]  findutils@4.10.0  [+]  libbsd@0.12.2  [+]  libsigsegv@2.14       [+]  lizard@2.1        [+]  pkgconf@2.5.1  [+]  sed@4.9

-- linux-rocky8-skylake_avx512 / %cxx=gcc@13.2.0 ----------------
[+]  abseil-cpp@20240722.0  [+]  fenics-basix@0.9.0  [+]  pugixml@1.14   -   py-fenics-basix@0.9.0  [+]  py-nanobind@2.8.0  [+]  spdlog@1.16.0

-- linux-rocky8-skylake_avx512 / no compilers -------------------
[+]  autoconf@2.72                       [+]  meson@1.8.5             [+]  py-hatch-vcs@0.5.0   [+]  py-pluggy@1.6.0              [+]  py-trove-classifiers@2025.9.11.17
[+]  ca-certificates-mozilla@2025-08-12  [+]  py-calver@2025.4.17     [+]  py-hatchling@1.27.0  [+]  py-pyproject-metadata@0.9.1  [+]  py-wheel@0.45.1
[+]  compiler-wrapper@1.0                 -   py-fenics-ffcx@0.9.0    [+]  py-packaging@25.0    [+]  py-setuptools@80.9.0         [+]  python-venv@1.0
[+]  fenics-ufcx@0.9.0                   [+]  py-fenics-ufl@2024.2.0  [+]  py-pathspec@0.12.1   [+]  py-setuptools-scm@8.2.1
[+]  gcc-runtime@13.2.0                  [+]  py-flit-core@3.12.0     [+]  py-pip@25.1.1        [+]  py-slepc4py@3.24.0

-- linux-rocky8-x86_64 / no compilers ---------------------------
[e]  cmake@3.27.6  [e]  gcc@13.2.0  [e]  glibc@2.28  [e]  openmpi@5.0.2
==> 110 installed packages
==> 3 concretized packages to be installed

spack spec py-fenics-basix

 -   py-fenics-basix@0.9.0 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512 %cxx=gcc@13.2.0
[e]      ^cmake@3.27.6~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release platform=linux os=rocky8 target=x86_64
[+]      ^compiler-wrapper@1.0 build_system=generic platform=linux os=rocky8 target=skylake_avx512
[+]      ^fenics-basix@0.9.0~ipo build_system=cmake build_type=RelWithDebInfo generator=make platform=linux os=rocky8 target=skylake_avx512 %cxx=gcc@13.2.0
[+]          ^gmake@4.4.1~guile build_system=generic platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^openblas@0.3.30~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=none platform=linux os=rocky8 target=skylake_avx512 %c,cxx,fortran=gcc@13.2.0
[e]      ^gcc@13.2.0+binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rocky8 target=x86_64
[+]      ^gcc-runtime@13.2.0 build_system=generic platform=linux os=rocky8 target=skylake_avx512
[e]      ^glibc@2.28 build_system=autotools platform=linux os=rocky8 target=x86_64
[+]      ^py-nanobind@2.8.0 build_system=python_pip commit=0e7aa61a75052034453cd2b906a79fe222792697 platform=linux os=rocky8 target=skylake_avx512 %cxx=gcc@13.2.0
[+]      ^py-numpy@2.3.4 build_system=python_pip patches:=873745d platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]          ^py-cython@3.1.3 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]              ^py-setuptools@80.9.0 build_system=generic platform=linux os=rocky8 target=skylake_avx512
[+]          ^py-meson-python@0.18.0 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]              ^meson@1.8.5 build_system=python_pip patches:=0f0b1bd platform=linux os=rocky8 target=skylake_avx512
[+]              ^ninja@1.13.0+re2c build_system=generic platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]                  ^re2c@3.1 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]              ^py-pyproject-metadata@0.9.1 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]      ^py-pip@25.1.1 build_system=generic platform=linux os=rocky8 target=skylake_avx512
[+]      ^py-scikit-build-core@0.11.5+pyproject build_system=python_pip platform=linux os=rocky8 target=skylake_avx512 %c,cxx,fortran=gcc@13.2.0
[+]          ^py-hatch-vcs@0.5.0 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]              ^py-setuptools-scm@8.2.1+toml build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]                  ^git@2.48.1+man+nls+perl+subtree~tcltk build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                      ^autoconf@2.72 build_system=autotools platform=linux os=rocky8 target=skylake_avx512
[+]                      ^automake@1.16.5 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                      ^curl@8.15.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]                          ^nghttp2@1.67.1 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]                      ^libidn2@2.3.7 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                          ^libunistring@1.2 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                      ^libtool@2.4.7 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                          ^findutils@4.10.0 build_system=autotools patches:=440b954 platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                      ^m4@1.4.20+sigsegv build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]                          ^libsigsegv@2.14 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                      ^openssh@9.9p1+gssapi build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]                          ^krb5@1.21.3+shared build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]                              ^bison@3.8.2~color build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]                          ^libedit@3.1-20240808 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                      ^pcre2@10.44~jit+multibyte+pic build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^py-hatchling@1.27.0 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]              ^py-pluggy@1.6.0 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]              ^py-trove-classifiers@2025.9.11.17 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]                  ^py-calver@2025.4.17 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]          ^py-packaging@25.0 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]              ^py-flit-core@3.12.0 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]          ^py-pathspec@0.12.1 build_system=python_pip platform=linux os=rocky8 target=skylake_avx512
[+]      ^py-wheel@0.45.1 build_system=generic platform=linux os=rocky8 target=skylake_avx512
[+]      ^python@3.12.12+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]          ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]              ^diffutils@3.12 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^expat@2.7.3+libbsd build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]              ^libbsd@0.12.2 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                  ^libmd@1.1.0 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^gdbm@1.25 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]              ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]              ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]              ^tar@1.35 build_system=autotools zip=pigz platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                  ^pigz@2.8 build_system=makefile platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                  ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]          ^libffi@3.5.2 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]          ^libxcrypt@4.4.38~obsolete_api build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]              ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]                  ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]          ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]          ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]              ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=rocky8 target=skylake_avx512
[+]          ^pkgconf@2.5.1 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^readline@8.3 build_system=autotools patches:=21f0a03 platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^sqlite@3.50.4+column_metadata+fts+rtree build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^util-linux-uuid@2.41 build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=rocky8 target=skylake_avx512 %c=gcc@13.2.0
[+]          ^zlib-ng@2.2.4+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=rocky8 target=skylake_avx512 %c,cxx=gcc@13.2.0
[+]      ^python-venv@1.0 build_system=generic platform=linux os=rocky8 target=skylake_avx512

[EDIT] — Re-exporting CMake Path and Next Steps

After several new attempts, it appears that re-exporting the CMake path ensured that the correct CMake version was being used, which helped me overcome the previous issue.

However, I’ve now encountered a new issue, likely related to the external packages currently loaded. To rule out conflicts, I plan to reinstall everything from scratch in a clean environment, loading only the minimal required externals (most likely just gcc@13).

I’ll update this post after running the following test:

python -c "from mpi4py import MPI; import dolfinx"

Here’s the environment setup I’m currently using to make sure the correct CMake is picked up:

export SKBUILD_CMAKE_EXECUTABLE="/gpfs/softs/contrib/apps/cmake/3.27.6/bin/cmake"
export CMAKE_EXECUTABLE="/gpfs/softs/contrib/apps/cmake/3.27.6/bin/cmake"
export PATH="/gpfs/softs/contrib/apps/cmake/3.27.6/bin:${PATH}"

The test was successful (only keeping gcc and cmake as externals).

mpirun -n 4 python -c "import os, sys; sys.setdlopenflags(os.RTLD_NOW | os.RTLD_GLOBAL); from mpi4py import MPI; import dolfinx; print(dolfinx.__version__)"
0.9.0
0.9.0
0.9.0
0.9.0

Here is also the final spack.yaml I used alongside the additionnal exports:

# spack.yaml for fenicsx/${FENICSX_VERSION}/shared
spack:
  specs:
  # - cmake
  - python
  - py-pip
  - py-setuptools
  - py-wheel
  - python-venv
  - fenics-dolfinx@${FENICSX_VERSION}+adios2+petsc
  - py-fenics-dolfinx@${FENICSX_VERSION}+petsc4py+slepc4py
  - py-fenics-basix@${FENICSX_VERSION}
  - fenics-basix@${FENICSX_VERSION}
  - py-fenics-ufl@2024.2.0
  - py-fenics-ffcx@${FENICSX_VERSION}
  - petsc+mumps+fortran+superlu-dist~trilinos
  - adios2~sst+python

  config:
    concretizer:
      unify: true
    env_vars:
      set:
        SKBUILD_CMAKE_EXECUTABLE: /gpfs/softs/contrib/apps/cmake/3.27.6/bin/cmake
        CMAKE_EXECUTABLE: /gpfs/softs/contrib/apps/cmake/3.27.6/bin/cmake
        PATH: /gpfs/softs/contrib/apps/cmake/3.27.6/bin:$PATH
EOF
1 Like