#
# Populate correct variables:
#
- SET(MPI_LIBRARIES ${MPI_CXX_LIBRARIES})
+ SET(MPI_LIBRARIES
+ ${MPI_CXX_LIBRARIES} ${MPI_Fortran_LIBRARIES} ${MPI_C_LIBRARIES}
+ )
SET(MPI_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH})
SET(MPI_CXX_FLAGS ${MPI_CXX_COMPILE_FLAGS})
SET(MPI_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}")
##
## ---------------------------------------------------------------------
+IF(NOT FEATURE_MPI_PROCESSED)
+ MESSAGE(FATAL_ERROR "\n"
+ "Internal build system error:\n"
+ "configure_2_metis.cmake included before configure_1_mpi.cmake\n\n"
+ )
+ENDIF()
+
#
# Configuration for the metis library:
#
MACRO(FEATURE_METIS_FIND_EXTERNAL var)
FIND_PACKAGE(METIS)
- IF(METIS_FOUND AND METIS_VERSION_MAJOR GREATER 4)
+ IF(METIS_FOUND)
SET(${var} TRUE)
- ELSE()
- MESSAGE(STATUS "Insufficient metis installation found: "
- "Version 5.x required!"
- )
- SET(METIS_ADDITIONAL_ERROR_STRING
- "Could not find a sufficient modern metis installation: "
- "Version 5.x required!\n"
- )
+
+ IF(NOT METIS_VERSION_MAJOR GREATER 4)
+ MESSAGE(STATUS "Insufficient metis installation found: "
+ "Version 5.x required!"
+ )
+ SET(METIS_ADDITIONAL_ERROR_STRING
+ "Could not find a sufficient modern metis installation: "
+ "Version 5.x required!\n"
+ )
+ SET(${var} FALSE)
+ ENDIF()
+
+ CHECK_MPI_INTERFACE(METIS ${var})
ENDIF()
ENDMACRO()
SET(${var} FALSE)
ENDIF()
ENDIF()
+
+ CHECK_MPI_INTERFACE(TRILINOS ${var})
ENDIF()
ENDMACRO()
)
SET(${var} FALSE)
ENDIF()
+
+ CHECK_MPI_INTERFACE(PETSC ${var})
ENDIF()
ENDMACRO()
##
## ---------------------------------------------------------------------
+IF(NOT FEATURE_MPI_PROCESSED)
+ MESSAGE(FATAL_ERROR "\n"
+ "Internal build system error:\n"
+ "configure_hdf5.cmake included before configure_1_mpi.cmake\n\n"
+ )
+ENDIF()
+
#
# Configuration for the hdf5 library:
#
FIND_PACKAGE(HDF5)
IF(HDF5_FOUND)
- IF( (HDF5_WITH_MPI AND DEAL_II_WITH_MPI) OR
- (NOT HDF5_WITH_MPI AND NOT DEAL_II_WITH_MPI) )
- SET(${var} TRUE)
-
- ELSE()
+ SET(${var} TRUE)
+ IF( (HDF5_WITH_MPI AND NOT DEAL_II_WITH_MPI) OR
+ (NOT HDF5_WITH_MPI AND DEAL_II_WITH_MPI) )
MESSAGE(STATUS "Insufficient hdf5 installation found: "
"hdf5 has to be configured with the same MPI configuration as deal.II."
)
" DEAL_II_WITH_MPI = ${DEAL_II_WITH_MPI}\n"
" HDF5_WITH_MPI = ${HDF5_WITH_MPI}\n"
)
+ SET(${var} FALSE)
ENDIF()
+
+ CHECK_MPI_INTERFACE(HDF5 ${var})
ENDIF()
ENDMACRO()
SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI DEAL_II_WITH_LAPACK)
+
+MACRO(FEATURE_MUMPS_FIND_EXTERNAL var)
+ FIND_PACKAGE(MUMPS)
+
+ IF(MUMPS_FOUND)
+ SET(${var} TRUE)
+ CHECK_MPI_INTERFACE(MUMPS ${var})
+ ENDIF()
+ENDMACRO()
+
CONFIGURE_FEATURE(MUMPS)
)
SET(${var} FALSE)
ENDIF()
+
+ CHECK_MPI_INTERFACE(P4EST ${var})
ENDIF()
ENDMACRO()
--- /dev/null
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2014 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# Check whether a feature is compiled against the same MPI library as the
+# one deal.II picked up
+#
+# Usage:
+# CHECK_MPI_INTERFACE(_feature _var),
+#
+
+MACRO(CHECK_MPI_INTERFACE _feature _var)
+ IF(DEAL_II_WITH_MPI)
+ SET(_nope FALSE)
+
+ FOREACH(_library ${${_feature}_LIBRARIES})
+ IF(_library MATCHES "/libmpi[^/]*\\.so")
+ LIST(FIND MPI_LIBRARIES "${_library}" _position)
+ IF("${_position}" STREQUAL "-1")
+ SET(_nope TRUE)
+ SET(_mpi_library ${_library})
+ BREAK()
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+
+ IF(_nope)
+ MESSAGE(STATUS "Could not find a sufficient ${_feature} installation: "
+ "${_feature} is compiled against a different MPI library than the one "
+ "deal.II picked up."
+ )
+ TO_STRING(_str ${MPI_LIBRARIES})
+ SET(PETSC_ADDITIONAL_ERROR_STRING
+ ${PETSC_ADDITIONAL_ERROR_STRING}
+ "Could not find a sufficient ${_feature} installation:\n"
+ "${_feature} has to be compiled against the same MPI library as deal.II "
+ "but the link line of ${_feature} contains:\n"
+ " ${_mpi_library}\n"
+ "which is not listed in MPI_LIBRARIES:\n"
+ " MPI_LIBRARIES = \"${_str}\"\n"
+ )
+ SET(${_var} FALSE)
+ ENDIF()
+ ENDIF()
+ENDMACRO()
+
REGEX "^PETSC_WITH_EXTERNAL_LIB =.*")
SEPARATE_ARGUMENTS(PETSC_EXTERNAL_LINK_LINE)
- IF(NOT "${PETSC_EXTERNAL_LINK_LINE}" STREQUAL "${PETSC_EXTERNAL_LINK_LINE_SAVED}")
- SET(_new_petsc_external_link_line TRUE)
- ENDIF()
- SET(PETSC_EXTERNAL_LINK_LINE_SAVED "${PETSC_EXTERNAL_LINK_LINE}" CACHE INTERNAL "" FORCE)
-
SET(_hints)
SET(_petsc_libraries)
SET(_cleanup_variables)
# Search for every library that was specified with -l:
STRING(REGEX REPLACE "^-l" "" _token "${_token}")
- # TODO:
LIST(APPEND _cleanup_variables PETSC_LIBRARY_${_token})
- IF(_new_petsc_external_link_line)
- UNSET(PETSC_LIBRARY_${_token} CACHE)
- ENDIF()
IF(_token MATCHES "^(c|quadmath|gfortran|m|rt|nsl|dl|pthread)$")
FIND_SYSTEM_LIBRARY(PETSC_LIBRARY_${_token} NAMES ${_token})