Yingjie Wu <yjw...@gmail.com> writes: > Hi, > > I installed the latest version of petsc, and compiled the example using > cmke as described above. Compilation can be done, but there is a new > problem while the program is running, as if the program could not find the > shared library libpetsc.so.3.12. How can I solve this problem?
Either export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib or set RPATH in CMake: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling CMake's FindPkgConfig punts on this front (and it's sadly complicated, but they broke their own conventions to get here). It's been 10 years and they've had no interest in fixing some of the problems that my modules were created to handle. I stopped using CMake by choice long ago so I'd prefer to gently steer people toward something (FindPkgConfig) that I'm not on the hook to maintain.