SET(${var} TRUE)
ENDMACRO()
+
SET(FEATURE_MPI_CUSTOM_ERROR_MESSAGE TRUE)
+
MACRO(FEATURE_MPI_ERROR_MESSAGE)
MESSAGE(SEND_ERROR "\n"
"Could not find any suitable mpi library!\n\n"
#endif
int main(){ return 0; }
"
- DEAL_II_HAVE_SANE_MT_DEFINITIONS)
+ DEAL_II_HAVE_MT_DEFINITIONS)
STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
- IF(NOT DEAL_II_HAVE_SANE_MT_DEFINITIONS)
+ IF(NOT DEAL_II_HAVE_MT_DEFINITIONS)
LIST(APPEND DEAL_II_DEFINITIONS "_REENTRANT" "_THREAD_SAFE")
- LIST(APPEND DEAL_II_USER_DEFINITIONS "_REENTRANT" "_THREAD_SAFE") # TODO: Necessary?
ENDIF()
ENDIF(Threads_FOUND)
MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var)
+ SET(tbb_folder "${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss")
#
# Setup threading (before configuring our build...)
)
ENDIF()
- SET(tbb_folder "${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss")
-
INCLUDE_DIRECTORIES(${tbb_folder}/include)
#
# DOXYGEN_DOT_FOUND = Was Dot found or not?
# DOXYGEN_DOT_PATH = The path to dot not including the executable
#
- # Use these variables to set up a custom target:
- #
-
SET(${var} TRUE)
ENDMACRO()
+#
+# Configuration for functionparser
+#
+
MACRO(FEATURE_FUNCTIONPARSER_FIND_EXTERNAL var)
MESSAGE(STATUS
"No module available for finding functionparser externally."
+
#
# Configuration for the lapack library:
#
# function we use. We have to ensure that this check is repeated every time
# the lapack library or DEAL_II_WITH_LAPACK changes.
#
-# TODO: Known bug: At the moment we don't cover the case if the lapack
-# library changes.
+# TODO: Known bug: At the moment we don't cover the case when the lapack
+# library changes..
#
SET(DEAL_II_LAPACK_FUNCTIONS
ENDFOREACH()
ENDMACRO()
+
MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var)
ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
CONFIGURE_FEATURE(LAPACK)
+
#
# Call RESET_LAPACK_FUNCTIONS_CHECK if DEAL_II_WITH_LAPACK is unset to
# clean the configuration
#
-# Configuration for the umfpack and amd libraries:
+# Configuration for the p4est and sc libraries:
#
MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
+
FIND_PACKAGE(P4EST)
FIND_PACKAGE(SC)
IF(P4EST_FOUND AND SC_FOUND)
-
#
# Check whether p4est supports mpi:
#
- LIST(APPEND CMAKE_REQUIRED_INCLUDES ${P4EST_INCLUDE_DIR})
- CHECK_CXX_SOURCE_COMPILES(
- "
- #include <p4est_config.h>
- #ifndef P4EST_MPI
- # error p4est compiled without mpi support
- invalid
- #endif
- int main() { return 0; }
- "
- P4EST_WITH_MPI)
- LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${P4EST_INCLUDE_DIR}/p4est_config.h)
-
IF(NOT P4EST_WITH_MPI)
MESSAGE(WARNING "\n"
"Could not find a sufficient p4est installation: "
ELSE()
SET(${var} TRUE)
ENDIF()
-
- #
- # Remove the variable from the cache to force a recheck:
- #
- UNSET(P4EST_WITH_MPI CACHE)
-
ENDIF()
+
ENDMACRO()
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-long-long")
- #
- # Work around a stupidity in PETSc that makes sure it interferes in
- # a completely obnoxious way with boost.
- # TODO: Obsolete?
- #
- #SET(PETSC_SKIP_UNDERSCORE_CHKERR TRUE)
-
- #
- # Set some definitions for config.h:
- #
-
- IF(NOT PETSC_RELEASE)
- SET(DEAL_II_USE_PETSC_DEV TRUE)
- ENDIF()
-
- IF(PETSC_COMPLEX)
- SET(DEAL_II_USE_PETSC_COMPLEX TRUE)
- ENDIF()
-
SET(DEAL_II_EXPAND_PETSC_VECTOR "PETScWrappers::Vector")
SET(DEAL_II_EXPAND_PETSC_BLOCKVECTOR "PETScWrappers::BlockVector")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG P4EST_LIBRARY P4EST_INCLUDE_DIR)
IF(P4EST_FOUND)
+
+FIND_FILE(PETSC_PETSCVERSION_H petscversion.h
+ HINTS
+ ${PETSC_INCLUDE_DIRS}
+ NO_DEFAULT_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ NO_CMAKE_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+
+ #
+ # Determine mpi support of p4est:
+ #
+ FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING
+ REGEX "#define.*P4EST_MPI 1")
+ IF("${P4EST_MPI_STRING}" STREQUAL "")
+ SET(P4EST_WITH_MPI FALSE)
+ ELSE()
+ SET(P4EST_WITH_MPI TRUE)
+ ENDIF()
+
MARK_AS_ADVANCED(
P4EST_LIBRARY
P4EST_INCLUDE_DIR
# PETSC_VERSION_MINOR
# PETSC_VERSION_SUBMINOR
# PETSC_VERSION_PATCH
-# PETSC_RELEASE
-# PETSC_COMPLEX
#
INCLUDE(FindPackageHandleStandardArgs)
ENDIF()
IF(PETSC_WITH_MPIUNI)
+ #
+ # TODO: Still needed?
#
# If yes, add libmpiuni.so/a (if available)
# We need to link with it on some systems where PETSc is built without
SET(PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}")
- FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_RELEASE_STRING
- REGEX "#define.*PETSC_VERSION_RELEASE.*1")
- IF("${PETSC_RELEASE_STRING}" STREQUAL "")
- SET(PETSC_RELEASE FALSE)
- ELSE()
- SET(PETSC_RELEASE TRUE)
- ENDIF()
-
- FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_COMPLEX_STRING
- REGEX "#define.*PETSC_USE_COMPLEX.*1")
- IF("${PETSC_COMPLEX_STRING}" STREQUAL "")
- SET(PETSC_COMPLEX FALSE)
- ELSE()
- SET(PETSC_COMPLEX TRUE)
- ENDIF()
-
MARK_AS_ADVANCED(
PETSC_LIBRARIES
PETSC_INCLUDE_DIRS
/* Defined if a PETSc installation was found and is going to be used */
#cmakedefine DEAL_II_USE_PETSC
-/* Note: PETSCs version numbers will be directly included from
- * petscversion.h
- */
-
-/* Defined if a PETSc installation was found with complex scalar type and is
- * going to be used
- */
-#cmakedefine DEAL_II_USE_PETSC_COMPLEX
-
-/* Defined if a PETSc installation was found and is not a release */
-#cmakedefine DEAL_II_USE_PETSC_DEV
-
-/* Make sure PETSc doesn't re-define the underscore through the preprocessor,
- * since this interferes with boost. PETSc redefines the underscore to be
- * "__gterr =", but then forgets to undef this thing. Boost simply wants to
- * concatenate the underscore with another string to form a class name, which
- * then of course isn't valid any more. See mails in early Feb 2006.
+/*
+ * Note: The following definitions will be set in petscconf.h and
+ * petscversion.h, so we don't repeat them here.
*
- * TODO: Obsolete?
+ * PETSC_VERSION_MAJOR
+ * PETSC_VERSION_MINOR
+ * PETSC_VERSION_SUBMINOR
+ * PETSC_VERSION_PATCH
+ * PETSC_VERSION_RELEASE
+ * PETSC_USE_COMPLEX
*/
-#cmakedefine PETSC_SKIP_UNDERSCORE_CHKERR
/**
* These macros are defined to make testing for PETSc versions within
void
SolverBase::get_eigenpair (const unsigned int index,
-#ifndef DEAL_II_USE_PETSC_COMPLEX
+#ifndef PETSC_USE_COMPLEX
double &kr,
#else
std::complex<double> &kr,