OPTION(DEAL_II_WITH_UMFPACK
"Build deal.II with support for UMFPACK."
- OFF)
+ ON)
OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK
"Always use the bundled umfpack library instead of an external one."
OFF)
INCLUDE(CheckFunctionExists)
-MACRO(FIND_FEATURE_BLAS_EXTERNAL var)
+MACRO(FEATURE_BLAS_FIND_EXTERNAL var)
FIND_PACKAGE(BLAS)
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_BLAS_EXTERNAL var)
+MACRO(FEATURE_BLAS_CONFIGURE_EXTERNAL var)
SET(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_BLAS_ERROR_MESSAGE)
- MESSAGE(SEND_ERROR "
-Could not find the blas library!
-
-Please ensure that the blas library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-")
-ENDMACRO()
-
-
CONFIGURE_FEATURE(BLAS)
)
-MACRO(FIND_FEATURE_BOOST_EXTERNAL var)
+MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
FIND_PACKAGE (Boost COMPONENTS serialization thread)
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_BOOST_EXTERNAL var)
+MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL var)
INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
ENDMACRO()
-SET(HAVE_CONTRIB_FEATURE_BOOST TRUE)
+SET(FEATURE_BOOST_HAVE_CONTRIB TRUE)
-MACRO(CONFIGURE_FEATURE_BOOST_CONTRIB var)
+MACRO(FEATURE_BOOST_CONFIGURE_CONTRIB var)
# compile the necessary parts of boost out of ./contrib
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_BOOST_ERROR_MESSAGE)
- MESSAGE(SEND_ERROR "
-Could not find the boost library!
-
-Please ensure that the boost library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-Alternatively you may choose to compile the bundled contrib library of
-boost by setting DEAL_II_ALLOW_CONTRIB=on or
-DEAL_II_FORCE_CONTRIB_BOOST=on.
-
-")
-ENDMACRO()
-
-
CONFIGURE_FEATURE(BOOST)
-MACRO(FIND_FEATURE_FUNCTIONPARSER_EXTERNAL var)
+MACRO(FEATURE_FUNCTIONPARSER_FIND_EXTERNAL var)
+ MESSAGE(WARNING "
+Module for finding functionparser not written, yet!
+
+")
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_FUNCTIONPARSER_EXTERNAL var)
+MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_EXTERNAL var)
ENDMACRO()
-SET(HAVE_CONTRIB_FEATURE_FUNCTIONPARSER TRUE)
+SET(FEATURE_FUNCTIONPARSER_HAVE_CONTRIB TRUE)
-MACRO(CONFIGURE_FEATURE_FUNCTIONPARSER_CONTRIB var)
+MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_CONTRIB var)
# compile the necessary parts of functionparser out of ./contrib
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_FUNCTIONPARSER_ERROR_MESSAGE)
- MESSAGE(SEND_ERROR "
-Could not find the functionparser library!
-
-Module not written, yet...
-
-You may want to choose to compile the bundled contrib library of
-functionparser by setting DEAL_II_ALLOW_CONTRIB=on or
-DEAL_II_FORCE_CONTRIB_FUNCTIONPARSER=on.
-
-")
-ENDMACRO()
-
-
CONFIGURE_FEATURE(FUNCTIONPARSER)
# Configuration for the lapack library:
#
-MACRO(FIND_FEATURE_LAPACK_EXTERNAL var)
+MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
FIND_PACKAGE(LAPACK)
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_LAPACK_EXTERNAL var)
+MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var)
SET(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_BLAS_ERROR_MESSAGE)
- MESSAGE(SEND_ERROR "
-Could not find the lapack library!
-
-Please ensure that the lapack library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-")
-ENDMACRO()
-
-
CONFIGURE_FEATURE(LAPACK)
# Configuration for the netcdf library:
#
-MACRO(FIND_FEATURE_METIS_EXTERNAL var)
+MACRO(FEATURE_METIS_FIND_EXTERNAL var)
FIND_PACKAGE(METIS)
IF(METIS_FOUND AND METIS_MAJOR GREATER 4)
SET(${var} TRUE)
ELSE()
- MESSAGE(STATUS
- "Could not find a sufficient modern metis installation: Version 5.x
- required."
+ MESSAGE(WARNING "
+Could not find a sufficient modern metis installation:
+Version 5.x required!
+
+Please ensure that a sufficiently modern version of metis is installed on
+your computer. If the library is not at a default location, either provide
+some hints for the autodetection, or set the relevant variables by hand in
+ccmake.
+
+"
)
ENDIF()
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_METIS_EXTERNAL var)
+MACRO(FEATURE_METIS_CONFIGURE_EXTERNAL var)
INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries ${METIS_LIBRARY})
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_METIS_ERROR_MESSAGE)
-
- MESSAGE(SEND_ERROR "
-Could not find the metis library!
-
-Please ensure that the metis version 5.x is installed on your computer.
-If the library is not at a default location, either provide some hints
-via environment variables:
-METIS_LIBRARY_DIR METIS_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
-
-")
-
-ENDMACRO()
-
-
CONFIGURE_FEATURE(METIS)
# Configuration for mpi support:
#
-MACRO(FIND_FEATURE_MPI_EXTERNAL var)
+MACRO(FEATURE_MPI_FIND_EXTERNAL var)
FIND_PACKAGE(MPI)
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_MPI_EXTERNAL var)
+MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var)
INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE)
+ # TODO: Set up the rest:
+
#MPI_CXX_COMPILER MPI Compiler wrapper for CXX
#MPI_CXX_COMPILE_FLAGS Compilation flags for MPI programs
SET(${var} TRUE)
ENDMACRO()
+SET(FEATURE_MPI_CUSTOM_ERROR_MESSAGE TRUE)
-MACRO(CONFIGURE_FEATURE_MPI_ERROR_MESSAGE)
+MACRO(FEATURE_MPI_ERROR_MESSAGE)
MESSAGE(SEND_ERROR "
Could not find any suitable mpi library!
# Configuration for the netcdf library:
#
-MACRO(FIND_FEATURE_NETCDF_EXTERNAL var)
+MACRO(FEATURE_NETCDF_FIND_EXTERNAL var)
FIND_PACKAGE(NETCDF)
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_NETCDF_EXTERNAL var)
+MACRO(FEATURE_NETCDF_CONFIGURE_EXTERNAL var)
INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries ${NETCDF_LIBRARY})
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_NETCDF_ERROR_MESSAGE)
-
- MESSAGE(SEND_ERROR "
-Could not find the netcdf library!
-
-Please ensure that the netcdf library is installed on your computer.
-If the library is not at a default location, either provide some hints
-via environment variables:
-NETCDF_LIBRARY_DIR NETCDF_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
-
-")
-
-ENDMACRO()
-
-
CONFIGURE_FEATURE(NETCDF)
# Set up the tbb library:
#
-MACRO(FIND_FEATURE_TBB_EXTERNAL var)
+MACRO(FEATURE_TBB_FIND_EXTERNAL var)
FIND_PACKAGE(TBB)
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_TBB_EXTERNAL var)
+MACRO(FEATURE_TBB_CONFIGURE_EXTERNAL var)
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
ENDMACRO()
-SET(HAVE_CONTRIB_FEATURE_TBB TRUE)
+SET(FEATURE_TBB_HAVE_CONTRIB TRUE)
-MACRO(CONFIGURE_FEATURE_TBB_CONTRIB var)
+MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var)
#
# Add tbb directly to the object files of deal.II
#
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_TBB_ERROR_MESSAGE)
- MESSAGE(SEND_ERROR "
-Could not find the tbb library!
-
-Please ensure that the tbb library is installed on your computer.
-If the library is not at a default location, either provide some hints
-via environment variables:
-TBB_LIBRARY_DIR TBB_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
-
-Alternatively you may choose to compile the bundled contrib library of
-boost by setting DEAL_II_ALLOW_CONTRIB=on or
-DEAL_II_FORCE_CONTRIB_TBB=on.
-
-")
-ENDMACRO()
-
-
CONFIGURE_FEATURE(TBB)
)
-MACRO(FIND_FEATURE_UMFPACK_EXTERNAL var)
+MACRO(FEATURE_UMFPACK_FIND_EXTERNAL var)
FIND_PACKAGE(UMFPACK)
FIND_PACKAGE(AMD)
IF(UMFPACK_FOUND AND AMD_FOUND)
- SET(${var} TRUE)
+ #SET(${var} TRUE)
ENDIF()
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_UMFPACK_EXTERNAL var)
+MACRO(FEATURE_UMFPACK_CONFIGURE_EXTERNAL var)
INCLUDE_DIRECTORIES(${UMFPACK_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
ENDMACRO()
-SET(HAVE_CONTRIB_FEATURE_UMFPACK TRUE)
+SET(FEATURE_UMFPACK_HAVE_CONTRIB TRUE)
-MACRO(CONFIGURE_FEATURE_UMFPACK_CONTRIB var)
+MACRO(FEATURE_UMFPACK_CONFIGURE_CONTRIB var)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/contrib/umfpack/UMFPACK/Include
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_BOOST_ERROR_MESSAGE)
+SET(FEATURE_UMFPACK_CUSTOM_ERROR_MESSAGE TRUE)
+
+
+MACRO(FEATURE_UMFPACK_ERROR_MESSAGE)
MESSAGE(SEND_ERROR "
Could not find the umfpack and amd libraries!
Please ensure that the libraries are installed on your computer.
If the libraries are not at a default location, either provide some hints
-via environment variables:
-UMFPACK_LIBRARY_DIR UMFPACK_INCLUDE_DIR
-AMD_LIBRARY_DIR AMD_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
+for the autodetection, or set the relevant variables by hand in ccmake.
Alternatively you may choose to compile the bundled contrib libraries
by setting DEAL_II_ALLOW_CONTRIB=on or DEAL_II_FORCE_CONTRIB_UMFPACK=on.
# Configuration for the zlib library:
#
-MACRO(FIND_FEATURE_ZLIB_EXTERNAL var)
+MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
FIND_PACKAGE(ZLIB)
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_ZLIB_EXTERNAL var)
+MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
LIST(APPEND deal_ii_external_libraries ${ZLIB_LIBRARIES})
ENDMACRO()
-MACRO(CONFIGURE_FEATURE_ZLIB_ERROR_MESSAGE)
- MESSAGE(SEND_ERROR "
-Could not find the zlib library!
-
-Please ensure that the zlib library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-")
-ENDMACRO()
-
-
CONFIGURE_FEATURE(ZLIB)
#
# Usage:
#
-# CONFIGURE_FEATURE(feature_name)
+# CONFIGURE_FEATURE(feature)
+#
#
# This macro assumes the following macros and variables to be defined:
#
-# FEATURE_${feature_name}_DEPENDS (variable)
+# FEATURE_${feature}_DEPENDS (variable, optional)
#
-# - A variable which contains an optional list of features this feature
+# a variable which contains an optional list of features this feature
# depends on (and which have to be enbled for this feature to work.)
#
-# HAVE_CONTRIB_FEATURE_${feature_name} (variable)
#
-# - Which is either set to TRUE if all necessary libraries of the
-# features comes bundled with deal.II and hence can be supported
-# without external dependencies, or unset.
+# FEATURE_${feature}_HAVE_CONTRIB (variable, optional)
+#
+# which shall either be set to TRUE if all necessary libraries of the
+# features comes bundled with deal.II and hence can be supported
+# without external dependencies, or unset.
+#
+# FEATURE_${feature}_CONFIGURE_CONTRIB(var) (macro, optional)
+#
+# which shall setup all necessary configuration for the feature with
+# contrib source dependencies. var set to TRUE shall indicate success.
#
-# CONFIGURE_FEATURE_${feature_name}_CONTRIB(var) (macro)
#
-# - which shall setup all necessary configuration for the feature with
-# contrib source dependencies. var set to TRUE shall indicate success.
+# FEATURE_${feature}_FIND_EXTERNAL(var) (macro)
#
+# which shall set var to TRUE if all dependencies for the feature are
+# fullfilled. In this case all necessary variables for
+# FEATURE_${feature}_CONFIGURE_EXTERNAL must be set. Otherwise
+# var should remain unset.
#
-# FIND_FEATURE_${feature_name}_EXTERNAL(var) (macro)
+# FEATURE_${feature}_CONFIGURE_EXTERNAL(var) (macro)
#
-# - which shall set var to TRUE if all dependencies for the feature are
-# fullfilled. In this case all necessary variables for
-# CONFIGURE_FEATURE_${feature_name}_EXTERNAL shall be set. Otherwise
-# var should remain unset.
+# which shall setup all necessary configuration for the feature with
+# external dependencies. var set to TRUE shall indicate success.
#
-# CONFIGURE_FEATURE_${feature_name}_EXTERNAL(var) (macro)
#
-# - which shall setup all necessary configuration for the feature with
-# external dependencies. var set to TRUE shall indicate success.
+# FEATURE_${feature}_CUSTOM_ERROR_MESSAGE() (variable, optional)
#
-# CONFIGURE_FEATURE_${feature_name}_ERROR_MESSAGE() (macro)
+# which shall either be set to TRUE if FEATURE_${feature}_ERROR_MESSAGE
+# is set up, or be undefined.
#
-# - which shall print a meaningfull error message if case no external
-# library is found (and contrib is not allowed to be used.)
+# FEATURE_${feature}_ERROR_MESSAGE() (macro, optional)
+#
+# which shall print a meaningfull error message if case no external
+# library is found (and contrib is not allowed to be used.)
+# If not defined, a suitable default error message will be printed.
#
#
ENDMACRO()
+#
+# A small macro to post an error message:
+#
+MACRO(FEATURE_ERROR_MESSAGE feature)
+ STRING(TOLOWER ${feature} feature_lowercase)
+ IF(FEATURE_${feature}_HAVE_CONTRIB)
+ MESSAGE(SEND_ERROR "
+Could not find the ${feature_lowercase} library!
+
+Please ensure that the ${feature_lowercase} library is installed on your computer.
+If the library is not at a default location, either provide some hints
+for the autodetection, or set the relevant variables by hand in ccmake.
+
+Alternatively you may choose to compile the bundled contrib library of
+${feature_lowercase} by setting DEAL_II_ALLOW_CONTRIB=on or
+DEAL_II_FORCE_CONTRIB_${feature}=on.
+
+")
+ ELSE()
+ MESSAGE(SEND_ERROR "
+Could not find the ${feature_lowercase} library!
+
+Please ensure that the ${feature_lowercase} library is installed on your computer.
+If the library is not at a default location, either provide some hints
+for the autodetection, or set the relevant variables by hand in ccmake.
+
+")
+ ENDIF()
+ENDMACRO()
+
+
MACRO(CONFIGURE_FEATURE feature)
# Only try to configure ${feature} if we have to:
#
IF(DEAL_II_FORCE_CONTRIB_${feature})
- IF(HAVE_CONTRIB_FEATURE_${feature})
+ IF(FEATURE_${feature}_HAVE_CONTRIB)
RUN_COMMAND(
"
- CONFIGURE_FEATURE_${feature}_CONTRIB(
+ FEATURE_${feature}_CONFIGURE_CONTRIB(
FEATURE_${feature}_CONTRIB_CONFIGURED
)
"
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR
- "Internal build system error: DEAL_II_FORCE_CONTRIB_${feature} defined, but HAVE_CONTRIB_FEATURE_${feature} not present."
+ "Internal build system error: DEAL_II_FORCE_CONTRIB_${feature} defined, but FEATURE_${feature}_HAVE_CONTRIB not present."
)
ENDIF()
# Second case: We are allowed to search for an external library:
#
RUN_COMMAND(
- "FIND_FEATURE_${feature}_EXTERNAL(FEATURE_${feature}_EXTERNAL_FOUND)"
+ "FEATURE_${feature}_FIND_EXTERNAL(FEATURE_${feature}_EXTERNAL_FOUND)"
)
IF(FEATURE_${feature}_EXTERNAL_FOUND)
RUN_COMMAND(
"
- CONFIGURE_FEATURE_${feature}_EXTERNAL(
+ FEATURE_${feature}_CONFIGURE_EXTERNAL(
FEATURE_${feature}_EXTERNAL_CONFIGURED
)
"
"DEAL_II_WITH_${feature} has unmet external dependencies."
)
- IF(HAVE_CONTRIB_FEATURE_${feature} AND DEAL_II_ALLOW_CONTRIB)
+ IF(FEATURE_${feature}_HAVE_CONTRIB AND DEAL_II_ALLOW_CONTRIB)
RUN_COMMAND(
"
- CONFIGURE_FEATURE_${feature}_CONTRIB(
+ FEATURE_${feature}_CONFIGURE_CONTRIB(
FEATURE_${feature}_CONTRIB_CONFIGURED
)
"
IF(DEAL_II_FEATURE_AUTODETECTION)
SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
ELSE()
- RUN_COMMAND(
- "CONFIGURE_FEATURE_${feature}_ERROR_MESSAGE()"
- )
+ IF(FEATURE_${feature}_CUSTOM_ERROR_MESSAGE)
+ RUN_COMMAND(
+ "
+ FEATURE_${feature}_ERROR_MESSAGE()
+ "
+ )
+ ELSE()
+ FEATURE_ERROR_MESSAGE(${feature})
+ ENDIF()
ENDIF()
ENDIF()
ENDIF()