Lucas, There is something strange. When you separate the function somehow your executable depends on PETSc twice and for one of these two dependencies it cannot find PETSc. For the other PETSc object, the code is using /home/lucas/Application-Data/petsc/x86_64/lib/libpetsc.so.3.16 This usually happens if you have two different versions of a library installed and CMake tries to use both. Did you install PETSc twice? Since you only care about debugging the rest of your code, an easy and dirty way to make the code run is to type in your terminal
export LD_LIBRARY_PATH=home/lucas/Application-Data/petsc/x86_64/lib: $LD_LIBRARY_PATH This doesn't fix the problem that there are two PETSc objects but at least it should run. Best, Brun On Thursday, January 20, 2022 at 1:10:06 PM UTC-5 lucasm...@gmail.com wrote: > Bruno, > > Thanks for the quick response! > > Yes, I do get the error at runtime and I am running from the terminal. The > call in both cases is `mpirun -np 6 ./install/bin/examples/step-40`. The > output from ldd is in the attached file. > > - Lucas > > On Thursday, January 20, 2022 at 7:54:21 AM UTC-6 bruno.t...@gmail.com > wrote: > >> Lucas, >> >> Just to make sure, you get the error message at runtime right? Are you >> using the same terminal in both cases? Can you show the output of ldd on >> your executable and liddealii.so. >> >> Best, >> >> Bruno >> >> On Wednesday, January 19, 2022 at 3:27:40 PM UTC-5 lucasm...@gmail.com >> wrote: >> >>> Hi folks, >>> >>> For debugging purposes, I need to use the `distribute_local_to_global` >>> function which can distribute vectors and matrices separately (this guy >>> in the docs >>> <https://dealii.org/current/doxygen/deal.II/classAffineConstraints.html#ae02ed5ba9f1be9c34cf448a01b44abdb>). >>> >>> However, when I try to use this one instead of the function which >>> simultaneously distributes a vector and a matrix (this guy in the docs >>> <https://dealii.org/current/doxygen/deal.II/classAffineConstraints.html#abe83a7964b516856f5acb8046ec63a15>) >>> >>> it throws an `error while loading shared libraries: libpetsc.so.3.16: >>> cannot open shared object file: No such file or directory` error. >>> >>> For an example of the behavior, I just replaced the following on line >>> 416 of step-40: >>> >>> // constraints.distribute_local_to_global(cell_matrix, >>> // >>> cell_rhs, >>> // >>> local_dof_indices, >>> // >>> system_matrix, >>> // >>> system_rhs); >>> constraints.distribute_local_to_global(cell_matrix, >>> >>> local_dof_indices, >>> >>> system_matrix); >>> constraints.distribute_local_to_global(cell_rhs, >>> >>> local_dof_indices, >>> >>> system_rhs); >>> >>> This is sort of bizarre to me because (1) it doesn't throw the error in >>> the original tutorial case and (2) CMake ought to take care of the PETSc >>> dependency through the deal.II target. I've attached my detailed.log file >>> in case it's relevant. >>> >>> Any help figuring out the problem is appreciated! >>> >>> - Lucas >>> >> -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/9e691b0e-4c61-488e-8663-1c395c763999n%40googlegroups.com.