Install latest dev version from Spack installation

I completed the spack installation following the instructions in the README file of dolfinx and have installed version 0.7.2 on a cluster. I want to install the latest dev version. I don’t know much about spack. How to proceed?

My understanding of spack is that it installs only released versions. If you want to install the latest dev version, you may want to follow the instructions for building from source instead.

1 Like

I saw that the fenics packages offer a main version in spack that follows the respective main branches.

I tried installing the main versions together with the previously installed packages by running

spack add fenics-dolfinx@main+adios2 py-fenics-dolfinx@main cflags="-O3" fflags="-O3"
spack install

but I get an error at the end when trying to install py-fenics-dolfinx. Here is the beginning of the error message:

==> py-fenics-dolfinx: Executing phase: 'install'                                                                                                                                        
==> Error: ProcessError: Command exited with status 1:                                                                                                                                   
    '/data0/home/mslimani/bin/spack/opt/spack/linux-rhel7-haswell/gcc-10.2.0/python-3.11.7-p53pej4y4xsuegjyouvo4k7odsfcl3oc/bin/python3.11' '-m' 'pip' '-vvv' '--no-input' '--no-cache-di
r' '--disable-pip-version-check' 'install' '--no-deps' '--ignore-installed' '--no-build-isolation' '--no-warn-script-location' '--no-index' '--prefix=/data0/home/mslimani/bin/spack/opt/
spack/linux-rhel7-haswell/gcc-10.2.0/py-fenics-dolfinx-main-qc7fp77anfbum5higd63jgy7hllptirf' '.'                                                                                        
                                                                                                                                                                                         
187 errors found in build log:                                                                                                                                                           
     132       /data0/home/mslimani/bin/spack/opt/spack/linux-rhel7-haswell/gcc-10.2.0/fenics-dolfinx-main-uit6urv73vob4digxgk35pvlx63wqw6e/include/dolfinx/fem/assemble_vector_impl.h:  
             In instantiation of 'void dolfinx::fem::impl::assemble_vector(std::span<_Type, 18446744073709551615>, const dolfinx::fem::Form<T, U>&, dolfinx::fem::impl::mdspan2_t, std:: 
             span<dolfinx::scalar_value_type_t<T> >, std::span<const T>, const std::map<std::pair<dolfinx::fem::IntegralType, int>, std::pair<std::span<const T>, int> >&) [with T = flo 
             at; U = float; dolfinx::fem::impl::mdspan2_t = std::mdspan<const int, std::extents<long unsigned int, 18446744073709551615, 18446744073709551615> >; dolfinx::scalar_value_ 
             type_t<T> = float]':                                                                                                                                                        
     133       /data0/home/mslimani/bin/spack/opt/spack/linux-rhel7-haswell/gcc-10.2.0/fenics-dolfinx-main-uit6urv73vob4digxgk35pvlx63wqw6e/include/dolfinx/fem/assemble_vector_impl.h:1 
             279:20:   required from 'void dolfinx::fem::impl::assemble_vector(std::span<_Type, 18446744073709551615>, const dolfinx::fem::Form<T, U>&, std::span<const T>, const std::m 
             ap<std::pair<dolfinx::fem::IntegralType, int>, std::pair<std::span<const T>, int> >&) [with T = float; U = float]'                                                          
     134       /data0/home/mslimani/bin/spack/opt/spack/linux-rhel7-haswell/gcc-10.2.0/fenics-dolfinx-main-uit6urv73vob4digxgk35pvlx63wqw6e/include/dolfinx/fem/assembler.h:113:24:   re 
             quired from 'void dolfinx::fem::assemble_vector(std::span<_Type, 18446744073709551615>, const dolfinx::fem::Form<T, U>&, std::span<const T>, const std::map<std::pair<dolfi 
             nx::fem::IntegralType, int>, std::pair<std::span<const T>, int> >&) [with T = float; U = float]'                                                                            
     135       /tmp/mslimani/spack-stage/spack-stage-py-fenics-dolfinx-main-qc7fp77anfbum5higd63jgy7hllptirf/spack-src/python/dolfinx/wrappers/assemble.cpp:165:41:   required from 'voi 
             d {anonymous}::declare_assembly_functions(nanobind::module_&) [with T = float; U = float]'                                                                                  
     136       /tmp/mslimani/spack-stage/spack-stage-py-fenics-dolfinx-main-qc7fp77anfbum5higd63jgy7hllptirf/spack-src/python/dolfinx/wrappers/assemble.cpp:379:45:   required from here 
     137       /data0/home/mslimani/bin/spack/opt/spack/linux-rhel7-haswell/gcc-10.2.0/fenics-dolfinx-main-uit6urv73vob4digxgk35pvlx63wqw6e/include/dolfinx/fem/traits.h:19:9:   require 
             d by the constraints of 'template<class U, class T> concept dolfinx::fem::DofTransformKernel'                                                                               
  >> 138     /data0/home/mslimani/bin/spack/opt/spack/linux-rhel7-haswell/gcc-10.2.0/fenics-dolfinx-main-uit6urv73vob4digxgk35pvlx63wqw6e/include/dolfinx/fem/traits.h:20:12: error: the 
              value of 'std::is_invocable_v<std::function<void(std::span<float, 18446744073709551615>, std::span<const unsigned int>, int, int)>, std::span<_Type, 18446744073709551615> 
             , std::span<const unsigned int, 18446744073709551615>, int, int>' is not usable in a constant expression                                                                    
     139          20 |     = std::is_invocable_v<U, std::span<T>, std::span<const std::uint32_t>,                                                                                        
     140             |       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                        
     141          21 |                           std::int32_t, int>;                                                                                                                     
     142             |                           ~~~~~~~~~~~~~~~~~~                                                                                                                      
     143       In file included from /data0/globalfs/opt/gcc/10.2.0/include/c++/10.2.0/bits/move.h:57,                                                                                   
     144                        from /data0/globalfs/opt/gcc/10.2.0/include/c++/10.2.0/bits/stl_pair.h:59,                                                                               
                                                                                                                                                                                         
     ...                                       

Might try again from a fresh clean environment.

Spack can install the main version by calling

as shown by ordinary-slim.

Please make sure that you update your local spack installation by calling git pull in your local spack repository prior to concretizing and installing the main version.

1 Like

Happy birthday!

I tried removing all my spack packages and updating my spack before running the installation command but I am still getting the error of the previous post.

Can you try to use a different gcc version. For example version 11 or 12. I found that this works for me. Firstly you can do

spack compiler find

To find what compiler you have in your system. Once you have that you can add it to using

spack add fenics-dolfinx@main%gcc@11.4.0+adios2 py-fenics-dolfinx@main
1 Like

Thank you @adeebkor . I was able to build with gcc 11.4.0. I was even able to build multiphenicsx by sourcing the spack-build-env.txt of the py-fenicsx-dolfinx package and building multiphenicsx with the normal command and installing some dependencies it complained about (setuptools, slepc4py, maybe some others).

1 Like