Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Failure with PETSC-Complex, Invalid Static Cast #15847

Closed
IntrepidNomad opened this issue Aug 6, 2023 · 3 comments · Fixed by #15852
Closed

Build Failure with PETSC-Complex, Invalid Static Cast #15847

IntrepidNomad opened this issue Aug 6, 2023 · 3 comments · Fixed by #15852

Comments

@IntrepidNomad
Copy link

[ 56%] Building CXX object source/matrix_free/CMakeFiles/object_matrix_free_debug.dir/evaluation_template_face_factory_inst4.cc.o
In file included from /home/***/AUR/deal-ii/src/dealii-9.5.1/include/deal.II/base/numbers.h:28,
                 from /home/***/AUR/deal-ii/src/build/include/deal.II/base/config.h:592,
                 from /home/***/AUR/deal-ii/src/dealii-9.5.1/include/deal.II/lac/petsc_sparse_matrix.h:20,
                 from /home/***/AUR/deal-ii/src/dealii-9.5.1/source/lac/petsc_parallel_sparse_matrix.cc:16,
                 from /home/***/AUR/deal-ii/src/build/source/lac/unity_1.cc:5:
/home/***/AUR/deal-ii/src/dealii-9.5.1/source/lac/petsc_vector_base.cc: In member function ‘void dealii::PETScWrappers::VectorBase::determine_ghost_indices()’:
/home/***/AUR/deal-ii/src/dealii-9.5.1/source/lac/petsc_vector_base.cc:280:20: error: invalid ‘static_cast’ from type ‘PetscScalar’ {aka ‘std::complex<double>’} to type ‘PetscInt’ {aka ‘int’}
  280 |             Assert(static_cast<PetscInt>(static_cast<PetscScalar>(
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  281 |                      ghost_start_index + i)) == (ghost_start_index + i),
      |                      ~~~~~~~~~~~~~~~~~~~~~~~
/home/***/AUR/deal-ii/src/dealii-9.5.1/source/lac/petsc_vector_base.cc:280:13: note: in expansion of macro ‘Assert’
  280 |             Assert(static_cast<PetscInt>(static_cast<PetscScalar>(
      |             ^~~~~~
make[2]: *** [source/lac/CMakeFiles/object_lac_debug.dir/build.make:90: source/lac/CMakeFiles/object_lac_debug.dir/unity_1.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2150: source/lac/CMakeFiles/object_lac_debug.dir/all] Error 2
@drwells
Copy link
Member

drwells commented Dec 30, 2023

That's because this is a bug with deal.II, not PETSc - it isn't fixed in 9.5.1.

@carlosal1015
Copy link

Many thanks for heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants