From: maier Date: Thu, 27 Sep 2012 10:07:55 +0000 (+0000) Subject: Caching, done right. And prettify the configuration a bit X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb210aa19995c59d220e7aa1f10cc1c73293e110;p=dealii-svn.git Caching, done right. And prettify the configuration a bit git-svn-id: https://svn.dealii.org/branches/branch_cmake@26779 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/TODO.CMAKE b/deal.II/TODO.CMAKE index d9e8ee13fd..fec9deb49e 100644 --- a/deal.II/TODO.CMAKE +++ b/deal.II/TODO.CMAKE @@ -1,16 +1,10 @@ Major: -* Bug: Unset some cached tests variables. Notably: - - A Trilinos test - - the LAPACK routine checks - * Implement the documentation component. (I don't grok what's going on in this makefiles. There is a rudimentary doxygen call, though.) * Add the rest of the Bug tests -* Enable in source FindModules for P4est and Trilinos. - * The following features have to be written: * HDF5 * MUMPS diff --git a/deal.II/cmake/configure/configure_metis.cmake b/deal.II/cmake/configure/configure_metis.cmake index a962c23543..1c0b2c6585 100644 --- a/deal.II/cmake/configure/configure_metis.cmake +++ b/deal.II/cmake/configure/configure_metis.cmake @@ -8,9 +8,9 @@ MACRO(FEATURE_METIS_FIND_EXTERNAL var) IF(METIS_FOUND AND METIS_MAJOR GREATER 4) SET(${var} TRUE) ELSE() - MESSAGE(WARNING + MESSAGE(WARNING "\n" "Could not find a sufficient modern metis installation: " - "Version 5.x required!" + "Version 5.x required!\n\n" ) ENDIF() ENDMACRO() diff --git a/deal.II/cmake/configure/configure_p4est.cmake b/deal.II/cmake/configure/configure_p4est.cmake index b7ca93ff85..3cfc70a8b2 100644 --- a/deal.II/cmake/configure/configure_p4est.cmake +++ b/deal.II/cmake/configure/configure_p4est.cmake @@ -39,6 +39,11 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var) SET(${var} TRUE) ENDIF() + # + # Remove the variable from the cache to force a recheck: + # + UNSET(P4EST_WITH_MPI CACHE) + ENDIF() ENDMACRO() @@ -50,19 +55,9 @@ MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL var) LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR}) IF (CMAKE_BUILD_TYPE MATCHES "Debug") - IF(P4EST_DEBUG_FOUND AND SC_DEBUG_FOUND) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG - ${P4EST_DEBUG_LIBRARY} ${SC_DEBUG_LIBRARY} - ) - ELSE() - MESSAGE(STATUS - "No debug p4est and sc libraries were found. " - "The regular p4est and sc libs will be used for the debug target instead." - ) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG - ${P4EST_LIBRARY} ${SC_LIBRARY} - ) - ENDIF() + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG + ${P4EST_LIBRARY} ${SC_LIBRARY} + ) ENDIF() IF (CMAKE_BUILD_TYPE MATCHES "Release") @@ -85,7 +80,10 @@ MACRO(FEATURE_P4EST_ERROR_MESSAGE) "Could not find the p4est and sc libraries!\n\n" "Please ensure that the libraries are installed on your computer.\n" "If the libraries are not at a default location, either provide some hints\n" - "for the autodetection, or set the relevant variables by hand in ccmake.\n\n" + "for the autodetection:\n" + " $ P4EST_DIR=\"...\" cmake <...>\n" + " $ ccmake -DP4EST_DIR=\"...\" cmake <...>\n" + "or set the relevant variables by hand in ccmake.\n" ) ENDMACRO() diff --git a/deal.II/cmake/configure/configure_trilinos.cmake b/deal.II/cmake/configure/configure_trilinos.cmake index c3709253ab..9e12bb1a3d 100644 --- a/deal.II/cmake/configure/configure_trilinos.cmake +++ b/deal.II/cmake/configure/configure_trilinos.cmake @@ -138,6 +138,12 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-std=c++0x") LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIRS}) + # + # Remove the following variables from the cache to force a recheck: + # + UNSET(TRILINOS_SUPPORTS_CPP11 CACHE) + UNSET(TRILINOS_HAS_C99_TR1_WORKAROUND CACHE) + ENDIF(TRILINOS_FOUND) ENDMACRO() diff --git a/deal.II/cmake/modules/FindAMD.cmake b/deal.II/cmake/modules/FindAMD.cmake index 54ef5b7812..8fccdfdc10 100644 --- a/deal.II/cmake/modules/FindAMD.cmake +++ b/deal.II/cmake/modules/FindAMD.cmake @@ -37,3 +37,4 @@ ELSE() "An optional hint to an AMD directory" ) ENDIF() + diff --git a/deal.II/cmake/modules/FindP4EST.cmake b/deal.II/cmake/modules/FindP4EST.cmake index c09d32ad3b..39d0e16e4f 100644 --- a/deal.II/cmake/modules/FindP4EST.cmake +++ b/deal.II/cmake/modules/FindP4EST.cmake @@ -4,36 +4,34 @@ INCLUDE(FindPackageHandleStandardArgs) +SET_IF_EMPTY(P4EST_DIR "$ENV{P4EST_DIR}") + FIND_PATH(P4EST_INCLUDE_DIR p4est.h HINTS - ${P4EST_DIR}/include - $ENV{P4EST_DIR}/include + ${P4EST_DIR} + PATH_SUFFIXES + p4est include/p4est include src p4est/src ) FIND_LIBRARY(P4EST_LIBRARY NAMES p4est HINTS ${P4EST_DIR} - $ENV{P4EST_DIR} - PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib - ) - -FIND_LIBRARY(P4EST_DEBUG_LIBRARY - NAMES p4est_debug p4est.g - HINTS - ${P4EST_DIR} - $ENV{P4EST_DIR} - PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib + PATH_SUFFIXES + lib${LIB_SUFFIX} lib64 lib src ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG P4EST_LIBRARY P4EST_INCLUDE_DIR) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST_DEBUG DEFAULT_MSG P4EST_DEBUG_LIBRARY P4EST_INCLUDE_DIR) IF(P4EST_FOUND) MARK_AS_ADVANCED( P4EST_LIBRARY - P4EST_DEBUG_LIBRARY P4EST_INCLUDE_DIR + P4EST_DIR ) +ELSE() + SET(P4EST_DIR "" CACHE STRING + "An optional hint to a p4est installation/directory" + ) ENDIF() diff --git a/deal.II/cmake/modules/FindPETSC.cmake b/deal.II/cmake/modules/FindPETSC.cmake index f8b179d7db..3ba5f89059 100644 --- a/deal.II/cmake/modules/FindPETSC.cmake +++ b/deal.II/cmake/modules/FindPETSC.cmake @@ -212,3 +212,4 @@ ENDIF() UNSET(PETSC_INCLUDE_DIR_ARCH CACHE) UNSET(PETSC_PETSCCONF_H CACHE) UNSET(PETSC_PETSCVERSION_H CACHE) + diff --git a/deal.II/cmake/modules/FindSC.cmake b/deal.II/cmake/modules/FindSC.cmake index 3335349879..ea4190b496 100644 --- a/deal.II/cmake/modules/FindSC.cmake +++ b/deal.II/cmake/modules/FindSC.cmake @@ -2,12 +2,15 @@ INCLUDE(FindPackageHandleStandardArgs) +SET_IF_EMPTY(P4EST_DIR "$ENV{P4EST_DIR}") +SET_IF_EMPTY(SC_DIR "$ENV{SC_DIR}") + FIND_PATH(SC_INCLUDE_DIR sc.h HINTS - ${SC_DIR}/include - $ENV{SC_DIR}/include - ${P4EST_DIR}/include - $ENV{P4EST_DIR}/include + ${SC_DIR} + ${P4EST_DIR} + PATH_SUFFIXES + sc include/p4est include src sc/src p4est/sc/src ) @@ -15,29 +18,22 @@ FIND_LIBRARY(SC_LIBRARY NAMES sc HINTS ${SC_DIR} - $ENV{SC_DIR} ${P4EST_DIR} - $ENV{P4EST_DIR} - PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib - ) - -FIND_LIBRARY(SC_DEBUG_LIBRARY - NAMES sc_debug sc.g - HINTS - ${SC_DIR} - $ENV{SC_DIR} - ${P4EST_DIR} - $ENV{P4EST_DIR} - PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib + PATH_SUFFIXES + lib${LIB_SUFFIX} lib64 lib src ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SC DEFAULT_MSG SC_LIBRARY SC_INCLUDE_DIR) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(SC_DEBUG DEFAULT_MSG SC_DEBUG_LIBRARY SC_INCLUDE_DIR) IF(SC_FOUND) MARK_AS_ADVANCED( SC_LIBRARY - SC_DEBUG_LIBRARY SC_INCLUDE_DIR + SC_DIR ) +ELSE() + SET(SC_DIR "" CACHE STRING + "An optional hint to an sc installation/directory" + ) ENDIF() + diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake index f7884e4576..d2024987cf 100644 --- a/deal.II/cmake/modules/FindTRILINOS.cmake +++ b/deal.II/cmake/modules/FindTRILINOS.cmake @@ -14,6 +14,8 @@ INCLUDE(FindPackageHandleStandardArgs) +SET_IF_EMPTY(TRILINOS_DIR "$ENV{TRILINOS_DIR}") + # # Include the trilinos package configuration: # @@ -22,7 +24,6 @@ find_package(TRILINOS NAMES Trilinos TRILINOS HINTS ${TRILINOS_DIR} - $ENV{TRILINOS_DIR} PATH_SUFFIXES lib${LIB_SUFFIX}/cmake/Trilinos lib64/cmake/Trilinos @@ -57,9 +58,14 @@ FOREACH(library ${Trilinos_LIBRARIES}) NAMES ${library} HINTS ${Trilinos_LIBRARY_DIRS} ) - MARK_AS_ADVANCED(TRILINOS_LIBRARY_${library}) LIST(APPEND TRILINOS_LIBRARIES ${TRILINOS_LIBRARY_${library}}) + + # + # Remove the variables from the cache, so that updating TRILINOS_DIR will + # find the new libraries.. + # + UNSET(TRILINOS_LIBRARY_${library} CACHE) ENDFOREACH() @@ -75,5 +81,12 @@ IF(TRILINOS_FOUND) TRILINOS_INCLUDE_DIRS TRILINOS_LIBRARIES ) +ELSE() + IF(TRILINOS_DIR MATCHES "-NOTFOUND") + SET(TRILINOS_DIR "" CACHE STRING + "A hint to a Trilinos installation" + FORCE + ) + ENDIF() ENDIF()