Problem during compiling

At the moment I am trying to compile ASPECT on my personal system. When I run ‘make’, it seems to proceed well until it arrives at:

[35%] Building CXX object CMakeFiles/aspect.dir/source/mesh_deformation/free_surface.cc.o

which then it generates the following error message:

/InstallDirectory/aspect/source/mesh_deformation/free_surface.cc:260:7: error: use of undeclared identifier 'SparsityTools’

SparsityTools::distribute_sparsity_pattern(sp,
^

1 error generated.
make[2]: *** [CMakeFiles/aspect.dir/source/mesh_deformation/free_surface.cc.o] Error 1
make[1]: *** [CMakeFiles/aspect.dir/all] Error 2
make: *** [all] Error 2

Has anyone encountered this issue before, and if so how can this be solved?

I have not seen this. Can you please post the content of your detailed.log from your build directory?

This only happens when one uses PETSc for linear algebra, which we probably don’t test very well. Can you try whether the following patch works for you:

To add to this: I would advise against using PETSc in ASPECT. I don’t know of any main developer regularly using it right now.

@tjhei Below is my detailed.log

ASPECT configuration:
ASPECT_VERSION: 2.2.0-pre
GIT REVISION: c3b56cae2 (master)
DEAL_II_DIR: /usr/local/bin/deal.II-v9.1.1/lib/cmake/deal.II
DEAL_II VERSION: 9.1.1
ASPECT_USE_PETSC: ON
ASPECT_USE_FP_EXCEPTIONS: OFF
ASPECT_RUN_ALL_TESTS: OFF
ASPECT_USE_SHARED_LIBS: ON
ASPECT_HAVE_LINK_H: OFF
ASPECT_WITH_WORLD_BUILDER ON /InstallDirectory/aspect/contrib/world_builder
CMAKE_BUILD_TYPE: Release
ASPECT_PRECOMPILE_HEADERS: OFF
CMAKE_INSTALL_PREFIX: /usr/local
CMAKE_SOURCE_DIR: /InstallDirectory/aspect
CMAKE_BINARY_DIR: /InstallDirectory/aspect/build
CMAKE_CXX_COMPILER: Clang 11.0.0.11000033 on platform Darwin x86_64
/opt/local/bin/mpicxx
PARAMETER_GUI_EXECUTABLE: PARAMETER_GUI_EXECUTABLE-NOTFOUND

LINKAGE: DYNAMIC

COMPILE_FLAGS:

_WITH_CXX14: ON
_WITH_CXX17: ON
_MPI_VERSION: 3.1
_WITH_64BIT_INDICES: OFF

@bangerth The patch you have provided works. Thank you very much.

However, now I have encountered another problem with building simulator/stokes_matrix_free.cc.o and it has generated 7 error messages with each one along the lines of:

/InstallDirectory/aspect/source/simulator/stokes_matrix_free.cc:1408:5: error: no matching function for call to ‘copy’
internal::ChangeVectorTypes::copy(stokes_rhs_correction,rhs_correction);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/InstallDirectory/aspect/source/simulator/stokes_matrix_free.cc:411:12: note: candidate function not viable: no known conversion from ‘LinearAlgebra::BlockVector’
(aka ‘dealii::PETScWrappers::MPI::BlockVector’) to ‘TrilinosWrappers::MPI::BlockVector &’ for 1st argument
void copy(TrilinosWrappers::MPI::BlockVector &out,
^
/InstallDirectory/aspect/source/simulator/stokes_matrix_free.cc:393:12: note: candidate function not viable: no known conversion from ‘LinearAlgebra::BlockVector’
(aka ‘dealii::PETScWrappers::MPI::BlockVector’) to ‘TrilinosWrappers::MPI::Vector &’ for 1st argument
void copy(TrilinosWrappers::MPI::Vector &out,
^
/InstallDirectory/aspect/source/simulator/stokes_matrix_free.cc:403:12: note: candidate function not viable: no known conversion from ‘LinearAlgebra::BlockVector’
(aka ‘dealii::PETScWrappers::MPI::BlockVector’) to ‘dealii::LinearAlgebra::distributed::Vector &’ for 1st argument
void copy(dealii::LinearAlgebra::distributed::Vector &out,
^
/InstallDirectory/aspect/source/simulator/stokes_matrix_free.cc:419:12: note: candidate function not viable: no known conversion from ‘LinearAlgebra::BlockVector’
(aka ‘dealii::PETScWrappers::MPI::BlockVector’) to ‘dealii::LinearAlgebra::distributed::BlockVector &’ for 1st argument
void copy(dealii::LinearAlgebra::distributed::BlockVector &out,

Is this something related to using PETSc as well?

Yes, we currently don’t compile when using PETSc. Even if we fix the obvious errors, it is unlikely that things “just work”. Please use Trilinos for now. You can follow https://github.com/geodynamics/aspect/issues/3338 for updates.