[cmake] Call FindMETIS from FindParMETIS
Thanks to Simon Praetorius for providing the patch idea.
Merge request reports
Activity
changed milestone to %DUNE 2.7.0
added bug label
mentioned in merge request dune-grid!355 (merged)
added 1 commit
- 746e8821 - [bugfix][cmake] Don't abort cmake config when METIS is not found.
The problem @robert.kloefkorn pointed out in dune-grid!355 (merged) is probably that on some systems you can install ParMETIS without installing METIS separately. Then you need to search for
metis.h
in the ParMETIS directory and not only in the METIS directory (what is done byFindMETIS.cmake
. A solution could be to add additional search directories tofind_file
orfind_library
whenfind_package(METIS)
is called insideFindParMETIS.cmake
, or maybe one can setif(NOT METIS_DIR) set(METIS_DIR ${PARMETIS_DIR}) endif(NOT METIS_DIR)
or something similar, before calling
find_package(METIS)
.@simon.praetorius Such ParMETIS installations exist? Your idea seems to be right. Can you provide a merge request and assign it to me? I'll merge this nevertheless because I hope to fix the code I broke.
46 46 if(NOT METIS_FOUND) 47 47 find_package_handle_standard_args( 48 48 "ParMETIS" 49 FAIL_MESSAGE "METIS not found which is required for ParMETIS." 49 WARNING_MESSAGE "METIS not found which is required for ParMETIS. Aborting ParMETIS search!" changed this line in version 3 of the diff
- Resolved by Christoph Grüninger
An example installation of ParMETIS in non-system location is a download-all installation of PETSc. There, all includes are in the same directory and also all libraries. So, if you specify
PARMETIS_DIR=PETSC_DIR
but notMETIS_DIR
, METIS is not found.In the old
FindParMETIS.cmake
there was a comment, that there is an "installation bug in ParMETIS 4.0.3" that forces you to "copy [metis.h] manually next to parmetis.h", becauseCMAKE_REQUIRED_INCLUDES
was set toPARMETIS_INCLUDE_DIR
. But, whenMETIS_FOUND
was already true before, maybe the search was skipped completly(?)Tree solutions:
- If you want to use ParMETIS, your also have to specify
METIS_DIR
- We set additional search PATHS or HINTS to
find_path
andfind_library
inFindMETIS.cmake
depending onPARMETIS_DIR
- We set
METIS_DIR
toPARMETIS_DIR
in case the former is not defined and with this adjust the search paths.
- If you want to use ParMETIS, your also have to specify
enabled an automatic merge when the pipeline for d85085a0 succeeds
mentioned in commit 6f0293eb
@gruenich: Your patch still breaks my tool chain. I'm tending to revert all the related patches since it seems impossible to implement a decent fix.
@gruenich: I fixed your stuff in !714 (merged) and now stay away from quick cmake fixes plz. Obviously, the test suite for cmake is not sufficient to just run it in the CI. It needs to be fixed because changes in dune-common can affect a lot of down stream modules. And there is a quite a number of different combinations that need to be checked. I doubt that you have done that nor that you have the time for it.