# MUMPS_INCLUDE_DIRS
# MUMPS_LIBRARIES
# MUMPS_LINKER_FLAGS
+# MUMPS_VERSION
+# MUMPS_VERSION_MAJOR
+# MUMPS_VERSION_MINOR
+# MUMPS_VERSION_SUBMINOR
#
SET_IF_EMPTY(MUMPS_DIR "$ENV{MUMPS_DIR}")
UNSET(PORD_LIBRARY CACHE)
ENDIF()
+IF(EXISTS ${MUMPS_INCLUDE_DIR}/dmumps_c.h)
+ FILE(STRINGS "${MUMPS_INCLUDE_DIR}/dmumps_c.h" MUMPS_VERSION_STRING
+ REGEX "#define.*MUMPS_VERSION")
+ STRING(REGEX REPLACE "^.*MUMPS_VERSION.*\"(.+)\".*" "\\1"
+ MUMPS_VERSION "${MUMPS_VERSION_STRING}"
+ )
+ STRING(REGEX REPLACE
+ "([0-9]+)\\..*" "\\1" MUMPS_VERSION_MAJOR "${MUMPS_VERSION}"
+ )
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.([0-9]+).*" "\\1" MUMPS_VERSION_MINOR "${MUMPS_VERSION}"
+ )
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" MUMPS_VERSION_SUBMINOR "${MUMPS_VERSION}"
+ )
+ENDIF()
+
SET(_output ${DMUMPS_LIBRARY} ${MUMPS_COMMON_LIBRARY} ${PORD_LIBRARY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUMPS DEFAULT_MSG
_output # Cosmetic: Gives nice output
# TBB_LIBRARIES
# TBB_INCLUDE_DIRS
# TBB_WITH_DEBUGLIB
+# TBB_VERSION
+# TBB_VERSION_MAJOR
+# TBB_VERSION_MINOR
#
INCLUDE(FindPackageHandleStandardArgs)
SET_IF_EMPTY(TBB_DIR "$ENV{TBB_DIR}")
-FIND_PATH(TBB_INCLUDE_DIR tbb/parallel_reduce.h
+FIND_PATH(TBB_INCLUDE_DIR tbb/tbb_stddef.h
HINTS
${TBB_DIR}
PATH_SUFFIXES include include/tbb tbb
TBB_INCLUDE_DIR
)
+IF(NOT TBB_INCLUDE_DIR MATCHES "-NOTFOUND")
+ FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MAJOR_STRING
+ REGEX "#define.*TBB_VERSION_MAJOR")
+ STRING(REGEX REPLACE "^.*TBB_VERSION_MAJOR.*([0-9]+).*" "\\1"
+ TBB_VERSION_MAJOR "${TBB_VERSION_MAJOR_STRING}"
+ )
+
+ FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MINOR_STRING
+ REGEX "#define.*TBB_VERSION_MINOR")
+ STRING(REGEX REPLACE "^.*TBB_VERSION_MINOR.*([0-9]+).*" "\\1"
+ TBB_VERSION_MINOR "${TBB_VERSION_MINOR_STRING}"
+ )
+
+ SET(TBB_VERSION
+ "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}"
+ )
+ENDIF()
+
MARK_AS_ADVANCED(
TBB_LIBRARY
TBB_DEBUG_LIBRARY
# UMFPACK_LIBRARIES
# UMFPACK_INCLUDE_DIRS
# UMFPACK_LINKER_FLAGS
+# UMFPACK_VERSION
+# UMFPACK_VERSION_MAJOR
+# UMFPACK_VERSION_MINOR
+# UMFPACK_VERSION_SUBMINOR
#
INCLUDE(FindPackageHandleStandardArgs)
FIND_UMFPACK_LIBRARY(CAMD camd)
FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig)
+IF(EXISTS ${UMFPACK_INCLUDE_DIR}/umfpack.h)
+ FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MAJOR_STRING
+ REGEX "#define.*UMFPACK_MAIN_VERSION")
+ STRING(REGEX REPLACE "^.*UMFPACK_MAIN_VERSION.*([0-9]+).*" "\\1"
+ UMFPACK_VERSION_MAJOR "${UMFPACK_VERSION_MAJOR_STRING}"
+ )
+ FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MINOR_STRING
+ REGEX "#define.*UMFPACK_SUB_VERSION")
+ STRING(REGEX REPLACE "^.*UMFPACK_SUB_VERSION.*([0-9]+).*" "\\1"
+ UMFPACK_VERSION_MINOR "${UMFPACK_VERSION_MINOR_STRING}"
+ )
+ FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_SUBMINOR_STRING
+ REGEX "#define.*UMFPACK_SUBSUB_VERSION")
+ STRING(REGEX REPLACE "^.*UMFPACK_SUBSUB_VERSION.*([0-9]+).*" "\\1"
+ UMFPACK_VERSION_SUBMINOR "${UMFPACK_VERSION_SUBMINOR_STRING}"
+ )
+ SET(UMFPACK_VERSION
+ "${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUBMINOR}"
+ )
+ENDIF()
+
SET(_output ${UMFPACK_LIBRARY} ${CHOLMOD_LIBRARY} ${CCOLAMD_LIBRARY} ${COLAMD_LIBRARY} ${CAMD_LIBRARY} ${AMD_LIBRARY} ${SuiteSparse_config_LIBRARY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG
_output # Cosmetic: Gives nice output
#
IF(DEFINED ${_feature}_VERSION)
_detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n")
+ ELSEIF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION)
+ _detailed("# TBB_VERSION = ${TBB_VERSION}\n")
ENDIF()
#
IF( # MPI:
_var2 MATCHES "^${_feature}_CXX_(COMPILER|COMPILE_FLAGS|LINK_FLAGS|LIBRARIES|INCLUDE_PATH)$" OR
# Boost:
- ( _feature MATCHES "BOOST" AND _var2 MATCHES "^Boost(_LIBRARIES|_INCLUDE_DIRS)$" ) OR
+ ( _feature MATCHES "BOOST" AND _var2 MATCHES "^Boost_(LIBRARIES|INCLUDE_DIRS)$" ) OR
# TBB:
- ( _feature MATCHES "THREADS" AND _var2 MATCHES "^TBB(_LIBRARIES|_INCLUDE_DIRS)$" ) OR
+ ( _feature MATCHES "THREADS" AND _var2 MATCHES "^TBB_(LIBRARIES|INCLUDE_DIRS)$" ) OR
# Generic:
( (NOT _var2 MATCHES "^(MPI|Boost)") AND
_var2 MATCHES "^${_feature}_(INCLUDE_DIRS|LIBRARIES|LINKER_FLAGS)$" )
# SET(MUMPS_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(MUMPS_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
# SET(MUMPS_LINKER_FLAGS "..." CACHE STRING "")
+# SET(MUMPS_VERSION "x.y.z" CACHE STRING "")
+# SET(MUMPS_VERSION_MAJOR "x" CACHE STRING "")
+# SET(MUMPS_VERSION_MINOR "y" CACHE STRING "")
+# SET(MUMPS_VERSION_SUBMINOR "z" CACHE STRING "")
#
# SET(PETSC_FOUND TRUE CACHE BOOL "")
# SET(PETSC_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(PETSC_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
-# SET(PETSC_VERSION "x.y.z." CACHE STRING "")
+# SET(PETSC_VERSION "x.y.z.p" CACHE STRING "")
# SET(PETSC_VERSION_MAJOR "x" CACHE STRING "")
# SET(PETSC_VERSION_MINOR "y" CACHE STRING "")
# SET(PETSC_VERSION_SUBMINOR "z" CACHE STRING "")
-# SET(PETSC_VERSION_PATCH "" CACHE STRING "")
+# SET(PETSC_VERSION_PATCH "p" CACHE STRING "")
# SET(PETSC_WITH_MPI_UNI FALSE CACHE BOOL "")
#
# SET(SLEPC_FOUND TRUE CACHE BOOL "")
# SET(SLEPC_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(SLEPC_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
-# SET(SLEPC_VERSION "x.y.z." CACHE STRING "")
+# SET(SLEPC_VERSION "x.y.z.p" CACHE STRING "")
# SET(SLEPC_VERSION_MAJOR "x" CACHE STRING "")
# SET(SLEPC_VERSION_MINOR "y" CACHE STRING "")
# SET(SLEPC_VERSION_SUBMINOR "z" CACHE STRING "")
-# SET(SLEPC_VERSION_PATCH "" CACHE STRING "")
+# SET(SLEPC_VERSION_PATCH "p" CACHE STRING "")
# SET(SLEPC_WITH_MPI_UNI FALSE CACHE BOOL "")
#
# SET(TBB_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(TBB_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
# SET(TBB_WITH_DEBUGLIB TRUE CACHE BOOL "")
+# SET(TBB_VERSION "x.y" CACHE STRING "")
+# SET(TBB_VERSION_MAJOR "x" CACHE STRING "")
+# SET(TBB_VERSION_MINOR "y" CACHE STRING "")
#
# SET(TRILINOS_FOUND TRUE CACHE BOOL "")
# SET(TRILINOS_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(TRILINOS_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
+# SET(TRILINOS_VERSION "x.y.z" CACHE STRING "")
# SET(TRILINOS_VERSION_MAJOR "x" CACHE STRING "")
# SET(TRILINOS_VERSION_MINOR "y" CACHE STRING "")
# SET(TRILINOS_VERSION_SUBMINOR "z" CACHE STRING "")
# SET(UMFPACK_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(UMFPACK_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
# SET(UMFPACK_LINKER_FLAGS "..." CACHE STRING "")
+# SET(UMFPACK_VERSION "x.y.z" CACHE STRING "")
+# SET(UMFPACK_VERSION_MAJOR "x" CACHE STRING "")
+# SET(UMFPACK_VERSION_MINOR "y" CACHE STRING "")
+# SET(UMFPACK_VERSION_SUBMINOR "z" CACHE STRING "")
#