Commit d094de64 authored by PRUVOST Florent's avatar PRUVOST Florent

add test functions for Finds METIS, PARMETIS, SCOTCH, PTSCOTCH

parent e6e10a2e
......@@ -169,6 +169,36 @@ else ()
endif()
endif ()
if(METIS_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${METIS_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${METIS_LIBRARIES}")
if (METIS_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${METIS_LIBRARY_DIRS}")
endif()
unset(METIS_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(METIS_NodeND METIS_WORKS)
mark_as_advanced(METIS_WORKS)
if(METIS_WORKS)
set(METIS_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
else()
if(NOT METIS_FIND_QUIETLY)
message(STATUS "Looking for METIS : test of METIS_NodeND with METIS library fails")
message(STATUS "METIS_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "METIS_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "METIS_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for METIS : set METIS_LIBRARIES to NOTFOUND")
endif()
set(METIS_LIBRARIES "METIS_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(METIS_LIBRARIES)
# check that METIS has been found
# ---------------------------------
......
......@@ -188,12 +188,43 @@ else ()
set(PARMETIS_LIBRARY_DIRS "PARMETIS_LIBRARY_DIRS-NOTFOUND")
if (NOT PARMETIS_FIND_QUIETLY)
message(STATUS "Looking for parmetis -- lib parmetis not found")
endif
endif()
endif ()
if(PARMETIS_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${PARMETIS_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${PARMETIS_LIBRARIES}")
if (PARMETIS_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${PARMETIS_LIBRARY_DIRS}")
endif()
unset(PARMETIS_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(ParMETIS_V3_NodeND PARMETIS_WORKS)
mark_as_advanced(PARMETIS_WORKS)
if(PARMETIS_WORKS)
set(PARMETIS_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
else()
if(NOT PARMETIS_FIND_QUIETLY)
message(STATUS "Looking for PARMETIS : test of ParMETIS_V3_NodeND with PARMETIS library fails")
message(STATUS "PARMETIS_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "PARMETIS_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "PARMETIS_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for PARMETIS : set PARMETIS_LIBRARIES to NOTFOUND")
endif()
set(PARMETIS_LIBRARIES "PARMETIS_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(PARMETIS_LIBRARIES)
# check that PARMETIS has been found
# ---------------------------------
# ----------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PARMETIS DEFAULT_MSG
PARMETIS_LIBRARIES
......
......@@ -78,6 +78,15 @@ if( PTSCOTCH_FIND_COMPONENTS )
endforeach()
endif()
# PTSCOTCH may depend on Threads, try to find it
if (NOT THREADS_FOUND)
find_package(Threads)
endif()
# PTSCOTCH may depend on MPI, try to find it
if (NOT MPI_FOUND)
find_package(MPI)
endif()
# Looking for include
# -------------------
......@@ -180,7 +189,7 @@ else()
PATH_SUFFIXES lib lib32 lib64)
endforeach()
else()
foreach(scotch_lib ${PTSCOTCH_libs_to_find})
foreach(ptscotch_lib ${PTSCOTCH_libs_to_find})
set(PTSCOTCH_${ptscotch_lib}_LIBRARY "PTSCOTCH_${ptscotch_lib}_LIBRARY-NOTFOUND")
find_library(PTSCOTCH_${ptscotch_lib}_LIBRARY
NAMES ${ptscotch_lib}
......@@ -212,6 +221,48 @@ foreach(ptscotch_lib ${PTSCOTCH_libs_to_find})
endforeach()
if(PTSCOTCH_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${PTSCOTCH_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${PTSCOTCH_LIBRARIES}")
if(CMAKE_THREAD_LIBS_INIT)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
endif()
if (PTSCOTCH_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${PTSCOTCH_LIBRARY_DIRS}")
endif()
if (MPI_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_PATH}")
if (MPI_C_LINK_FLAGS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${MPI_C_LINK_FLAGS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}")
endif()
unset(PTSCOTCH_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(SCOTCH_dgraphInit PTSCOTCH_WORKS)
mark_as_advanced(PTSCOTCH_WORKS)
if(PTSCOTCH_WORKS)
set(PTSCOTCH_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
else()
if(NOT PTSCOTCH_FIND_QUIETLY)
message(STATUS "Looking for PTSCOTCH : test of SCOTCH_dgraphInit with PTSCOTCH library fails")
message(STATUS "PTSCOTCH_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "PTSCOTCH_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "PTSCOTCH_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for PTSCOTCH : set PTSCOTCH_LIBRARIES to NOTFOUND")
endif()
set(PTSCOTCH_LIBRARIES "PTSCOTCH_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(PTSCOTCH_LIBRARIES)
# Check the size of SCOTCH_Num
# ---------------------------------
set(CMAKE_REQUIRED_INCLUDES ${PTSCOTCH_INCLUDE_DIRS})
......
......@@ -214,12 +214,12 @@ if(QUARK_LIBRARIES)
set(QUARK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
else()
if(NOT QUARK_FIND_QUIETLY)
message(STATUS "Looking for quark : test of QUARK_New with quark library fails")
message(STATUS "Looking for QUARK : test of QUARK_New with QUARK library fails")
message(STATUS "QUARK_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "QUARK_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "QUARK_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for quark : set QUARK_LIBRARIES to NOTFOUND")
message(STATUS "Looking for QUARK : set QUARK_LIBRARIES to NOTFOUND")
endif()
set(QUARK_LIBRARIES "QUARK_LIBRARIES-NOTFOUND")
endif()
......
......@@ -71,6 +71,10 @@ if( SCOTCH_FIND_COMPONENTS )
endforeach()
endif()
# PTSCOTCH may depend on Threads, try to find it
if (NOT THREADS_FOUND)
find_package(Threads)
endif()
# Looking for include
# -------------------
......@@ -205,6 +209,41 @@ foreach(scotch_lib ${SCOTCH_libs_to_find})
endforeach()
if(SCOTCH_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${SCOTCH_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${SCOTCH_LIBRARIES}")
if(CMAKE_THREAD_LIBS_INIT)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
endif()
if (SCOTCH_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${SCOTCH_LIBRARY_DIRS}")
endif()
unset(SCOTCH_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(SCOTCH_graphInit SCOTCH_WORKS)
mark_as_advanced(SCOTCH_WORKS)
if(SCOTCH_WORKS)
set(SCOTCH_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
else()
if(NOT SCOTCH_FIND_QUIETLY)
message(STATUS "Looking for SCOTCH : test of SCOTCH_graphInit with SCOTCH library fails")
message(STATUS "SCOTCH_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "SCOTCH_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "SCOTCH_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for SCOTCH : set SCOTCH_LIBRARIES to NOTFOUND")
endif()
set(SCOTCH_LIBRARIES "SCOTCH_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(SCOTCH_LIBRARIES)
# Check the size of SCOTCH_Num
# ---------------------------------
set(CMAKE_REQUIRED_INCLUDES ${SCOTCH_INCLUDE_DIRS})
......
......@@ -169,6 +169,17 @@ if(PKG_CONFIG_EXECUTABLE)
endif(PKG_CONFIG_EXECUTABLE)
# STARPU may depend on CUDA, try to find it
if (NOT CUDA_FOUND)
find_package(CUDA)
endif()
# STARPU may depend on MPI, try to find it
if (NOT MPI_FOUND)
find_package(MPI)
endif()
if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
( STARPU_LOOK_FOR_MPI AND (NOT STARPU_MPI_FOUND OR NOT STARPU_MPI_LIBRARIES) )
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment