Skip to content
Snippets Groups Projects
Commit d48b9ee9 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fix MPI configuration result when MPI is found but not ParMETIS

Now if PUGS_ENABLE_MPI is set to `AUTO` (default value) and if MPI is detected
but not ParMETIS, then just throw a warning stating that MPI will not be used to
build binaries.

If PUGS_ENABLE_MPI is set to `ON` (user requires MPI), then since MPI building
cannot be made without ParMETIS, CMake throws a fatal error.
parent 0e3407a0
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,26 @@ if (PUGS_ENABLE_MPI MATCHES "^(AUTO|ON)$")
find_package(MPI)
endif()
#------------------------------------------------------
# Search for ParMETIS
if(${MPI_FOUND})
find_package(ParMETIS)
if (NOT PARMETIS_LIBRARIES)
if(PUGS_ENABLE_MPI MATCHES "^AUTO$")
message(WARNING "MPI support deactivated: ParMETIS cannot be found!")
unset(MPI_FOUND)
unset(MPI_CXX_LINK_FLAGS)
unset(MPI_CXX_LIBRARIES)
else()
message(FATAL_ERROR "MPI support requires ParMETIS which cannot be found!")
endif()
endif()
endif()
# -----------------------------------------------------
if (${MPI_FOUND})
set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} ${MPI_CXX_COMPILER_FLAGS}")
include_directories(SYSTEM ${MPI_CXX_INCLUDE_DIRS})
......@@ -308,13 +328,6 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
endif()
endif()
#------------------------------------------------------
# Search for ParMETIS
if(${MPI_FOUND})
find_package(ParMETIS REQUIRED)
endif()
# -----------------------------------------------------
link_libraries("-rdynamic")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment