]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Code cleanup
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Sep 2012 14:55:19 +0000 (14:55 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Sep 2012 14:55:19 +0000 (14:55 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26783 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/cmake/configure/configure_1_mpi.cmake
deal.II/cmake/configure/configure_1_tbb.cmake
deal.II/cmake/configure/configure_boost.cmake
deal.II/cmake/configure/configure_doxygen.cmake
deal.II/cmake/configure/configure_functionparser.cmake
deal.II/cmake/configure/configure_lapack.cmake
deal.II/cmake/configure/configure_p4est.cmake
deal.II/cmake/configure/configure_petsc.cmake
deal.II/cmake/modules/FindP4EST.cmake
deal.II/cmake/modules/FindPETSC.cmake
deal.II/include/deal.II/base/config.h.in
deal.II/source/lac/slepc_solver.cc

index 07017f682e5d7a8eddcafb9f2be7df7075e9ea42..ec821a5b6bc55d70fa41ce8c01df282b7e4f9d8a 100644 (file)
@@ -44,8 +44,10 @@ MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var)
   SET(${var} TRUE)
 ENDMACRO()
 
+
 SET(FEATURE_MPI_CUSTOM_ERROR_MESSAGE TRUE)
 
+
 MACRO(FEATURE_MPI_ERROR_MESSAGE)
   MESSAGE(SEND_ERROR "\n"
     "Could not find any suitable mpi library!\n\n"
index acae8bdc5457635256a46b893a8620b1b0841c09..1b040d93ab9be96879c082363808da9bce73ca78 100644 (file)
@@ -68,12 +68,11 @@ MACRO(SETUP_THREADING var)
       #endif
       int main(){ return 0; }
       "
-      DEAL_II_HAVE_SANE_MT_DEFINITIONS)
+      DEAL_II_HAVE_MT_DEFINITIONS)
     STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
 
-    IF(NOT DEAL_II_HAVE_SANE_MT_DEFINITIONS)
+    IF(NOT DEAL_II_HAVE_MT_DEFINITIONS)
       LIST(APPEND DEAL_II_DEFINITIONS "_REENTRANT" "_THREAD_SAFE")
-      LIST(APPEND DEAL_II_USER_DEFINITIONS "_REENTRANT" "_THREAD_SAFE") # TODO: Necessary?
     ENDIF()
 
   ENDIF(Threads_FOUND)
@@ -126,6 +125,7 @@ SET(FEATURE_TBB_HAVE_CONTRIB TRUE)
 
 
 MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var)
+  SET(tbb_folder "${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss")
 
   #
   # Setup threading (before configuring our build...)
@@ -148,8 +148,6 @@ MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var)
       )
   ENDIF()
 
-  SET(tbb_folder "${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss")
-
   INCLUDE_DIRECTORIES(${tbb_folder}/include)
 
   #
index 00b670d801a0644ee144350adc3b5e7af6957db4..e0a8038929855965230ea974fae76e18f1762a27 100644 (file)
@@ -111,3 +111,4 @@ IF(NOT DEAL_II_WITH_BOOST)
       )
   ENDIF()
 ENDIF()
+
index 4b639b4c12933af8b19a67a51da094c7ae07012c..6c9c015333688e6a75012bf07b426b5fddea973e 100644 (file)
@@ -26,9 +26,6 @@ MACRO(FEATURE_DOXYGEN_CONFIGURE_EXTERNAL var)
   #   DOXYGEN_DOT_FOUND      = Was Dot found or not?
   #   DOXYGEN_DOT_PATH       = The path to dot not including the executable
   #
-  # Use these variables to set up a custom target:
-  #
-
   SET(${var} TRUE)
 ENDMACRO()
 
index 04f0af5dd8a92365e7fd829a630ecedcd0377647..a6f9a936679ad5f1cffdfd1183b7fb9f40c3d6b0 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Configuration for functionparser
+#
+
 MACRO(FEATURE_FUNCTIONPARSER_FIND_EXTERNAL var)
   MESSAGE(STATUS
     "No module available for finding functionparser externally."
index b7564bc6ffdd4897f6cfdb82b6ff7a4d2173ee69..8db82dff6cb36eec92a4682c6fdda33293f31394 100644 (file)
@@ -1,3 +1,4 @@
+
 #
 # Configuration for the lapack library:
 #
@@ -19,8 +20,8 @@ ENDMACRO()
 # function we use. We have to ensure that this check is repeated every time
 # the lapack library or DEAL_II_WITH_LAPACK changes.
 #
-# TODO: Known bug: At the moment we don't cover the case if the lapack
-#                  library changes.
+# TODO: Known bug: At the moment we don't cover the case when the lapack
+#                  library changes..
 #
 
 SET(DEAL_II_LAPACK_FUNCTIONS
@@ -51,6 +52,7 @@ MACRO(RESET_LAPACK_FUNCTIONS_CACHE)
   ENDFOREACH()
 ENDMACRO()
 
+
 MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var)
 
   ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
@@ -70,6 +72,7 @@ ENDMACRO()
 
 CONFIGURE_FEATURE(LAPACK)
 
+
 #
 # Call RESET_LAPACK_FUNCTIONS_CHECK if DEAL_II_WITH_LAPACK is unset to
 # clean the configuration
index 3cfc70a8b264e767035548253f0ce228a5ffaa63..0fc4bb2fdadfac37ebe44e4d4c74552e273b15e2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Configuration for the umfpack and amd libraries:
+# Configuration for the p4est and sc libraries:
 #
 
 
@@ -9,27 +9,14 @@ SET(FEATURE_P4EST_DEPENDS
 
 
 MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
+
   FIND_PACKAGE(P4EST)
   FIND_PACKAGE(SC)
 
   IF(P4EST_FOUND AND SC_FOUND)
-
     #
     # Check whether p4est supports mpi:
     #
-    LIST(APPEND CMAKE_REQUIRED_INCLUDES ${P4EST_INCLUDE_DIR})
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <p4est_config.h>
-      #ifndef P4EST_MPI
-      #  error p4est compiled without mpi support
-      invalid
-      #endif
-      int main() { return 0; }
-      "
-      P4EST_WITH_MPI)
-    LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${P4EST_INCLUDE_DIR}/p4est_config.h)
-
     IF(NOT P4EST_WITH_MPI)
       MESSAGE(WARNING "\n"
         "Could not find a sufficient p4est installation: "
@@ -38,13 +25,8 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
     ELSE()
       SET(${var} TRUE)
     ENDIF()
-
-    #
-    # Remove the variable from the cache to force a recheck:
-    #
-    UNSET(P4EST_WITH_MPI CACHE)
-
   ENDIF()
+
 ENDMACRO()
 
 
index 57dd1fc9e608c37008e390afe42804d32400ebba..17079e5e6a34bd4d8b2ca84c82a2aecf9d27c90d 100644 (file)
@@ -65,25 +65,6 @@ MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL var)
   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-long-long")
 
 
-  #
-  # Work around a stupidity in PETSc that makes sure it interferes in
-  # a completely obnoxious way with boost.
-  # TODO: Obsolete?
-  #
-  #SET(PETSC_SKIP_UNDERSCORE_CHKERR TRUE)
-
-  #
-  # Set some definitions for config.h:
-  #
-
-  IF(NOT PETSC_RELEASE)
-    SET(DEAL_II_USE_PETSC_DEV TRUE)
-  ENDIF()
-
-  IF(PETSC_COMPLEX)
-    SET(DEAL_II_USE_PETSC_COMPLEX TRUE)
-  ENDIF()
-
   SET(DEAL_II_EXPAND_PETSC_VECTOR "PETScWrappers::Vector")
   SET(DEAL_II_EXPAND_PETSC_BLOCKVECTOR "PETScWrappers::BlockVector")
 
index 7055ae712217742386d0dbd5aa164ea28a2cd395..3944aa64c891785e422cbcaa1e5b36877ec5e687 100644 (file)
@@ -24,6 +24,29 @@ FIND_LIBRARY(P4EST_LIBRARY
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG P4EST_LIBRARY P4EST_INCLUDE_DIR)
 
 IF(P4EST_FOUND)
+
+FIND_FILE(PETSC_PETSCVERSION_H petscversion.h
+  HINTS
+    ${PETSC_INCLUDE_DIRS}
+    NO_DEFAULT_PATH
+    NO_CMAKE_ENVIRONMENT_PATH
+    NO_CMAKE_PATH
+    NO_SYSTEM_ENVIRONMENT_PATH
+    NO_CMAKE_SYSTEM_PATH
+    NO_CMAKE_FIND_ROOT_PATH
+  )
+
+  #
+  # Determine mpi support of p4est:
+  #
+  FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING
+    REGEX "#define.*P4EST_MPI 1")
+  IF("${P4EST_MPI_STRING}" STREQUAL "")
+    SET(P4EST_WITH_MPI FALSE)
+  ELSE()
+    SET(P4EST_WITH_MPI TRUE)
+  ENDIF()
+
   MARK_AS_ADVANCED(
     P4EST_LIBRARY
     P4EST_INCLUDE_DIR
index 05d5a37da2cd1b6a4ad83c85a6428d207ee72399..cb32527e01b5c54b0b3595dc5fefe813bd7576e7 100644 (file)
@@ -11,8 +11,6 @@
 #     PETSC_VERSION_MINOR
 #     PETSC_VERSION_SUBMINOR
 #     PETSC_VERSION_PATCH
-#     PETSC_RELEASE
-#     PETSC_COMPLEX
 #
 
 INCLUDE(FindPackageHandleStandardArgs)
@@ -145,6 +143,8 @@ IF(PETSC_FOUND)
   ENDIF()
 
   IF(PETSC_WITH_MPIUNI)
+    #
+    # TODO: Still needed?
     #
     # If yes, add libmpiuni.so/a (if available)
     # We need to link with it on some systems where PETSc is built without
@@ -192,22 +192,6 @@ IF(PETSC_FOUND)
 
   SET(PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}")
 
-  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_RELEASE_STRING
-    REGEX "#define.*PETSC_VERSION_RELEASE.*1")
-  IF("${PETSC_RELEASE_STRING}" STREQUAL "")
-    SET(PETSC_RELEASE FALSE)
-  ELSE()
-    SET(PETSC_RELEASE TRUE)
-  ENDIF()
-
-  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_COMPLEX_STRING
-    REGEX "#define.*PETSC_USE_COMPLEX.*1")
-  IF("${PETSC_COMPLEX_STRING}" STREQUAL "")
-    SET(PETSC_COMPLEX FALSE)
-  ELSE()
-    SET(PETSC_COMPLEX TRUE)
-  ENDIF()
-
   MARK_AS_ADVANCED(
     PETSC_LIBRARIES
     PETSC_INCLUDE_DIRS
index 57cd2ad7dd0c329fa236ae7d3e853ca0ded31eea..4d4f4d0a21fcc7493ecbf59de2ab53b51b787eea 100644 (file)
 /* Defined if a PETSc installation was found and is going to be used */
 #cmakedefine DEAL_II_USE_PETSC
 
-/* Note: PETSCs version numbers will be directly included from
- * petscversion.h
- */
-
-/* Defined if a PETSc installation was found with complex scalar type and is
- * going to be used
- */
-#cmakedefine DEAL_II_USE_PETSC_COMPLEX
-
-/* Defined if a PETSc installation was found and is not a release */
-#cmakedefine DEAL_II_USE_PETSC_DEV
-
-/* Make sure PETSc doesn't re-define the underscore through the preprocessor,
- * since this interferes with boost. PETSc redefines the underscore to be
- * "__gterr =", but then forgets to undef this thing. Boost simply wants to
- * concatenate the underscore with another string to form a class name, which
- * then of course isn't valid any more. See mails in early Feb 2006.
+/*
+ * Note: The following definitions will be set in petscconf.h and
+ *       petscversion.h, so we don't repeat them here.
  *
- * TODO: Obsolete?
+ *  PETSC_VERSION_MAJOR
+ *  PETSC_VERSION_MINOR
+ *  PETSC_VERSION_SUBMINOR
+ *  PETSC_VERSION_PATCH
+ *  PETSC_VERSION_RELEASE
+ *  PETSC_USE_COMPLEX
  */
-#cmakedefine PETSC_SKIP_UNDERSCORE_CHKERR
 
 /**
  * These macros are defined to make testing for PETSc versions within
index 3c4c21a3784c73422ae064dd0239e502341ebb0f..2b73fd617baff0b50b3bae6e791c042606ceb456 100644 (file)
@@ -170,7 +170,7 @@ namespace SLEPcWrappers
 
   void
   SolverBase::get_eigenpair (const unsigned int         index,
-#ifndef DEAL_II_USE_PETSC_COMPLEX
+#ifndef PETSC_USE_COMPLEX
                              double                    &kr,
 #else
                              std::complex<double>      &kr,

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.