message(STATUS "Setting up bundled features")
+include_directories(
+ ${DEAL_II_BUNDLED_INCLUDE_DIRS}
+ ${DEAL_II_INCLUDE_DIRS}
+ )
if(FEATURE_BOOST_BUNDLED_CONFIGURED)
add_subdirectory(${BOOST_FOLDER}/libs/serialization/src)
##
## ---------------------------------------------------------------------
-include_directories(
- ${BOOST_BUNDLED_INCLUDE_DIRS}
- ${DEAL_II_INCLUDE_DIRS}
- )
-
set(src_boost_iostreams
file_descriptor.cpp
gzip.cpp
##
## ---------------------------------------------------------------------
-include_directories(
- ${BOOST_BUNDLED_INCLUDE_DIRS}
- ${DEAL_II_INCLUDE_DIRS}
- )
-
set(src_boost_serialization
archive_exception.cpp
basic_archive.cpp
##
## ---------------------------------------------------------------------
-include_directories(
- ${BOOST_BUNDLED_INCLUDE_DIRS}
- ${DEAL_II_INCLUDE_DIRS}
- )
-
set(src_boost_system
error_code.cpp
)
##
## ---------------------------------------------------------------------
-include_directories(
- ${BOOST_BUNDLED_INCLUDE_DIRS}
- ${DEAL_II_INCLUDE_DIRS}
- )
-
if(DEAL_II_USE_MT_POSIX)
set(src_boost_thread
pthread/once.cpp
simd/src/Kokkos_SIMD_dummy.cpp
containers/src/impl/Kokkos_UnorderedMap_impl.cpp
)
-include_directories(${KOKKOS_BUNDLED_INCLUDE_DIRS})
enable_if_supported(DEAL_II_CXX_FLAGS -Wno-float-conversion)
enable_if_supported(DEAL_II_CXX_FLAGS -Wno-missing-field-initializers)
# setup of compilation targets and installation here:
#
+
#
# Boost C++ libraries
#
set(BOOST_FOLDER "${CMAKE_SOURCE_DIR}/bundled/boost-1.70.0")
+macro(feature_boost_configure_bundled)
+ #
+ # Add rt to the link interface as well, boost/chrono needs it.
+ #
+ if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+ find_system_library(rt_LIBRARY NAMES rt)
+ mark_as_advanced(rt_LIBRARY)
+ if(NOT rt_LIBRARY MATCHES "-NOTFOUND")
+ list(APPEND DEAL_II_LIBRARIES ${rt_LIBRARY})
+ endif()
+ endif()
+
+ #
+ # We still need the version information, which is set up in the FindBoost
+ # module in the non-bundled case:
+ #
+ file(STRINGS "${BOOST_FOLDER}/include/boost/version.hpp"
+ BOOST_VERSION_STRING
+ REGEX "#define.*BOOST_VERSION")
+
+ string(REGEX REPLACE "^.*BOOST_VERSION.* ([0-9]+).*" "\\1"
+ BOOST_VERSION_NUMBER "${BOOST_VERSION_STRING}"
+ )
+ math(EXPR Boost_MAJOR_VERSION "${BOOST_VERSION_NUMBER} / 100000")
+ math(EXPR Boost_MINOR_VERSION "${BOOST_VERSION_NUMBER} / 100 % 1000")
+ math(EXPR Boost_SUBMINOR_VERSION "${BOOST_VERSION_NUMBER} % 100")
+
+ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
+ #
+ # Bundled boost tries to (dl)open itself as a dynamic library on
+ # Windows. Disable this undesired behavior by exporting
+ # BOOST_ALL_NO_LIB on Windows platforms (for bundled boost).
+ #
+ list(APPEND DEAL_II_DEFINITIONS "BOOST_ALL_NO_LIB")
+ endif()
+
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-unused-local-typedefs")
+
+ list(APPEND DEAL_II_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include)
+endmacro()
+
+
#
# Kokkos
#
set(KOKKOS_FOLDER "${CMAKE_SOURCE_DIR}/bundled/kokkos-3.7.00")
+macro(feature_kokkos_configure_bundled)
+ list(APPEND DEAL_II_BUNDLED_INCLUDE_DIRS
+ ${KOKKOS_FOLDER}/algorithms/src
+ ${KOKKOS_FOLDER}/containers/src
+ ${KOKKOS_FOLDER}/core/src
+ ${KOKKOS_FOLDER}/simd/src
+ ${KOKKOS_FOLDER}/tpls/desul/include
+ )
+endmacro()
+
+
#
# Taskflow
#
set(TASKFLOW_FOLDER "${CMAKE_SOURCE_DIR}/bundled/taskflow-2.5.0")
+macro(feature_taskflow_configure_bundled)
+ list(APPEND DEAL_II_BUNDLED_INCLUDE_DIRS ${TASKFLOW_FOLDER}/include)
+endmacro()
+
#
# Threading Building Blocks library
set(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb-2018_U2")
endif()
+macro(feature_tbb_configure_bundled)
+ #
+ # We have to disable a bunch of warnings:
+ #
+ enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-parentheses")
+
+ #
+ # tbb uses dlopen/dlclose, so link against libdl.so as well:
+ #
+ list(APPEND DEAL_II_LIBRARIES ${CMAKE_DL_LIBS})
+
+ list(APPEND DEAL_II_BUNDLED_INCLUDE_DIRS ${TBB_FOLDER}/include)
+
+ set(DEAL_II_TBB_WITH_ONEAPI FALSE)
+endmacro()
+
+
#
# UMFPACK, AMD and UFCONFIG:
#
set(UMFPACK_FOLDER "${CMAKE_SOURCE_DIR}/bundled/umfpack")
+macro(feature_umfpack_configure_bundled)
+ list(APPEND DEAL_II_BUNDLED_INCLUDE_DIRS
+ ${UMFPACK_FOLDER}/UMFPACK/Include ${UMFPACK_FOLDER}/AMD/Include
+ )
+endmacro()
+
#
# muparser
OFF)
set(MUPARSER_FOLDER "${CMAKE_SOURCE_DIR}/bundled/muparser_v2_3_3/")
+
+
+macro(feature_muparser_configure_bundled)
+ list(APPEND DEAL_II_BUNDLED_INCLUDE_DIRS ${MUPARSER_FOLDER}/include)
+endmacro()
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
include_directories(
- ${TBB_BUNDLED_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/rml/include
)
##
## ---------------------------------------------------------------------
-include_directories(${UMFPACK_BUNDLED_INCLUDE_DIRS})
-
strip_flag(DEAL_II_CXX_FLAGS "-Wfloat-conversion")
set(src_amd
# ..................................................
#
-include_directories(${UMFPACK_BUNDLED_INCLUDE_DIRS})
-
#
# *Shush!*
# (Remove locally in this subdirectory)
endmacro()
-macro(feature_taskflow_configure_bundled)
- list(APPEND TASKFLOW_BUNDLED_INCLUDE_DIRS ${TASKFLOW_FOLDER}/include)
-endmacro()
-
-
configure_feature(TASKFLOW)
endmacro()
-macro(feature_tbb_configure_bundled)
- #
- # We have to disable a bunch of warnings:
- #
- enable_if_supported(TBB_CXX_FLAGS "-Wno-parentheses")
-
- #
- # tbb uses dlopen/dlclose, so link against libdl.so as well:
- #
- list(APPEND TBB_LIBRARIES ${CMAKE_DL_LIBS})
-
- list(APPEND TBB_BUNDLED_INCLUDE_DIRS ${TBB_FOLDER}/include)
-
- set(DEAL_II_TBB_WITH_ONEAPI FALSE)
-endmacro()
-
-
configure_feature(TBB)
)
-macro(feature_boost_configure_common)
- # Some standard library implementations do not implement std::auto_ptr
- # (anymore) which was deprecated for C++11 and removed in the C++17 standard.
- # Older boost versions can't know about this but provide a possibility to
- # circumvent the issue. Hence, we just check ourselves.
- if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- add_flags(CMAKE_REQUIRED_FLAGS "/WX /EHsc")
- else()
- add_flags(CMAKE_REQUIRED_FLAGS "-Werror")
- endif()
- # The configure function is called only once. In case an externally provided
- # boost library is detected, BOOST_INCLUDE_DIRS contains the include paths to
- # be used and BOOST_BUNDLED_INCLUDE_DIRS is empty. For the bundled library, it
- # is the other way around.
- list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS})
-
- # In case, the boost library already sets BOOST_NO_AUTO_PTR we report
- # DEAL_II_HAS_AUTO_PTR to be true to avoid redefining the macro.
- CHECK_CXX_SOURCE_COMPILES(
- "
- #include <memory>
- #include <boost/config.hpp>
-
- int main()
- {
- #ifndef BOOST_NO_AUTO_PTR
- int *i = new int;
- std::auto_ptr<int> x(i);
- #endif
- return 0;
- }
- "
- DEAL_II_HAS_AUTO_PTR)
-
- reset_cmake_required()
-
- # Fix some problems by defining some additional preprocessor symbols.
- # Ultimately these are added into DEAL_II_DEFINITIONS. They are separate
- # here so that they show up in detailed.log under DEAL_II_WITH_BOOST as,
- # logically, they are part of our boost configuration.
- if(NOT DEAL_II_HAS_AUTO_PTR)
- list(APPEND BOOST_DEFINITIONS "BOOST_NO_AUTO_PTR")
- endif()
-
- enable_if_supported(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs")
-
- # At least BOOST 1.74 has the problem that some of the BOOST headers
- # include other BOOST headers that are deprecated, and this then leads to
- # warnings. That's rather annoying.
-
- # The configure function is called only once. In case an externally provided
- # boost library is detected, BOOST_INCLUDE_DIRS contains the include paths to
- # be used and BOOST_BUNDLED_INCLUDE_DIRS is empty. For the bundled library, it
- # is the other way around.
- list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS})
-
- check_cxx_compiler_bug(
- "
- #define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED
- #define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\");
- #include <boost/geometry/index/rtree.hpp>
- int main() { return 0; }
- "
- DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS)
- reset_cmake_required()
-endmacro()
-
-
-macro(feature_boost_configure_bundled)
- #
- # Add rt to the link interface as well, boost/chrono needs it.
- #
- if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
- find_system_library(rt_LIBRARY NAMES rt)
- mark_as_advanced(rt_LIBRARY)
- if(NOT rt_LIBRARY MATCHES "-NOTFOUND")
- set(BOOST_LIBRARIES ${rt_LIBRARY})
- endif()
- endif()
-
- # We need to set this path before calling the configure function
- # to be able to use the include paths in the checks.
- set(BOOST_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include)
- #
- # We still need the version information, which is set up in the FindBoost
- # module in the non-bundled case:
- #
- file(STRINGS "${BOOST_BUNDLED_INCLUDE_DIRS}/boost/version.hpp"
- BOOST_VERSION_STRING
- REGEX "#define.*BOOST_VERSION")
-
- string(REGEX REPLACE "^.*BOOST_VERSION.* ([0-9]+).*" "\\1"
- BOOST_VERSION_NUMBER "${BOOST_VERSION_STRING}"
- )
- math(EXPR Boost_MAJOR_VERSION "${BOOST_VERSION_NUMBER} / 100000")
- math(EXPR Boost_MINOR_VERSION "${BOOST_VERSION_NUMBER} / 100 % 1000")
- math(EXPR Boost_SUBMINOR_VERSION "${BOOST_VERSION_NUMBER} % 100")
-
- FEATURE_BOOST_CONFIGURE_COMMON()
-
- if(CMAKE_SYSTEM_NAME MATCHES "Windows")
- #
- # Bundled boost tries to (dl)open itself as a dynamic library on
- # Windows. Disable this undesired behavior by exporting
- # BOOST_ALL_NO_LIB on Windows platforms (for bundled boost).
- #
- list(APPEND BOOST_DEFINITIONS "BOOST_ALL_NO_LIB")
- endif()
-endmacro()
-
macro(feature_boost_find_external var)
find_package(DEAL_II_BOOST)
macro(feature_boost_configure_external)
- FEATURE_BOOST_CONFIGURE_COMMON()
+ enable_if_supported(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs")
+
+ # At least BOOST 1.74 has the problem that some of the BOOST headers
+ # include other BOOST headers that are deprecated, and this then leads to
+ # warnings. That's rather annoying.
+
+ # The configure function is called only once. In case an externally provided
+ # boost library is detected, BOOST_INCLUDE_DIRS contains the include paths to
+ # be used and BOOST_BUNDLED_INCLUDE_DIRS is empty. For the bundled library, it
+ # is the other way around.
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS})
+
+ check_cxx_compiler_bug(
+ "
+ #define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED
+ #define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\");
+ #include <boost/geometry/index/rtree.hpp>
+ int main() { return 0; }
+ "
+ DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS)
+ reset_cmake_required()
endmacro()
set(FEATURE_UMFPACK_DEPENDS LAPACK)
-macro(feature_umfpack_configure_bundled)
- set(UMFPACK_BUNDLED_INCLUDE_DIRS
- ${UMFPACK_FOLDER}/UMFPACK/Include
- ${UMFPACK_FOLDER}/AMD/Include
- )
-endmacro()
macro(feature_umfpack_error_message)
message(FATAL_ERROR "\n"
)
endmacro()
+
configure_feature(UMFPACK)
CACHE BOOL "Build deal.II with support for Kokkos." FORCE
)
-macro(feature_kokkos_configure_bundled)
- set(KOKKOS_BUNDLED_INCLUDE_DIRS
- ${KOKKOS_FOLDER}/algorithms/src
- ${KOKKOS_FOLDER}/containers/src
- ${KOKKOS_FOLDER}/core/src
- ${KOKKOS_FOLDER}/simd/src
- ${KOKKOS_FOLDER}/tpls/desul/include
- )
-endmacro()
configure_feature(KOKKOS)
+
#
# DEAL_II_WITH_KOKKOS is always required.
#
)
endif()
endif()
+
# Configuration for the MUPARSER library:
#
-macro(feature_muparser_configure_bundled)
- set(MUPARSER_BUNDLED_INCLUDE_DIRS ${MUPARSER_FOLDER}/include)
-endmacro()
-
-
configure_feature(MUPARSER)
purge_feature(${_feature})
if(FEATURE_${_feature}_HAVE_BUNDLED)
- evaluate_expression("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
+ evaluate_expression("feature_${_feature}_configure_bundled()")
+ message(STATUS "")
message(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
set(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE)
set_cached_option(${_feature} ON)