Dolfinx v0.10 in spack

Hi,

I need to have dolfinx v0.10 in spack, but when I add “spack add py-fenics-dolfinx@0.10” and then “install”, it mentions that this version of donfinx is not in the spack. I found from “https://fenicsproject.discourse.group/t/v0-10-0-of-dolfinx/18297” that it is not added to spack. I am wondering is there any other ways that I can manually add it to spack?

Thank you in advance,

See:

We have had issues with spack being very slow at processing PR (as they have a massive amount of packages), and have therefore gone for the overlay solution, where on adds repos on top of the existing spack packages. This is also done for quite a few of my own packages, see:

Thank you for your response.

As I understood, from the second link, after doing “repo add”, I can add dolfinx@0.10 by “spack add py-dolfinx@0.10”. Am I right?

Yes, that is correct, I would recommend py-fenics-dolfinx@0.10.0+petsc4py ^fenics-dolfinx+adios2 ^petsc+mumps+hypre so that you get good outputting IO and some solvers from PETSc.

Thank you so much. I will do your suggestion.

Hi

I have tried what you suggested me and I got this error when I did “spack install”


 g4qudo6 fenics-dolfinx@0.10.0.post4 failed

In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/MPI.h:9:

/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/Timer.h:136:3: error: missing ‘typename’ prior to dependent type name ‘T::duration’
T::duration _acc = T::duration::zero();
^~~~~~~~~~~
typename
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/TimeLogger.cpp:8:
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/MPI.h:9:
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/Timer.h:136:3: error: missing ‘typename’ prior to dependent type name ‘T::duration’
T::duration _acc = T::duration::zero();
^~~~~~~~~~~
typename
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/timing.cpp:10:
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/Timer.h:136:3: error: missing ‘typename’ prior to dependent type name ‘T::duration’
T::duration _acc = T::duration::zero();
^~~~~~~~~~~
typename
1 error generated.
make[2]: *** [dolfinx/CMakeFiles/dolfinx.dir/build.make:166: dolfinx/CMakeFiles/dolfinx.dir/common/timing.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/IndexMap.cpp:8:
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/IndexMap.h:10:
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/MPI.h:9:
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-0.10.0.post4-g4qudo6fiudw7hdt4dvxhb43cwk5lrgn/spack-src/cpp/dolfinx/common/Timer.h:136:3: error: missing ‘typename’ prior to dependent type name ‘T::duration’


This has been fixed on main by @schnellerhase (Fix `clang@15` compile by schnellerhase · Pull Request #4011 · FEniCS/dolfinx · GitHub)
Could you try:
py-fenics-dolfinx@main+petsc4py ^fenics-dolfinx+adios2 ^petsc+mumps+hypre

Thank you for your response. I still have a problem,

I carried out these steps:

1-git clone --depth=2 GitHub - spack/spack: A flexible package manager that supports multiple versions, configurations, platforms, and compilers. · GitHub

2-. spack/share/spack/setup-env.sh

3- spack env create fenicsx-env

spack env activate fenicsx-env

4-spack repo add GitHub - FEniCS/spack-fenics: Spack package repository overlay for FEniCS · GitHub

5-spack repo add ``https://github.com/scientificcomputing/spack

6-spack add py-fenics-dolfinx@main+petsc4py ^fenics-dolfinx+adios2 ^petsc+mumps+hypre

7-spack concretize

8-spack install

and I got this error:

“
inoeqrq fenics-dolfinx@main failed: /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr-2urz53um.log (15s)
– lines 168 to 328 –

/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:116:31: error: reference to local binding ‘bs1’ declared in enclosing function ‘dolfinx::fem::impl::assemble_cells_matrix’
for (int k = 0; k < bs1; ++k)
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:85:22: note: ‘bs1’ declared here
const auto [dmap1, bs1, cells1] = dofmap1;
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:118:21: error: reference to local binding ‘bs1’ declared in enclosing function ‘dolfinx::fem::impl::assemble_cells_matrix’
if (bc1[bs1 * dof + k])
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:85:22: note: ‘bs1’ declared here
const auto [dmap1, bs1, cells1] = dofmap1;
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:290:31: error: reference to local binding ‘bs1’ declared in enclosing function ‘dolfinx::fem::impl::assemble_entities’
for (int k = 0; k < bs1; ++k)
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:258:22: note: ‘bs1’ declared here
const auto [dmap1, bs1, entities1] = dofmap1;
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:292:21: error: reference to local binding ‘bs1’ declared in enclosing function ‘dolfinx::fem::impl::assemble_entities’
if (bc1[bs1 * dof + k])
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:258:22: note: ‘bs1’ declared here
const auto [dmap1, bs1, entities1] = dofmap1;
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:498:31: error: reference to local binding ‘bs1’ declared in enclosing function ‘dolfinx::fem::impl::assemble_interior_facets’
for (int k = 0; k < bs1; ++k)
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:427:22: note: ‘bs1’ declared here
const auto [dmap1, bs1, facets1] = dofmap1;
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:500:21: error: reference to local binding ‘bs1’ declared in enclosing function ‘dolfinx::fem::impl::assemble_interior_facets’
if (bc1[bs1 * dof + k])
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/assemble_matrix_impl.h:427:22: note: ‘bs1’ declared here
const auto [dmap1, bs1, facets1] = dofmap1;
^
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/DofMap.cpp:7:
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/DofMap.h:12:
In file included from /tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/ElementDofLayout.h:9:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/array:40:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algobase.h:65:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_iterator_base_types.h:71:
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:979:13: error: no matching function for call to ‘__begin’
= decltype(ranges::__cust_access::__begin(std::declval<_Tp&>()));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/ranges_base.h:590:5: note: in instantiation of template type alias ‘__range_iter_t’ requested here
using iterator_t = std::__detail::__range_iter_t<_Tp>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/ranges_util.h:98:43: note: in instantiation of template type alias ‘iterator_t’ requested here
data() requires contiguous_iterator<iterator_t<_Derived>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/ranges_util.h:203:29: note: in instantiation of template class ‘std::ranges::view_interface<std::ranges::subrange<__gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, __gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, std::ranges::subrange_kind::sized>>’ requested here
class subrange : public view_interface<subrange<_It, _Sent, _Kind>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/ranges_algo.h:1179:7: note: in instantiation of template class ‘std::ranges::subrange<__gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, __gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, std::ranges::subrange_kind::sized>’ requested here
operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const
^
/tmp/izahed/spack-stage/spack-stage-fenics-dolfinx-main-inoeqrqtrocw5pgqns4ztt7vm5xykldr/spack-src/cpp/dolfinx/fem/DirichletBC.h:234:53: note: in instantiation of function template specialization ‘std::ranges::__unique_fn::operator()<std::vector<std::array<int, 2>> &, std::identity, std::ranges::equal_to>’ requested here
auto [unique_end, range_end] = std::ranges::unique(bc_dofs);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:963:7: note: candidate template ignored: constraints not satisfied [with _Tp = std::ranges::subrange<__gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, __gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, std::ranges::subrange_kind::sized>]
__begin(_Tp& __t)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:961:16: note: because ‘is_array_v<std::ranges::subrange<__gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2> > >, __gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2> > >, std::ranges::subrange_kind::sized> >’ evaluated to false
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:961:35: note: and ‘std::ranges::subrange<__gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, __gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, std::ranges::subrange_kind::sized> &’ does not satisfy ‘__member_begin’
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:944:23: note: because ‘__decay_copy(__t.begin())’ would be invalid: no member named ‘begin’ in ‘std::ranges::subrange<__gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, __gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, std::ranges::subrange_kind::sized>’
{ __decay_copy(__t.begin()) } → input_or_output_iterator;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:961:59: note: and ‘std::ranges::subrange<__gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, __gnu_cxx::__normal_iterator<std::array<int, 2> *, std::vector<std::array<int, 2>>>, std::ranges::subrange_kind::sized> &’ does not satisfy ‘__adl_begin’
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:955:19: note: because ‘__decay_copy(begin(__t))’ would be invalid: call to deleted function ‘begin’
{ __decay_copy(begin(__t)) } → input_or_output_iterator;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/iterator_concepts.h:979:13: error: no matching function for call to ‘__begin’“


It seems like you are using a rather old gcc compiler (as gcc is at gcc 16 atm).
Could you post the output of

spack compiler list

and also do

spack compiler find

If you have a newer version of gcc available, could you try using

spack add py-fenics-dolfinx@main+petsc4py ^fenics-dolfinx+adios2 ^petsc+mumps+hypre %gcc@XX.Y.Z

where XX.Y.Z is the compiler version, for instance %gcc@13.3.0

I did, the available compilers are
– gcc ubuntu22.04-x86_64 ---------------------------------------
[e] gcc@11.4.0 [e] gcc@10.5.0

– llvm ubuntu22.04-x86_64 --------------------------------------
[e] llvm@14.0.0

and I did “spack compiler find”
==> Found no new compilers
==> Compilers are defined in the following files:
/home/izahed/preCiCE/spack/var/spack/environments/fenicsx-env/spack.yaml

I will install the new version of gcc, and I will report the results

You can get spack to install it:

spack install gcc@XX.Y.Z

and then do spack compiler find.