Skip to content

[cmake] Simplify PETSc finding

Lars Bilke requested to merge bilke/ogs:petsc-find into master

Use pkg-config instead of FindPETSc.cmake. This is recommended since some time. Also removed some other unused CMake modules.

PETSc config now requires the pkg-config tool.

To use a custom PETSc install location use the CMAKE_PREFIX_PATH-variable, e.g.:

cmake --preset release-petsc -DCMAKE_PREFIX_PATH=$HOME/my_custom_petsc/arch-linux-c-opt

It should work if there is this file:

$HOME/my_custom_petsc/arch-linux-c-opt/lib/pkg-config/PETSc.pc

  1. Feature description was added to the changelog
  2. Added docs
Edited by Lars Bilke

Merge request reports