# Petsc has to be configured with the same MPI configuration as
# deal.II.
#
- # petscconf.h should export PETSC_HAVE_MPIUNI 1 in case mpi support is
+ # petscconf.h should export PETSC_HAVE_MPIUNI 1 in case mpi support is
# _NOT_ enabled.
# So we check for this:
#
SET(${var} FALSE)
ENDIF()
+
+ #
+ # Petsc has to be configured with the same number of bits for indices as
+ # deal.II.
+ #
+ # petscconf.h should export PETSC_WITH_64BIT_INDICES 1 in case 64bits
+ # indices support is enabled.
+ # So we check for this:
+ #
+ IF( (NOT PETSC_WITH_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES)
+ OR
+ (PETSC_WITH_64BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES))
+ MESSAGE(STATUS "Could not find a sufficient PETSc installation: "
+ "PETSc has to be configured to use the same number of bits for the "
+ "global indices as deal.II."
+ )
+ SET(PETSC_ADDITIONAL_ERROR_STRING
+ ${PETSC_ADDITIONAL_ERROR_STRING}
+ "Could not find a sufficient PETSc installation:\n"
+ "PETSc has to be configured to use the same number of bits for the "
+ "global indices as deal.II, but found:\n"
+ " DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+ " PETSC_WITH_64BIT_INDICES = (${PETSC_WITH_64BIT_INDICES})\n"
+ )
+ SET(${var} FALSE)
+ ENDIF()
+
IF(NOT ${var})
UNSET(PETSC_INCLUDE_DIR_ARCH CACHE)
UNSET(PETSC_INCLUDE_DIR_COMMON CACHE)
SET(${var} FALSE)
ENDIF()
+ #
+ # Trilinos has to be configured with 32bit indices if deal.II uses unsigned long
+ # long int.
+ #
+ IF(TRILINOS_WITH_NO_32BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES)
+ MESSAGE(STATUS "deal.II was configured to use 32bit global indices but "
+ "Trilinos was not."
+ )
+ SET(TRILINOS_ADDITIONAL_ERROR_STRING
+ ${TRILINOS_ADDITIONAL_ERROR_STRING}
+ "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n"
+ "has to be configured to use the same number of bits as deal.II, but "
+ "found:\n"
+ " DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+ " TRILINOS_WITH_NO_32BIT_INDICES = ${TRILINOS_WITH_NO_32_BIT_INDICES}\n"
+ )
+ SET(${var} FALSE)
+ ENDIF()
+
+ #
+ # Trilinos has to be configured with 64bit indices if deal.II uses unsigned long
+ # long int.
+ #
+ IF(TRILINOS_WITH_NO_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES)
+ MESSAGE(STATUS "deal.II was configured to use 64bit global indices but "
+ "Trilinos was not."
+ )
+ SET(TRILINOS_ADDITIONAL_ERROR_STRING
+ ${TRILINOS_ADDITIONAL_ERROR_STRING}
+ "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n"
+ "has to be configured to use the same number of bits as deal.II, but "
+ "found:\n"
+ " DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+ " TRILINOS_WITH_NO_64BIT_INDICES = ${TRILINOS_WITH_NO_64_BIT_INDICES}\n"
+ )
+ SET(${var} FALSE)
+ ENDIF()
+
#
- # Some verions of Sacado_cmath.hpp does things that aren't compatible
+ # Some versions of Sacado_cmath.hpp do things that aren't compatible
# with the -std=c++0x flag of GCC, see deal.II FAQ.
# Test whether that is indeed the case
#
# PETSC_VERSION_SUBMINOR
# PETSC_VERSION_PATCH
# PETSC_WITH_MPIUNI
+# PETSC_WITH_64BIT_INDICES
#
INCLUDE(FindPackageHandleStandardArgs)
SET(PETSC_WITH_MPIUNI TRUE)
ENDIF()
+ #
+ # Is petsc compiled with support for 64BIT_INDICES?
+ #
+ FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_64BIT_INDICES_STRING
+ REGEX "#define.*PETSC_USE_64BIT_INDICES 1")
+ IF("${PETSC_64BIT_INDICES_STRING}" STREQUAL "")
+ SET(PETSC_WITH_64BIT_INDICES FALSE)
+ ELSE()
+ SET(PETSC_WITH_64BIT_INDICES TRUE)
+ ENDIF()
+
FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING
REGEX "#define.*PETSC_VERSION_MAJOR")
STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1"
TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
#
- # Determine whether Trilinos was configured with MPI:
+ # Determine whether Trilinos was configured with MPI and 64bit indices:
#
FIND_FILE(EPETRA_CONFIG_H Epetra_config.h
HINTS ${TRILINOS_INCLUDE_DIRS}
ELSE()
SET(TRILINOS_WITH_MPI TRUE)
ENDIF()
+ FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_32BIT_STRING
+ REGEX "#define EPETRA_NO_32BIT_GLOBAL_INDICES")
+ IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+ SET(TRILINOS_WITH_NO_32BITS_INDICES TRUE)
+ ELSE()
+ SET(TRILINOS_WITH_NO_32BITS_INDICES FALSE)
+ ENDIF()
+ FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_64BIT_STRING
+ REGEX "#define EPETRA_NO_64BIT_GLOBAL_INDICES")
+ IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+ SET(TRILINOS_WITH_NO_64BITS_INDICES TRUE)
+ ELSE()
+ SET(TRILINOS_WITH_NO_64BITS_INDICES FALSE)
+ ENDIF()
UNSET(EPETRA_CONFIG_H CACHE)
std::cout << "dealii-feature: LibZ=yes" << std::endl;
#endif
+#ifdef DEAL_II_WITH_64BIT_INDICES
+ std::cout << "dealii-feature: 64bit_indices=yes" <<std::endl;
+#endif
}
#endif
+/********************************************************************
+ * Configured in configure_trilinos.cmake or configure_petsc.cmake: *
+ ********************************************************************/
+
+#cmakedefine DEAL_II_WITH_64BIT_INDICES
+#ifdef DEAL_II_WITH_64BIT_INDICES
+# define DEAL_II_USE_LARGE_INDEX_TYPE
+#endif
+
+
#include <deal.II/base/numbers.h>
#include <deal.II/base/types.h>
*/
const unsigned int artificial_subdomain_id DEAL_II_DEPRECATED = static_cast<subdomain_id>(-2);
-#define DEAL_II_USE_LARGE_INDEX_TYPE
#ifdef DEAL_II_USE_LARGE_INDEX_TYPE
/**
* The type used for global indices of