FenicsX installation in cluster using spack

Hello,

Following my post on parallelization, I am trying to reinstall FenicsX in the cluster using spack. I enter the following command lines:

git clone https://github.com/spack/spack.git
. ./spack/share/spack/setup-env.sh
spack env create fenicsx-env
spack env activate fenicsx-env
spack add py-fenics-dolfinx cflags="-O3" fflags="-O3"
spack install

And I get the following error:

  1. Cannot select a single “version” for package “py-petsc4py”
  2. Cannot select a single “version” for package “py-fenics-dolfinx”
  3. No valid value for variant ‘libxml2’ of package ‘python’
  4. No valid value for variant ‘mpi’ of package ‘py-petsc4py’
  5. No valid compiler version found for ‘zlib-ng’
  6. No valid compiler version found for ‘python’
  7. No valid compiler version found for ‘py-wheel’
  8. No valid compiler version found for ‘py-setuptools’
  9. No valid compiler version found for ‘py-pycparser’
  10. No valid compiler version found for ‘py-pip’
  11. No valid compiler version found for ‘py-petsc4py’
  12. No valid compiler version found for ‘py-numpy’
  13. No valid compiler version found for ‘py-mpi4py’
  14. No valid compiler version found for ‘py-fenics-dolfinx’
  15. No valid compiler version found for ‘py-cython’
  16. No valid compiler version found for ‘py-cffi’
  17. No valid compiler version found for ‘pkgconf’
  18. No valid compiler version found for ‘nvhpc’
  19. No valid compiler version found for ‘libffi’
  20. No valid compiler version found for ‘hdf5’
  21. No valid compiler version found for ‘gmake’
  22. No valid compiler version found for ‘curl’
  23. No valid compiler version found for ‘cmake’
  24. nvhpc: nvhpc must be installed with %gcc
  25. curl: Only supported on macOS
  26. curl: Only supported on macOS
    required because conflict is triggered when arch=linux-None-None
    required because conflict constraint tls=secure_transport

Do you have any suggestions on how to solve this issue?

Thank you !

I also tried the solutions suggested here: Error: fenics-dolfinx requires GCC-9 or newer for improved C++17 support but gcc version 10.2.1 in my system - #5 by jiangzhangze. I created a new spack environment and added the command lines:

spack compiler find
spack add py-fenics-dolfinx%gcc cflags="-O3" fflags="-O3"
spack install

and now I get the following errors:

==> Error: concretization failed for the following reasons:

   1. fenics-dolfinx: fenics-dolfinx requires GCC-9 or newer for improved C++17 support
   2. fenics-dolfinx: fenics-dolfinx requires GCC-9 or newer for improved C++17 support
        required because conflict constraint  
          required because py-fenics-dolfinx depends on fenics-dolfinx@0.4.1 when @0.4.1 
            required because py-fenics-dolfinx%gcc cflags=-O3 fflags=-O3 requested explicitly 
        required because conflict is triggered when %gcc@:8 
          required because py-fenics-dolfinx depends on fenics-dolfinx@0.4.1 when @0.4.1 
            required because py-fenics-dolfinx%gcc cflags=-O3 fflags=-O3 requested explicitly ```

What compilers do you have installed on your cluster?

What does

module avail gcc

yeild?

You should load an appropriate version of gcc using module load