Open stephankramer opened 5 years ago
I can't believe this never bit us before, thanks for seeing that. Can you please check PR #121 if it looks like the right fix ?
No sorry, doesn't seem to work for me. I don't know much about cmake but I found this to work:
FIND_PATH(METIS_INCLUDE_DIR
NAMES metis.h
HINTS ${METIS_DIR}
PATH_SUFFIXES "include" "include/metis"
)
message( STATUS ${METIS_INCLUDE_DIR} )
FIND_LIBRARY(METIS_LIBRARY
NAMES metis
HINTS ${METIS_DIR}
PATH_SUFFIXES "lib" "lib/metis"
)
This is based on what I saw in other packages with a FindMetis.cmake
. None of those seem to explicitly add /usr/lib and /usr/local/lib. I don't know if that's because it's not recommended practice, or because cmake looks for these automatically (depending on configuration I presume)?
I should clarify "doesn't work for me": it still picks up my system metis in /usr/.
That looks like what's in the cmake file for eigen, but I don' really understand that... I'll have to read more about Cmake to make sure we're not breaking things for other users, unless @ggorman knows...
I don't quite understand why your solution works neither why the current one does, after reading the doc: https://cmake.org/cmake/help/v3.0/command/find_path.html
If I read correctly,
- Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses. I assume PATH can be omitted and these are the current lines, and the lines should be read. I don't understand why the HINT is appropriate there
Conclusion: I don't understand. This has worked on so many platforms... (Of course I can't be sure it has not always picked the wrong metis, which happened to be miraculously compatible).
Are you using a specific version of cmake ? Maybe it's because $ENV{METIS_DIR} is prefixed with ENV ? Or maybe PATHS is missing in out config... I'd love to test these options but it doesn't fail on my machine...
I'm trying to build pragmatic as part of a petsc build. This is failing because pragmatic's configure picks up my system (/usr/lib) install of metis which conflicts with the one build by petsc. Here's the relevant bit from petsc's configure.log:
The reason it's picking up /usr/lib/x86_64-linux-gnu/libmetis.so.5 is because of the logic in pragmatic's CMake/Modules/FindMetis.cmake which seems to first check for /usr/local/ and /usr before trying METIS_DIR (as provided by petsc).