]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Major overhaul of the auto configuration
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Oct 2012 20:11:37 +0000 (20:11 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Oct 2012 20:11:37 +0000 (20:11 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26957 0785d39b-7218-0410-832d-ea1e28bc413d

18 files changed:
deal.II/README.CMAKE
deal.II/cmake/configure/configure_1_mpi.cmake
deal.II/cmake/configure/configure_1_tbb.cmake
deal.II/cmake/configure/configure_arpack.cmake
deal.II/cmake/configure/configure_doxygen.cmake
deal.II/cmake/configure/configure_lapack.cmake
deal.II/cmake/configure/configure_metis.cmake
deal.II/cmake/configure/configure_mumps.cmake
deal.II/cmake/configure/configure_netcdf.cmake
deal.II/cmake/configure/configure_p4est.cmake
deal.II/cmake/configure/configure_petsc.cmake
deal.II/cmake/configure/configure_trilinos.cmake
deal.II/cmake/configure/configure_umfpack.cmake
deal.II/cmake/configure/configure_zlib.cmake
deal.II/cmake/macros/macro_configure_feature.cmake
deal.II/cmake/modules/FindMUMPS.cmake
deal.II/cmake/setup_deal_ii.cmake
deal.II/cmake/setup_finalize.cmake

index a0614581cd603fcf3bd6bd1548a07b9b7a4629d7..2753f246a30e5657974615dc887c286e176ba489 100644 (file)
@@ -222,16 +222,6 @@ CONFIGURATION
   forces the use of the bundled  library regardless whether
   DEAL_II_ALLOW_BUNDLED is set to OFF or an external library is found.
 
-
-  Autoconfiguration:
-
-  If the option DEAL_II_FEATURE_AUTODETECTION is enabled the
-  DEAL_II_WITH_<feature> toggles will be automatically set (overwriting any
-  previous configuration) depending on whether they can be supported or
-  not.
-  (Note: DEAL_II_FEATURE_AUTODETECTION will respect DEAL_II_ALLOW_BUNDLED
-  and DEAL_II_FORCE_BUNDLED_<feature>)
-
   REMARKS:
 
   - To ensure that no bundled library is used at all DEAL_II_ALLOW_BUNDLED,
@@ -242,6 +232,25 @@ CONFIGURATION
     separately.
 
 
+  Auto configuration:
+
+  As long as DEAL_II_WITH_<FEATURE> is not set to ON or OFF in the cache it
+  will be automatically configured. If a toggle DEAL_II_WITH_<FEATURE> is
+  defined it won't be altered.
+  This means that the very first configuration run will set all (at that
+  moment) available features to ON and the rest to OFF. In all subsequent
+  configuration steps DEAL_II_WITH_<FEATURE> have to be changed by hand.)
+
+  This behaviour can be controlled via the variables:
+
+    - DISABLE_AUTODETECTION=ON: This will disable any autoconfiguration by
+      setting undefined DEAL_II_WITH_<FEATURE> toggles to OFF:
+
+    - FORCE_AUTODETECTION=ON: This will force the reconfiguration of every
+      feature by undefining DEAL_II_WITH_<FEATURE> prior to configuration,
+      effectively overwriting _any_ supplied or cached value.
+
+
   External library locations
   ==========================
 
index ff934f4a9c08b13a03308cd9fec7716176c8d481..adf42edd9e3b8829967a2b522e25669181098dfa 100644 (file)
 # Configuration for mpi support:
 #
 
-OPTION(DEAL_II_WITH_MPI
-  "Build deal.II with support for mpi."
-  OFF)
-
 
 MACRO(FEATURE_MPI_FIND_EXTERNAL var)
   FIND_PACKAGE(MPI)
index 33eeb29c30d6eab098e716bfcfeb2c06d80c6fbc..31b92f9c8c53b5f701d6ec9af7a452779802e699 100644 (file)
 # Configuration for tbb support:
 #
 
-OPTION(DEAL_II_WITH_TBB
-  "Build deal.II with support for tbb. This will enable thread support in deal.II."
-  OFF)
-
 
 #
 # Set up genereal threading:
index 8fb96d8a8dfc093f90d92ee4ad0c3c8e108ea9ae..9f67911072dc8d540285e36bcf77879a52026aa5 100644 (file)
 # Configuration for the ARPACK library:
 #
 
-OPTION(DEAL_II_WITH_ARPACK
-  "Build deal.II with support for arpack."
-  OFF)
-
 
 MACRO(FEATURE_ARPACK_FIND_EXTERNAL var)
   FIND_PACKAGE(ARPACK)
index f982708c2c5594d555a09d289a8cfa4cc029c22c..b8e58e2d4d5e5ac87a2fd04d3cbf6ac7db9dfbf5 100644 (file)
 # Configuration for doxygen
 #
 
-OPTION(DEAL_II_WITH_DOXYGEN
-  "Build deal.II with support for doxygen and dot."
-  OFF)
-
 
 MACRO(FEATURE_DOXYGEN_FIND_EXTERNAL var)
   FIND_PACKAGE(Doxygen)
index 0c3e6edd8cc65cb9564d4b06ab550c6a5840dbe8..2e7d48a32f140239ff464992bb7446a8df958768 100644 (file)
 #
 
 
-OPTION(DEAL_II_WITH_LAPACK
-  "Build deal.II with support for LAPACK."
-  OFF)
-
-
 MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
   FIND_PACKAGE(LAPACK)
 
index 2a869da9ef955ac9b3a67c34a183760db9bc546a..ddf4b8e34b5c8caf57c4ba14fbae00dcd33696d9 100644 (file)
 # Configuration for the netcdf library:
 #
 
-OPTION(DEAL_II_WITH_METIS
-  "Build deal.II with support for Metis."
-  OFF)
-
 
 MACRO(FEATURE_METIS_FIND_EXTERNAL var)
   FIND_PACKAGE(METIS)
index e0d95b65d8e7770b0c2d926a3e26e5372fd5bfcf..2942b9a8405f83f9c18880be4fbf66a8bc555422 100644 (file)
@@ -16,9 +16,6 @@
 # Configuration for the MUMPS library:
 #
 
-OPTION(DEAL_II_WITH_MUMPS
-  "Build deal.II with support for MUMPS."
-  OFF)
 
 SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI)
 
index 0f55788cfe984321fb5d4e1b5561f7252875e40d..cc5e4546ce63953cbdab1cba7e89370c14f34151 100644 (file)
 # Configuration for the netcdf library:
 #
 
-OPTION(DEAL_II_WITH_NETCDF
-  "Build deal.II with support for netcdf."
-  OFF)
-
 
 MACRO(FEATURE_NETCDF_FIND_EXTERNAL var)
   FIND_PACKAGE(NETCDF)
index 41c088c0c9be49a3b8b39e28818f4faad124d895..0c8c03fedcf8cd68425cd40d113c25a94f43c28d 100644 (file)
 # Configuration for the p4est and sc libraries:
 #
 
-OPTION(DEAL_II_WITH_P4EST
-  "Build deal.II with support for p4est."
-  OFF)
-
 
 SET(FEATURE_P4EST_DEPENDS DEAL_II_WITH_MPI)
 
index 43366cb15e64a320aadfc205be6716f5f59ef538..6247da4c62a8e1c4aad2c23a5e95d04e65cb433d 100644 (file)
 # Configuration for the petsc library:
 #
 
-OPTION(DEAL_II_WITH_PETSC
-  "Build deal.II with support for petsc."
-  OFF)
-
 
 MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
 
index ac3b560f3845e25593de66d224c05365a49ea62d..f1eb7ad95f2ea01f7517319c7ded26e0780d41c0 100644 (file)
 # Configuration for the trilinos library:
 #
 
-OPTION(DEAL_II_WITH_TRILINOS
-  "Build deal.II with support for trilinos."
-  OFF)
-
 
 MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
   FIND_PACKAGE(TRILINOS)
index fcf594b8b97d0f2f9d8be45b73d20cc9b5c80649..9c926a48c92fa2af05eeaab48bd9fc7a9300e93f 100644 (file)
 # Configuration for the umfpack and amd libraries:
 #
 
-OPTION(DEAL_II_WITH_UMFPACK
-  "Build deal.II with support for UMFPACK."
-  OFF)
-
 
 MACRO(FEATURE_UMFPACK_FIND_EXTERNAL var)
   FIND_PACKAGE(UMFPACK)
index 069e9b9616dda6bacfeb53e4b7b6bebd9b092311..858d81f9ca4dea62fc36311d0678629209c81be2 100644 (file)
@@ -16,9 +16,6 @@
 # Configuration for the zlib library:
 #
 
-OPTION(DEAL_II_WITH_ZLIB
-  "Build deal.II with support for zlib."
-  OFF)
 
 MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
   FIND_PACKAGE(ZLIB)
index ad37ccb3cfeabe0d9f2ed32d91da8e8f968ade84..a497af88a3c6e0d6b08ea4a918f8faeb31273530 100644 (file)
@@ -87,10 +87,11 @@ ENDMACRO()
 # A small macro to set the DEAL_II_WITH_${feature} variables:
 #
 MACRO(SET_CACHED_OPTION str value)
-  SET(${str}
+  STRING(TOLOWER "${str}" str_lower)
+  SET(DEAL_II_WITH_${str}
     ${value}
     CACHE BOOL
-    "Automatically set due to DEAL_II_FEATURE_AUTODETECTION"
+    "Build deal.II with support for ${str_lower}."
     FORCE)
 ENDMACRO()
 
@@ -145,10 +146,25 @@ MACRO(CONFIGURE_FEATURE feature)
     ENDIF()
   ENDFOREACH()
 
+
+  #
+  # Obey the user overrides:
+  #
+  IF(FORCE_AUTODETECTION)
+    UNSET(DEAL_II_WITH_${feature})
+  ENDIF()
+  IF(DISABLE_AUTODETECTION AND
+    (NOT DEFINED DEAL_II_WITH_${feature}) )
+    SET_CACHED_OPTION(${feature} OFF)
+  ENDIF()
+
+
   #
-  # Only try to configure ${feature} if we have to:
+  # Only try to configure ${feature} if we have to, i.e.
+  # DEAL_II_WITH_${feature} is set to true or not set at all.
   #
-  IF(DEAL_II_FEATURE_AUTODETECTION OR DEAL_II_WITH_${feature})
+  IF((NOT DEFINED DEAL_II_WITH_${feature}) OR
+     DEAL_II_WITH_${feature})
 
     #
     # Are all dependencies fullfilled?
@@ -156,17 +172,17 @@ MACRO(CONFIGURE_FEATURE feature)
     SET(macro_dependencies_ok TRUE)
     FOREACH(macro_dependency ${FEATURE_${feature}_DEPENDS})
       IF(NOT ${macro_dependency})
-        IF(DEAL_II_FEATURE_AUTODETECTION)
-          MESSAGE(STATUS
+        IF(DEAL_II_WITH_${feature})
+          MESSAGE(SEND_ERROR "\n"
             "DEAL_II_WITH_${feature} has unmet configuration requirements: "
-            "${macro_dependency} has to be set to \"ON\"."
+            "${macro_dependency} has to be set to \"ON\".\n\n"
             )
-          SET_CACHED_OPTION(DEAL_II_WITH_${feature} OFF)
         ELSE()
-          MESSAGE(SEND_ERROR "\n"
+          MESSAGE(STATUS
             "DEAL_II_WITH_${feature} has unmet configuration requirements: "
-            "${macro_dependency} has to be set to \"ON\".\n\n"
+            "${macro_dependency} has to be set to \"ON\"."
             )
+          SET_CACHED_OPTION(${feature} OFF)
         ENDIF()
         SET(macro_dependencies_ok FALSE)
       ENDIF()
@@ -186,9 +202,7 @@ MACRO(CONFIGURE_FEATURE feature)
             MESSAGE(STATUS
               "DEAL_II_WITH_${feature} successfully set up with bundled packages."
               )
-            IF(DEAL_II_FEATURE_AUTODETECTION)
-              SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
-            ENDIF()
+            SET_CACHED_OPTION(${feature} ON)
           ELSE()
             # This should not happen. So give an error
             MESSAGE(SEND_ERROR
@@ -223,9 +237,7 @@ MACRO(CONFIGURE_FEATURE feature)
             MESSAGE(STATUS
               "DEAL_II_WITH_${feature} successfully set up with external dependencies."
               )
-            IF(DEAL_II_FEATURE_AUTODETECTION)
-              SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
-            ENDIF()
+            SET_CACHED_OPTION(${feature} ON)
           ELSE()
             # This should not happen. So give an error
             MESSAGE(SEND_ERROR
@@ -248,7 +260,7 @@ MACRO(CONFIGURE_FEATURE feature)
                 "DEAL_II_WITH_${feature} successfully set up with bundled packages."
                 )
               IF(DEAL_II_FEATURE_AUTODETECTION)
-                SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
+                SET_CACHED_OPTION(${feature} ON)
               ENDIF()
             ELSE()
               # This should not happen. So give an error
@@ -257,21 +269,21 @@ MACRO(CONFIGURE_FEATURE feature)
                 )
             ENDIF()
           ELSE()
-              IF(DEAL_II_FEATURE_AUTODETECTION)
-                SET_CACHED_OPTION(DEAL_II_WITH_${feature} OFF)
+            IF(DEAL_II_WITH_${feature})
+              IF(FEATURE_${feature}_CUSTOM_ERROR_MESSAGE)
+                RUN_COMMAND("FEATURE_${feature}_ERROR_MESSAGE()")
               ELSE()
-                IF(FEATURE_${feature}_CUSTOM_ERROR_MESSAGE)
-                  RUN_COMMAND("FEATURE_${feature}_ERROR_MESSAGE()")
-                ELSE()
-                  FEATURE_ERROR_MESSAGE(${feature})
-                ENDIF()
+                FEATURE_ERROR_MESSAGE(${feature})
               ENDIF()
+            ELSE()
+              SET_CACHED_OPTION(${feature} OFF)
+            ENDIF()
           ENDIF()
 
         ENDIF(FEATURE_${feature}_EXTERNAL_FOUND)
-      ENDIF(DEAL_II_FORCE_BUNDLED_${feature})
-    ENDIF(macro_dependencies_ok)
-  ENDIF(DEAL_II_FEATURE_AUTODETECTION OR DEAL_II_WITH_${feature})
+      ENDIF()
+    ENDIF()
+  ENDIF()
 
   SET(FEATURE_${feature}_PROCESSED TRUE)
 
index 07280d1da98e61eb0a1f4b9d84bd98847f693614..15f3ecfa61b5aaa7f2b1dc45f803d62498d0e6da 100644 (file)
@@ -73,6 +73,8 @@ FIND_LIBRARY(PORD_LIBRARY
     ${MUMPS_DIR}
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )
+MARK_AS_ADVANCED(PORD_LIBRARY)
+
 IF(NOT PORD_LIBRARY MATCHES "-NOTFOUND")
   LIST(APPEND MUMPS_LIBRARIES
     ${PORD_LIBRARY}
index 8c6dc04c86336a8fcebb1a02007d8fa12ac09999..dc59a60116e391dd49af492d11b5562a2c1c58d4 100644 (file)
@@ -20,7 +20,6 @@
 #
 # General configuration options:
 #
-#     DEAL_II_FEATURE_AUTODETECTION   **)
 #     DEAL_II_ALLOW_BUNDLED           **)
 #     DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS **)
 #     DEAL_II_COMPONENT_COMPAT_FILES  **)
 #     DEAL_II_WITH_BUNDLED_DIRECTORY
 #     DEAL_II_WITH_DOC_DIRECTORY
 #
-# *)  Values marked with *) can be overwritten by the command line via
-#     -D<...>
-# **) Cached Option. Can be set via ccmake or on the command line via
+# *)  Uncached variables. Can be overwritten by the command line via
 #     -D<...>
+# **) Cached Options. Can be set via ccmake or on the command line via -D<...>
 #
 
 
@@ -90,11 +88,6 @@ ENDIF()
 #                                                                         #
 ###########################################################################
 
-OPTION(DEAL_II_FEATURE_AUTODETECTION
-  "Enables feature autodetection. This will automatically set DEAL_II_WITH_<...> options."
-  ON
-  )
-
 OPTION(DEAL_II_ALLOW_BUNDLED
   "Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)"
   ON
index ee25e388af3aa9ae039e15abc7342208bf5c73a5..2c0b2eaf0e8e385d669dd95aac1be213f22a2ee0 100644 (file)
@@ -109,12 +109,23 @@ ELSEIF(NOT DEAL_II_KNOWN_COMPILER)
   FILE(APPEND ${log} "\nWARNING: Unknown compiler! Please set compiler flags by hand.\n")
 ENDIF()
 
-
 FILE(APPEND ${log}
   "\nConfigured Features ("
-  "DEAL_II_FEATURE_AUTODETECTION = ${DEAL_II_FEATURE_AUTODETECTION}, "
+  )
+IF(FORCE_AUTODETECTION)
+  FILE(APPEND ${log}
+    "!!! FORCE_AUTODETECTION !!!, "
+    )
+ENDIF()
+IF(DISABLE_AUTODETECTION)
+  FILE(APPEND ${log}
+    "!!! DISABLE_AUTODETECTION !!!, "
+    )
+ENDIF()
+FILE(APPEND ${log}
   "DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}):\n"
   )
+
 GET_CMAKE_PROPERTY(res VARIABLES)
 FOREACH(var ${res})
   IF(var MATCHES "DEAL_II_WITH")

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.