MACRO(FEATURE_METIS_FIND_EXTERNAL var)
FIND_PACKAGE(METIS)
- IF(METIS_FOUND AND METIS_MAJOR GREATER 4)
- SET(${var} TRUE)
- ELSE()
- MESSAGE(WARNING "\n"
- "Could not find a sufficient modern metis installation: "
- "Version 5.x required!\n\n"
- )
- ENDIF()
+ #IF(METIS_FOUND AND METIS_MAJOR GREATER 4)
+ # SET(${var} TRUE)
+ #ELSE()
+ # MESSAGE(WARNING "\n"
+ # "Could not find a sufficient modern metis installation: "
+ # "Version 5.x required!\n\n"
+ # )
+ #ENDIF()
ENDMACRO()
#
# Try to find the AMD library
#
+# This is a helper module for FindUMFPACK.cmake
+#
# This module exports
#
# AMD_LIBRARY
--- /dev/null
+#
+# Try to find the SuiteSparse_config package
+#
+# This is a helper module for FindUMFPACK.cmake
+#
+# This module exports
+#
+# SUITESPARSECONFIG_LIBRARY
+# SUITESPARSECONFIG_INCLUDE_DIR
+#
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+SET_IF_EMPTY(UMFPACK_DIR "$ENV{UMFPACK_DIR}")
+SET_IF_EMPTY(SUITESPARSE_DIR "$ENV{SUITESPARSECONFIG_DIR}")
+
+FIND_PATH(SUITESPARSECONFIG_INCLUDE_DIR SuiteSparse_config.h
+ HINTS
+ ${UMFPACK_DIR}
+ ${SUITESPARSECONFIG_DIR}
+ PATH_SUFFIXES
+ include SuiteSparse_config ../SuiteSparse_config
+)
+
+FIND_LIBRARY(SUITESPARSECONFIG_LIBRARY
+ NAMES suitesparseconfig
+ HINTS
+ ${UMFPACK_DIR}
+ ${SUITESPARSECONFIG_DIR}
+ PATH_SUFFIXES
+ lib${LIB_SUFFIX} lib64 lib SuiteSparse_config ../SuiteSparse_config
+ )
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SUITESPARSECONFIG DEFAULT_MSG
+ SUITESPARSECONFIG_LIBRARY
+ SUITESPARSECONFIG_INCLUDE_DIR
+ )
+
+IF(SUITESPARSECONFIG_FOUND)
+ MARK_AS_ADVANCED(
+ SUITESPARSECONFIG_LIBRARY
+ SUITESPARSECONFIG_INCLUDE_DIR
+ SUITESPARSECONFIG_DIR
+ )
+ELSE()
+ SET(SUITESPARSECONFIG_DIR "" CACHE STRING
+ "An optional hint to a SuiteSparse_config directory"
+ )
+ENDIF()
+
INCLUDE(FindPackageHandleStandardArgs)
-SET_IF_EMPTY(AMD_DIR "$ENV{AMD_DIR}")
SET_IF_EMPTY(UMFPACK_DIR "$ENV{UMFPACK_DIR}")
#
FIND_PATH(UMFPACK_INCLUDE_DIR umfpack.h
HINTS
- ${AMD_DIR}
${UMFPACK_DIR}
PATH_SUFFIXES
umfpack include/umfpack include Include UMFPACK/Include ../UMFPACK/Include
lib${LIB_SUFFIX} lib64 lib Lib UMFPACK/Lib ../UMFPACK/Lib
)
+SET(required_variables
+ blas_LIBRARY
+ AMD_INCLUDE_DIR
+ AMD_LIBRARY
+ UMFPACK_INCLUDE_DIRS
+ UMFPACK_LIBRARY
+ )
+
+#
+# Well, recent versions of UMFPACK >= 5.6 include SuiteSparse_config.h, if so,
+# ensure that we'll find these headers as well.
+#
+IF(NOT UMFPACK_INCLUDE_DIR MATCHES "-NOTFOUND")
+ FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_SUITESPARSE_STRING
+ REGEX "#include \"SuiteSparse_config.h\"")
+ IF(NOT "${UMFPACK_SUITESPARSE_STRING}" STREQUAL "")
+ FIND_PACKAGE(SUITESPARSECONFIG)
+ LIST(APPEND required_variables
+ SUITESPARSECONFIG_LIBRARY
+ SUITESPARSECONFIG_INCLUDE_DIR
+ )
+ ENDIF()
+ENDIF()
+#
+# Otherwise, we're lazy for the moment.
+#
+
SET(UMFPACK_LIBRARIES
${UMFPACK_LIBRARY}
${AMD_LIBRARY}
+ ${SUITESPARSECONFIG_LIBRARY} # may be empty
${BLAS_LIBRARIES}
)
SET(UMFPACK_INCLUDE_DIRS
${UMFPACK_INCLUDE_DIR}
+ ${SUITESPARSECONFIG_INCLUDE_DIR} # may be empty
${AMD_INCLUDE_DIR}
)
${BLAS_LINKER_FLAGS}
)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG
- UMFPACK_LIBRARIES
- UMFPACK_INCLUDE_DIRS
- )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG ${required_variables})
IF(UMFPACK_FOUND)
MARK_AS_ADVANCED(
UMFPACK_LIBRARY
UMFPACK_INCLUDE_DIR
UMFPACK_DIR
- AMD_LIBRARY
- AMD_INCLUDE_DIR
- lapack_LIBRARY
atlas_LIBRARY
blas_LIBRARY
)