Skip to content
Snippets Groups Projects
Commit c92679d8 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

[Cmake][Bugfix] Fix FindMETIS by adding -lm to the link flags

It needs to be linked in some cases. The way of checking whether
it is needed is taken from Find{BLAS,LAPACK}.cmake . This fix was
needed as part of a larger fix for the test of parallel alugrid.
parent 13de6088
No related branches found
No related tags found
No related merge requests found
......@@ -47,10 +47,14 @@ find_library(METIS_LIBRARY ${METIS_LIB_NAME}
PATH_SUFFIXES lib
)
# we need to check whether we need to link m, copy the lazy solution from FindBLAS and FindLAPACK here.
if(NOT WIN32)
list(APPEND METIS_LIBRARY "-lm")
endif()
# check metis library
if(METIS_LIBRARY)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${METIS_LIBRARY})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${METIS_LIBRARY})
include(CheckFunctionExists)
check_function_exists(METIS_PartGraphKway HAVE_METIS_PARTGRAPHKWAY)
endif(METIS_LIBRARY)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment