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

Merge branch 'feature/petsc' into 'develop'

Add a dirty trick to find/test PETSc

See merge request !56
parents ce1ec412 57bca577
No related branches found
No related tags found
1 merge request!56Add a dirty trick to find/test PETSc
......@@ -135,6 +135,10 @@ if(${MPI_FOUND})
message(FATAL_ERROR "MPI support requires ParMETIS which cannot be found!")
endif()
endif()
else()
if(PUGS_ENABLE_MPI MATCHES "^ON$")
message(FATAL_ERROR "Cannot find MPI!")
endif()
endif()
#------------------------------------------------------
......@@ -144,6 +148,7 @@ set(PUGS_ENABLE_PETSC AUTO CACHE STRING
"Choose one of: AUTO ON OFF")
if (PUGS_ENABLE_PETSC MATCHES "^(AUTO|ON)$")
cmake_policy(SET CMP0075 OLD)
find_package(PETSc)
set(PUGS_HAS_PETSC ${PETSC_FOUND})
else()
......@@ -152,6 +157,10 @@ endif()
if (${PETSC_FOUND})
include_directories(SYSTEM ${PETSC_INCLUDES})
else()
if (PUGS_ENABLE_PETSC MATCHES "^ON$")
message(FATAL_ERROR "Could not find PETSc!")
endif()
endif()
......
......@@ -278,7 +278,14 @@ int main(int argc,char *argv[]) {
return 0;
}
")
multipass_source_runs ("${includes}" "${libraries}" "${_PETSC_TEST_SOURCE}" ${runs} "${PETSC_LANGUAGE_BINDINGS}")
multipass_source_runs(
"${includes} ${MPI_CXX_INCLUDE_DIRS} ${MPI_CXX_COMPILER_INCLUDE_DIRS}"
"${libraries}"
"${_PETSC_TEST_SOURCE}"
${runs}
"${PETSC_LANGUAGE_BINDINGS}"
)
if (${${runs}})
set (PETSC_EXECUTABLE_RUNS "YES" CACHE BOOL
"Can the system successfully run a PETSc executable? This variable can be manually set to \"YES\" to force CMake to accept a given PETSc configuration, but this will almost always result in a broken build. If you change PETSC_DIR, PETSC_ARCH, or PETSC_CURRENT you would have to reset this variable." FORCE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment