Bruno, You're saying I just need to export the path before running the executable? If that is the case, it is still not working for whatever reason (still giving the linker error).
As for two PETSc installations: I vaguely recall trying to install it to root and then quickly trying to undo it after reading the warning in the PETSc manual. I'm not sure if that caused the problem, but do you have any tips on sussing it out? That is, how do I find where in the compilation process the executable is being linked to PETSc twice? And how does cmake know that there could be two (possibly deleted) versions of PETSc? It seems like the deal.II installation knows where to find the PETSc shared library given the output of ldd (and the variables set in the detailed.log). A final bit of information: the linker error only happens when I call the `distribute_local_to_global` function that has calling signature `(local_vector, local_dof_indices, global_vector)`. Both the mixed and matrix equivalent work fine, even when called together. Let me know if you have any ideas about where to get started. - Lucas On Thursday, January 20, 2022 at 12:55:27 PM UTC-6 bruno.t...@gmail.com wrote: > 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/83139f32-846d-4583-b817-a29808f1ac17n%40googlegroups.com.