"Build deal.II with support for netcdf."
OFF)
+OPTION(DEAL_II_WITH_P4EST
+ "Build deal.II with support for P4EST."
+ OFF)
+
OPTION(DEAL_II_WITH_TBB
"Build deal.II with support for tbb. This will enable thread support in deal.II."
OFF)
OPTION(DEAL_II_WITH_TRILINOS
"Build deal.II with support for trilinos."
- ON)
+ OFF)
OPTION(DEAL_II_WITH_UMFPACK
"Build deal.II with support for UMFPACK."
INCLUDE(configure_netcdf)
+INCLUDE(configure_p4est)
+
INCLUDE(configure_tbb)
INCLUDE(configure_trilinos)
--- /dev/null
+#
+# Configuration for the umfpack and amd libraries:
+#
+
+
+SET(FEATURE_P4EST_DEPENDS
+ DEAL_II_WITH_MPI
+ )
+
+
+MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
+
+ FIND_PACKAGE(P4EST)
+ FIND_PACKAGE(SC)
+
+ IF(P4EST_FOUND AND SC_FOUND)
+ SET(${var} TRUE)
+ ENDIF()
+
+ENDMACRO()
+
+
+MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL var)
+
+ INCLUDE_DIRECTORIES(${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR})
+
+ IF (CMAKE_BUILD_TYPE MATCHES "Debug")
+ IF(P4EST_DEBUG_FOUND AND SC_DEBUG_FOUND)
+ LIST(APPEND deal_ii_external_libraries
+ ${P4EST_DEBUG_LIBRARY} ${SC_DEBUG_LIBRARY}
+ )
+ ELSE()
+ MESSAGE(WARNING "
+deal.II was configured with CMAKE_BUILD_TYPE=Debug but no debug p4est and
+sc libraries were found. The regular p4est and sc libraries will be used
+instead.
+
+")
+ LIST(APPEND deal_ii_external_libraries
+ ${P4EST_LIBRARY} ${SC_LIBRARY}
+ )
+ ENDIF()
+ ELSE()
+ LIST(APPEND deal_ii_external_libraries
+ ${P4EST_LIBRARY} ${SC_LIBRARY}
+ )
+ ENDIF()
+
+ SET(DEAL_II_USE_P4EST TRUE)
+
+ SET(${var} TRUE)
+
+ENDMACRO()
+
+
+SET(FEATURE_P4EST_CUSTOM_ERROR_MESSAGE TRUE)
+
+
+MACRO(FEATURE_P4EST_ERROR_MESSAGE)
+ MESSAGE(SEND_ERROR "
+Could not find the p4est and sc libraries!
+
+Please ensure that the libraries are installed on your computer.
+If the libraries are not at a default location, either provide some hints
+for the autodetection, or set the relevant variables by hand in ccmake.
+
+")
+ENDMACRO()
+
+
+CONFIGURE_FEATURE(P4EST)
FIND_PACKAGE(TBB)
- # In case we don't have a debug library:
- IF(NOT TBB_DEBUG_FOUND)
- SET(TBB_DEBUG_LIBRARY ${TBB_LIBRARY})
- ENDIF()
-
IF(TBB_FOUND)
SET(${var} TRUE)
ENDIF()
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
IF (CMAKE_BUILD_TYPE MATCHES "Debug")
- LIST(APPEND deal_ii_external_libraries ${TBB_DEBUG_LIBRARY})
+ IF(TBB_DEBUG_FOUND)
+ LIST(APPEND deal_ii_external_libraries ${TBB_DEBUG_LIBRARY})
+ ELSE()
+ MESSAGE(WARNING "
+deal.II was configured with CMAKE_BUILD_TYPE=Debug but no debug tbb
+library was found. The regular tbb library will be used instead.
+
+")
+ LIST(APPEND deal_ii_external_libraries ${TBB_LIBRARY})
+ ENDIF()
+
ELSE()
LIST(APPEND deal_ii_external_libraries ${TBB_LIBRARY})
ENDIF()
--- /dev/null
+# Try to find P4EST
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PATH(P4EST_INCLUDE_DIR p4est.h)
+
+FIND_LIBRARY(P4EST_LIBRARY
+ NAMES p4est
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_LIBRARY(P4EST_DEBUG_LIBRARY
+ NAMES p4est_debug p4est.g
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG P4EST_LIBRARY P4EST_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST_DEBUG DEFAULT_MSG P4EST_DEBUG_LIBRARY P4EST_INCLUDE_DIR)
+
+IF(P4EST_FOUND)
+ MARK_AS_ADVANCED(
+ P4EST_LIBRARY
+ P4EST_DEBUG_LIBRARY
+ P4EST_INCLUDE_DIR
+ )
+ENDIF()
--- /dev/null
+# Try to find SC
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PATH(SC_INCLUDE_DIR sc.h)
+
+
+FIND_LIBRARY(SC_LIBRARY
+ NAMES sc
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_LIBRARY(SC_DEBUG_LIBRARY
+ NAMES sc_debug sc.g
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SC DEFAULT_MSG SC_LIBRARY SC_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SC_DEBUG DEFAULT_MSG SC_DEBUG_LIBRARY SC_INCLUDE_DIR)
+
+IF(SC_FOUND)
+ MARK_AS_ADVANCED(
+ SC_LIBRARY
+ SC_DEBUG_LIBRARY
+ SC_INCLUDE_DIR
+ )
+ENDIF()
dnl Usage: DEAL_II_CONFIGURE_P4EST
dnl
dnl ------------------------------------------------------------
-AC_DEFUN(DEAL_II_CONFIGURE_P4EST, dnl
-[
- AC_MSG_CHECKING(whether p4est will be used)
-
- AC_ARG_WITH(p4est,
- [AS_HELP_STRING([--with-p4est=/path/to/p4est],
- [Specify the path to the p4est installation; use this to distribute meshes on a cluster computer.])],
- use_p4est=$withval,
- use_p4est=no)
-
- if test "x$use_p4est" != "xno" ; then
- AC_MSG_RESULT(yes)
-
dnl Verify that the p4est files are actually there
- if test ! -d "${use_p4est}/DEBUG" -o ! -d "${use_p4est}/FAST" ; then
- AC_MSG_ERROR([p4est directories $use_p4est/DEBUG or $use_p4est/FAST not found])
- fi
dnl Make sure that we have also enabled MPI
+
if test "x${DEAL_II_COMPILER_SUPPORTS_MPI}" != "x1" ; then
AC_MSG_ERROR([When using p4est you also need to enable MPI.])
fi
-
- dnl Right now, we always build p4est as shared lib, so make sure we
- dnl have built deal.II as a shared lib as well
- if test "x$enableshared" != "xyes" ; then
- AC_MSG_ERROR([When using p4est with shared libraries, you need to build
- deal.II with shared libraries as well.])
- fi
-
- AC_DEFINE(DEAL_II_USE_P4EST, 1,
- [Defined if we are to use the p4est library to distribute
- meshes on a cluster computer.])
- USE_CONTRIB_P4EST=yes
- AC_SUBST(USE_CONTRIB_P4EST)
-
- DEAL_II_P4EST_DIR=${use_p4est}
- AC_SUBST(DEAL_II_P4EST_DIR)
-
- CXXFLAGSG="$CXXFLAGSG -I$use_p4est/DEBUG/include"
- CXXFLAGSO="$CXXFLAGSO -I$use_p4est/FAST/include"
-
- AC_MSG_CHECKING(for p4est library directory)
- if test -d "$use_p4est/DEBUG/lib64" -a -d "$use_p4est/FAST/lib64" ; then
- AC_MSG_RESULT(lib64)
- DEAL_II_P4EST_LIBDIR_NAME=lib64
- else
- if test -d "$use_p4est/DEBUG/lib" -a -d "$use_p4est/FAST/lib" ; then
- AC_MSG_RESULT(lib)
- DEAL_II_P4EST_LIBDIR_NAME=lib
- else
- AC_MSG_ERROR(could not determine whether p4est stores its library in lib/ or lib64/ directories)
- fi
- fi
- AC_SUBST(DEAL_II_P4EST_LIBDIR_NAME)
-
- else
- AC_MSG_RESULT(no)
- fi
-])
#cmakedefine HAVE_LIBNETCDF
+/*****************************************
+ * Configured in configure_p4est.cmake: *
+ *****************************************/
+
+/* Defined if we are to use the p4est library to distribute meshes on a
+ cluster computer. */
+#cmakedefine DEAL_II_USE_P4EST
+
+
/**************************************
* Configured in configure_tbb.cmake: *
**************************************/
/* Defined if a MUMPS installation was found and is going to be used */
#cmakedefine DEAL_II_USE_MUMPS
-/* Defined if we are to use the p4est library to distribute meshes on a
- cluster computer. */
-#cmakedefine DEAL_II_USE_P4EST
-
/* Defined if a PETSc installation was found and is going to be used */
#cmakedefine DEAL_II_USE_PETSC
block);
#ifdef DEAL_II_USE_P4EST
-#if DEAL_II_COMPILER_SUPPORTS_MPI
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
// if we are working on a parallel
// mesh, we now need to collect
// this information from all