]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Reorganize configure_bundled() definition to bundled subdirectory
authorMatthias Maier <tamiko@43-1.org>
Tue, 29 Nov 2022 05:43:44 +0000 (23:43 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 30 Nov 2022 14:02:13 +0000 (08:02 -0600)
17 files changed:
bundled/CMakeLists.txt
bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt
bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt
bundled/boost-1.70.0/libs/system/src/CMakeLists.txt
bundled/boost-1.70.0/libs/thread/src/CMakeLists.txt
bundled/kokkos-3.7.00/CMakeLists.txt
bundled/setup_bundled.cmake
bundled/tbb-2018_U2/src/CMakeLists.txt
bundled/umfpack/AMD/Source/CMakeLists.txt
bundled/umfpack/UMFPACK/Source/CMakeLists.txt
cmake/configure/configure_10_taskflow.cmake
cmake/configure/configure_10_tbb.cmake
cmake/configure/configure_20_boost.cmake
cmake/configure/configure_20_umfpack.cmake
cmake/configure/configure_30_kokkos.cmake
cmake/configure/configure_50_muparser.cmake
cmake/macros/macro_configure_feature.cmake

index cc3fe0cef5bf8d5acba4346fe3e657f52bbf87f8..f45c0afbd0fa7f414bf27583eb9a4f58e8791082 100644 (file)
 
 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)
index 9dc08a8d5336d19eb3c9995f7b1b769bcbc8be30..34e3572668e11f937de83c99f4e9640daf002b4f 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
-include_directories(
-  ${BOOST_BUNDLED_INCLUDE_DIRS}
-  ${DEAL_II_INCLUDE_DIRS}
-  )
-
 set(src_boost_iostreams
     file_descriptor.cpp
     gzip.cpp
index 8994ed57bee3c735ab241fcb549fc9e489cfcb8c..0f633ed25bc3c5b120e63310017071494428ef0f 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
-include_directories(
-  ${BOOST_BUNDLED_INCLUDE_DIRS}
-  ${DEAL_II_INCLUDE_DIRS}
-  )
-
 set(src_boost_serialization
   archive_exception.cpp
   basic_archive.cpp
index 02f08a432df66e796eb89f32d2b65f4dca893fb4..a3b6ebc67ebeeeaaa570357d65d2a2d3dd2d28e1 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
-include_directories(
-  ${BOOST_BUNDLED_INCLUDE_DIRS}
-  ${DEAL_II_INCLUDE_DIRS}
-  )
-
 set(src_boost_system
   error_code.cpp
   )
index 40d6bc283014f322ab1288cfc628531f71d1a3ac..0dea7c241b9939c85078e8fa012355d71c15fbfe 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
-include_directories(
-  ${BOOST_BUNDLED_INCLUDE_DIRS}
-  ${DEAL_II_INCLUDE_DIRS}
-  )
-
 if(DEAL_II_USE_MT_POSIX)
   set(src_boost_thread
     pthread/once.cpp
index 19d5c80c493e0003fcb91695855096d37f2dbc4b..964f8f5fbaf9dd3bad7a63762fa4dc8a32b9655b 100644 (file)
@@ -63,7 +63,6 @@ set(src_kokkos
   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)
index a7227eb8d989085391e085281400a4279b4d82a1..0934bdb3fb5b506ace94a242eac5d4a644aaeb9c 100644 (file)
@@ -18,6 +18,7 @@
 # setup of compilation targets and installation here:
 #
 
+
 #
 # Boost C++ libraries
 #
@@ -30,6 +31,48 @@ option(DEAL_II_FORCE_BUNDLED_BOOST
 
 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
 #
@@ -42,6 +85,17 @@ option(DEAL_II_FORCE_BUNDLED_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
 #
@@ -54,6 +108,10 @@ option(DEAL_II_FORCE_BUNDLED_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
@@ -73,6 +131,23 @@ if( NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
   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:
 #
@@ -85,6 +160,12 @@ option(DEAL_II_FORCE_BUNDLED_UMFPACK
 
 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
@@ -96,3 +177,8 @@ option(DEAL_II_FORCE_BUNDLED_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()
index 16b273d056fe647630f8889ad27d8128df29547e..9a9310102fc25d0e59a526d52990c09107d40c86 100644 (file)
@@ -45,7 +45,6 @@ enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-tautological-overlap-compare")
 
 set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
 include_directories(
-  ${TBB_BUNDLED_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}/rml/include
   )
 
index f1bf0293c982b7f61950d782e5bce9672e6c73ed..d3c3c5eff96a364179c02036db2d2e114c4abd96 100644 (file)
@@ -13,8 +13,6 @@
 ##
 ## ---------------------------------------------------------------------
 
-include_directories(${UMFPACK_BUNDLED_INCLUDE_DIRS})
-
 strip_flag(DEAL_II_CXX_FLAGS "-Wfloat-conversion")
 
 set(src_amd
index 1929a68b0249605c66818fc4a4b748952261f71d..6ffffa611eb3c3d4bee42af18f280452ad893450 100644 (file)
 # ..................................................
 #
 
-include_directories(${UMFPACK_BUNDLED_INCLUDE_DIRS})
-
 #
 # *Shush!*
 # (Remove locally in this subdirectory)
index a713948d67fec17060a520f5c861eb800931f8eb..27d5209f9ea654029bf3b00e127e3a9f5d72abe2 100644 (file)
@@ -70,10 +70,5 @@ macro(feature_taskflow_find_external var)
 endmacro()
 
 
-macro(feature_taskflow_configure_bundled)
-  list(APPEND TASKFLOW_BUNDLED_INCLUDE_DIRS ${TASKFLOW_FOLDER}/include)
-endmacro()
-
-
 configure_feature(TASKFLOW)
 
index 76e846fcf6f8456968d518032afe3e97925115ca..29b3ff6ba082412c491ef5d73601d37fdbece4d5 100644 (file)
@@ -65,21 +65,4 @@ macro(feature_tbb_find_external var)
 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)
index 295616fda645ef868de5d17ed301c4085e0ed02b..5513de65bf9a5f4b7f5a46a93d7243a225d4d611 100644 (file)
@@ -32,116 +32,6 @@ set(DEAL_II_WITH_BOOST ON # Always true. We need it :-]
   )
 
 
-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)
 
@@ -256,7 +146,27 @@ endmacro()
 
 
 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()
 
 
index 5c2bfc04eb3d06e4a8ce6fd4f71cab9b1a6c76f5..9f7ffef5e166bd5846d45b6ed745692586309b83 100644 (file)
 
 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"
@@ -43,4 +37,5 @@ macro(feature_umfpack_error_message)
     )
 endmacro()
 
+
 configure_feature(UMFPACK)
index d744e42e5b08fa856b13840815c37d44fac6e75c..d020a7bfe430c13297c8b258184ebe2be2a69f3f 100644 (file)
@@ -21,18 +21,10 @@ set(DEAL_II_WITH_KOKKOS ON # Always true. We need it :-]
   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.
 #
@@ -46,3 +38,4 @@ if(NOT DEAL_II_WITH_KOKKOS)
       )
   endif()
 endif()
+
index b1d6f4c206c7a6a959297f0d1f13f20a25f9425c..0467f32c8863d57f65735b625ad207d76284e94d 100644 (file)
@@ -17,9 +17,4 @@
 # Configuration for the MUPARSER library:
 #
 
-macro(feature_muparser_configure_bundled)
-  set(MUPARSER_BUNDLED_INCLUDE_DIRS ${MUPARSER_FOLDER}/include)
-endmacro()
-
-
 configure_feature(MUPARSER)
index 8cffd83f2c5d7fc0b6b19f562498b3a58e581348..dc4e6a1c7dc5b1b82063b28ce720502f0ec3bc48 100644 (file)
@@ -218,7 +218,8 @@ macro(configure_feature _feature)
         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)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.