message(STATUS"LAPACK not found but required for PETSc")
return()
endif()
find_package(X11QUIET)
if(X11_FOUND)
list(APPENDPETSC_X11_LIBRARY"${X11_LIBRARIES}")
endif()
# these variables must exist. Since not finding MPI, both the header and the
# object file , may not be an error, we want the option of concatenating the
# empty variable onto the PETSC_LIBRARIES/INCLUDE_DIRS lists
set(PETSC_MPI_LIBRARY"")
set(PETSC_MPI_INCLUDE_DIRS"")
find_package(MPI)
if(MPI_FOUND)
list(APPENDPETSC_MPI_LIBRARY"${MPI_LIBRARIES}")
set(PETSC_MPI_INCLUDE_DIRS${MPI_INCLUDE_PATH})
else(MPI_FOUND)
# if a system MPI wasn't found, look for PETSc's serial implementation. This
# won't be available if PETSc was compiled with --with-mpi=0, so not finding
# this won't be an error. This only needs to find the header, as the MPI
# implementation should be already be compiled into PETSc.
message(STATUS"Could not find a system provided MPI. Searching for PETSc provided mpiuni fallback implementation.")
find_path(PETSC_MPI_INCLUDE_DIRS
NAMES"mpi.h"
PATHS${PETSC_ROOT}/include
PATH_SUFFIXES"mpiuni"
${_no_default_path}
)
endif(MPI_FOUND)
if(NOTPETSC_MPI_INCLUDE_DIRS)
message(WARNING"Could not find any MPI implementation. If PETSc is compiled with --with-mpi=0 this is ok. Otherwise you will get linker errors or (possibly subtle) runtime errors. Continuing.")
if(NOTUSE_MPI)
message("To build with MPI support, pass -DUSE_MPI=ON to CMake.")