You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindMETIS.cmake 2.2 kB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Accepts the following variables:
  2. #
  3. # METIS_ROOT: Prefix where METIS is installed.
  4. # METIS_LIB_NAME: Name of the METIS library (default: metis).
  5. # METIS_LIBRARY: Full path of the METIS library.
  6. # Sets the following variables:
  7. #
  8. # METIS_LIBRARY: Full path of the METIS library.
  9. # METIS_FOUND: True if ParMETIS was found.
  10. # METIS_LIBRARIES: List of all libraries needed for linking with METIS,
  11. #
  12. # Provides the following macros:
  13. #
  14. # find_package(METIS)
  15. #
  16. # Searches for METIS (See above)
  17. # search metis header
  18. find_path(METIS_INCLUDE_DIR metis.h
  19. PATHS ${METIS_DIR} ${METIS_ROOT}
  20. PATH_SUFFIXES metis include include/metis Lib METISLib
  21. NO_DEFAULT_PATH
  22. DOC "Include directory of metis")
  23. find_path(METIS_INCLUDE_DIR metis.h
  24. PATH_SUFFIXES metis include include/metis Lib METISLib)
  25. set(METIS_LIBRARY METIS_LIBRARY-NOTFOUND CACHE FILEPATH "Full path of the METIS library")
  26. # search metis library
  27. if(NOT METIS_LIB_NAME)
  28. set(METIS_LIB_NAME metis)
  29. endif(NOT METIS_LIB_NAME)
  30. find_library(METIS_LIBRARY ${METIS_LIB_NAME}
  31. PATHS ${METIS_DIR} ${METIS_ROOT}
  32. PATH_SUFFIXES lib
  33. NO_DEFAULT_PATH)
  34. find_library(METIS_LIBRARY ${METIS_LIB_NAME}
  35. PATH_SUFFIXES lib
  36. )
  37. # behave like a CMake module is supposed to behave
  38. include(FindPackageHandleStandardArgs)
  39. find_package_handle_standard_args(
  40. "METIS"
  41. DEFAULT_MSG
  42. METIS_INCLUDE_DIR
  43. METIS_LIBRARY
  44. )
  45. mark_as_advanced(METIS_INCLUDE_DIR METIS_LIBRARIES METIS_LIB_NAME)
  46. # if both headers and library are found, store results
  47. if(METIS_FOUND)
  48. set(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
  49. set(METIS_LIBRARIES ${METIS_LIBRARY})
  50. # log result
  51. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
  52. "Determing location of METIS succeded:\n"
  53. "Include directory: ${METIS_INCLUDE_DIRS}\n"
  54. "Library directory: ${METIS_LIBRARIES}\n\n")
  55. else(METIS_FOUND)
  56. # log errornous result
  57. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
  58. "Determing location of METIS failed:\n"
  59. "Include directory: ${METIS_INCLUDE_DIRS}\n"
  60. "Library directory: ${METIS_LIBRARIES}\n\n")
  61. endif(METIS_FOUND)

分布式深度学习系统

Contributors (1)