Rewrite FindMETIS to provide imported targets
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
Merge request reports
Activity
changed milestone to %New CMake Build-System
added buildsystem label
mentioned in merge request !822 (merged)
- Resolved by Simon Praetorius
Dune requires version METIS >= 5.0, right? At least, this is stated in the old cmake find module. Scotch implements the interface for METIS 4, even in the Scotch 6.0. So, do we really want to support Scotch-METIS here? If yes, we should add an interface layer to call the different METIS versions, like we have done for the
idx_t
andreal_t
types inrepartition.hh
in dune-istl. Since METIS is provided by dune-common, this layer should be in dune-common as well.
mentioned in issue dune-istl#94
added 35 commits
-
58f16ca8...0febb2ae - 28 commits from branch
master
- 41d646df - Rewrite FindMETIS to provide imported targets
- 4934bb32 - Detection of Scotch requirement corrected
- fe1bc923 - Test for METIS and the FindMETIS package added
- 22fe282c - Remove unnecessary two-stage find procesures
- 63744eea - Move HAVE_METIS and dune_register_package_flags to AddMETISFlags
- 314335cc - Allow for using scotchmetis by providing typedefs
- 41eaf689 - update test for scotch-metis in FindMETIS
Toggle commit list-
58f16ca8...0febb2ae - 28 commits from branch
In summary:
- scotchmetis does not provide a full METIS implementation, but just wrappers around some functions.
- scotchparmetis does not need scotchmetis, but just scotch
- source, debian, open-suse, fedora packages, all provide the scotchmetis library in a different form
- we have scotchmetis as package in the docker CI images
Proposal:
- Provide scotchmetis only on request, e.g. by introducing an option, or a package component
- By default, metis needs to specify its version. If scotch is requested, set version to API compatibility version: version 3 for scotch < 6.07, else version 5 if METIS version 5 is requested, otherwise version 3 as well
- Provide METIS API version in config.h file: e.g.
METIS_API_VERSION = METIS_VER_MAJOR
- Provide flag whether scotchmetis is enable in config.h file: e.g.
HAVE_SCOTCH_METIS=1
- follow a similar strategy for parmetis.
Edited by Simon Praetorius- Resolved by Oliver Sander
I'd try to reduce the number of combinations. Otherwise it will be difficult to test. I propose the limit the support of PT Scotch to 6.0.7 or newer. The problem is Debian (buster has 6.0.6, bullseye will provide 6.0.9). Ubuntu comes with 6.0.7 or newer since 19.10.
@markus.blatt Do you have any version restrictions regarding Scotch? Or do you know some of the projects you are involved?
- Resolved by Simon Praetorius
Thanks. Seems to work on Debian stable. Can we add some more documentation on the
SCOTCH_METIS_VERSION
? I do not understand what to put there.Edited by Markus Blatt
mentioned in issue infrastructure/issues0#64 (closed)
mentioned in merge request !856 (merged)
added 1 commit
- c5679e82 - extended the documentation of the SCOTCH_METIS_VERSION variable
added 56 commits
-
c5679e82...17685a51 - 46 commits from branch
master
- 6844cbc2 - Rewrite FindMETIS to provide imported targets
- f742dfbf - Detection of Scotch requirement corrected
- d60ee118 - Test for METIS and the FindMETIS package added
- 361ad03a - Remove unnecessary two-stage find procesures
- 5493549b - Move HAVE_METIS and dune_register_package_flags to AddMETISFlags
- fb787206 - Allow for using scotchmetis by providing typedefs
- a3981673 - update test for scotch-metis in FindMETIS
- 937aad3a - rewritten find scotch-metis and metistest
- 8a28ec9b - search for Scotch component only
- c497fe46 - extended the documentation of the SCOTCH_METIS_VERSION variable
Toggle commit list-
c5679e82...17685a51 - 46 commits from branch
- Resolved by Simon Praetorius
- Resolved by Simon Praetorius
added 5 commits
-
3fc9ad0b...4dced988 - 4 commits from branch
master
- 335d9f24 - Rewrite FindMETIS module
-
3fc9ad0b...4dced988 - 4 commits from branch
enabled an automatic merge when the pipeline for 335d9f24 succeeds
mentioned in commit acb90738
mentioned in issue #222 (closed)