]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: correctly cache TestBoostBug, clean up cached variables
authorMatthias Maier <tamiko@43-1.org>
Mon, 18 Dec 2017 13:30:10 +0000 (07:30 -0600)
committerMatthias Maier <tamiko@43-1.org>
Mon, 18 Dec 2017 13:30:10 +0000 (07:30 -0600)
This commit ensures that the test result of TestBoostBug is correctly
cached (similarly to all other compilation checks).

Further, make sure that all cached variables for compatibility checks
for ADOLC and Boost are correctly unset again.

cmake/configure/configure_boost.cmake
cmake/modules/FindADOLC.cmake
cmake/modules/FindBOOST.cmake
cmake/modules/FindLAPACK.cmake

index bc4982ebdcb7b5dac068ef3bc0b2f5d0cc92bf40..761f6d43a45e3e34d1aff574e7ccd5fac5b58766 100644 (file)
@@ -92,7 +92,7 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
 
     IF(DEAL_II_WITH_ZLIB)
       #
-      # Test that Boost.Iostreams is usuable.
+      # Test that Boost.Iostreams is usable.
       #
       RESET_CMAKE_REQUIRED()
       PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
@@ -117,11 +117,9 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
           decompressing_stream.write (test, 1);
         }
         "
-        _boost_iostreams_usuable
+        BOOST_IOSTREAMS_USABLE
         )
-      IF(${_boost_iostreams_usuable})
-        MESSAGE(STATUS "Boost.Iostreams is usuable.")
-      ELSE()
+      IF(NOT ${BOOST_IOSTREAMS_USABLE})
         MESSAGE(STATUS
                 "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled "
                 "with zlib support but a simple test failed! "
@@ -134,36 +132,50 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
         SET(${var} FALSE)
       ENDIF()
       RESET_CMAKE_REQUIRED()
-    ENDIF()
+    ENDIF() # DEAL_II_WITH_ZLIB
 
-    IF(${var} AND DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
-      FILE(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug)
-      FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug)
-      EXECUTE_PROCESS(
-        COMMAND ${CMAKE_COMMAND}
-                  -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-                  -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-                  "-DBOOST_INCLUDE_DIRS=${BOOST_INCLUDE_DIRS}"
-                  "-DBOOST_LIBRARIES=${BOOST_LIBRARIES}"
-                  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure/TestBoostBug
-                  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug
-        RESULT_VARIABLE _boost_serialization_usuable
-        OUTPUT_QUIET
-        ERROR_QUIET
-      )
-      IF(${_boost_serialization_usuable} EQUAL 0)
-        EXECUTE_PROCESS(
-          COMMAND ${CMAKE_COMMAND} --build . --target run
-          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug
-          RESULT_VARIABLE _boost_serialization_usuable
-          OUTPUT_QUIET
-          ERROR_QUIET
-        )
+    IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
+      #
+      # Test that Boost.Serialization is usable.
+      #
+      IF(NOT DEFINED BOOST_SERIALIZATION_USABLE OR NOT ${BOOST_SERIALIZATION_USABLE})
+        # Only run this check if it hasn't successfully run previously.
+        MESSAGE(STATUS "Performing Test BOOST_SERIALIZATION_USABLE")
+        IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
+          FILE(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug)
+          FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug)
+          EXECUTE_PROCESS(
+            COMMAND ${CMAKE_COMMAND}
+                      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+                      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+                      "-DBOOST_INCLUDE_DIRS=${BOOST_INCLUDE_DIRS}"
+                      "-DBOOST_LIBRARIES=${BOOST_LIBRARIES}"
+                      ${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure/TestBoostBug
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug
+            RESULT_VARIABLE _result
+            OUTPUT_QUIET
+            ERROR_QUIET
+          )
+          IF(${_result} EQUAL 0)
+            EXECUTE_PROCESS(
+              COMMAND ${CMAKE_COMMAND} --build . --target run
+              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug
+              RESULT_VARIABLE _result
+              OUTPUT_QUIET
+              ERROR_QUIET
+            )
+          ENDIF()
+        ENDIF()
+        IF(${_result} EQUAL 0)
+          MESSAGE(STATUS "Performing Test BOOST_SERIALIZATION_USABLE - Success")
+          SET(BOOST_SERIALIZATION_USABLE TRUE CACHE INTERNAL "")
+        ELSE()
+          MESSAGE(STATUS "Performing Test BOOST_SERIALIZATION_USABLE - Failed")
+          SET(BOOST_SERIALIZATION_USABLE FALSE)
+        ENDIF()
       ENDIF()
 
-      IF(${_boost_serialization_usuable} EQUAL 0)
-        MESSAGE(STATUS "Boost.Serialization is usuable.")
-      ELSE()
+      IF(NOT ${BOOST_SERIALIZATION_USABLE})
         MESSAGE(STATUS
                 "The externally provided Boost.Serialization library "
                 "failed to pass a crucial test. \n"
@@ -177,7 +189,7 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
            )
         SET(${var} FALSE)
       ENDIF()
-    ENDIF()
+    ENDIF() # DEAL_II_ALLOW_PLATFORM_INTROSPECTION
   ENDIF()
 ENDMACRO()
 
index 58c7ed354c233641fb08ae91e526b5470fe0c264..1839774429e8a4c3bd8838f425bc44ae4277c176 100644 (file)
@@ -83,4 +83,5 @@ DEAL_II_PACKAGE_HANDLE(ADOLC
   INCLUDE_DIRS REQUIRED ADOLC_INCLUDE_DIR
   USER_INCLUDE_DIRS REQUIRED ADOLC_INCLUDE_DIR
   CLEAR ADOLC_INCLUDE_DIR ADOLC_LIBRARY ADOLC_SETTINGS_H
+    ADOLC_DOUBLE_CAST_CHECK # clean up check in configure_adolc.cmake
   )
index 5e878986856c4ecd1176180f958b978d5ddffc45..43be610a120ae189eb1a7bf7f15995e2019aa6ec 100644 (file)
@@ -103,4 +103,6 @@ DEAL_II_PACKAGE_HANDLE(BOOST
     Boost_LIBRARY_DIR_DEBUG Boost_LIBRARY_DIR_RELEASE
     _Boost_COMPONENTS_SEARCHED _Boost_INCLUDE_DIR_LAST
     _Boost_LIBRARY_DIR_LAST _Boost_USE_MULTITHREADED_LAST
+    BOOST_IOSTREAMS_USABLE # clean up check in configure_boost.cmake
+    BOOST_SERIALIZATION_USABLE # clean up check in configure_boost.cmake
   )
index 001e5ce9489b0abb709ca00539f98c367fa4a935..abc32db46d70badd8b6a81c9e24a9aedba5a4569 100644 (file)
@@ -87,5 +87,5 @@ DEAL_II_PACKAGE_HANDLE(LAPACK
     eigen_blas_LIBRARY f77blas_LIBRARY gslcblas_LIBRARY lapack_LIBRARY
     m_LIBRARY ptf77blas_LIBRARY ptlapack_LIBRARY refblas_LIBRARY
     reflapack_LIBRARY BLAS_LIBRARIES ${_additional_libraries}
-    LAPACK_SYMBOL_CHECK # Cleanup check in configure_1_lapack.cmake
+    LAPACK_SYMBOL_CHECK # clean up check in configure_1_lapack.cmake
   )

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.