Skip to content

Rewrite FindMETIS to provide imported targets

Simon Praetorius requested to merge feature/find_metis into master

Summary

This MR adds imported-targets to the FindMETIS.cmake module, following modern cmake guidelines.

Details

Instead of exporting include directories and libraries as variables, the find modules exports an imported target that contains all the necessary information to include and link METIS. The find module introduces the imported target: METIS::METIS.

Scotch-METIS

If you want to use scotch-metis is (partially) compatible library replacement, you have to set the option ENABLE_SCOTCH_METIS to true. It is an explicit option, since the scotch-metis library is not really compatible to metis. It provides only a small subset of the functions, with slightly different parameters and in some versions a missing return value. So, you have to program scotch-metis differently from METIS. If enabled, the Scotch library is search for by FindPTScotch and METIS is linked against PTScotch::Scotch if found. In this case the preprocessor constant HAVE_SCOTCH_METIS is set.

Depending the version of Scotch, a different METIS API version is provided. Scotch < 6.0.7 provides only METIS API 3, but with Scotch 6.0.9 both APIs (3 or 5) are possible. Whether Scotch ships a compiled METIS API 5 or 3 depends on how scotchmetis was compiled. For recent Scotch libraries you have to provide the additional cmake variable SCOTCH_METIS_VERSION=(3|5) to tell cmake how Scotch is compiled. The API version of METIS is provided as preprocessor constant METIS_API_VERSION and typically corresponds to the METIS major version.

Depends on !820 (merged) for linking against PTScotch::Scotch

ToDo

  • Check for the failing Pipelines
  • Design a proper test for the functionality of METIS
  • Test Scotch backend for METIS
Edited by Simon Praetorius

Merge request reports

Loading