From ca84d05987fd48fd3de346960db6bfe1eb9875d9 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 11 Sep 2012 09:32:13 +0000 Subject: [PATCH] A bunch of checks git-svn-id: https://svn.dealii.org/branches/branch_cmake@26276 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 25 ++-- deal.II/aclocal.m4 | 124 ------------------ .../cmake/modules/configure_threads.cmake | 3 + .../cmake/tests/check_for_cxx_features.cmake | 51 ++++++- deal.II/include/deal.II/base/config.h.in | 63 ++++++++- deal.II/include/deal.II/base/config.h.in.old | 49 ------- 6 files changed, 126 insertions(+), 189 deletions(-) diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index aa985c72ca..5c3c0e14c1 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -2,13 +2,6 @@ PROJECT(deal.II) SET(VERSION "8.0.pre") -SET(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org") -SET(DEAL_II_PACKAGE_NAME "deal.II") -SET(DEAL_II_PACKAGE_TARNAME ${DEAL_II_PACKAGE_NAME}) -SET(DEAL_II_PACKAGE_VERSION ${VERSION}) -SET(DEAL_II_PACKAGE_STRING "${DEAL_II_PACKAGE_NAME} ${DEAL_II_PACKAGE_VERSION}") -SET(DEAL_II_PACKAGE_URL "") - @@ -29,6 +22,22 @@ SET(CMAKE_MODULE_PATH +# +# Set up deal.II specific variables +# + +SET(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org") +SET(DEAL_II_PACKAGE_NAME "deal.II") +SET(DEAL_II_PACKAGE_TARNAME ${DEAL_II_PACKAGE_NAME}) +SET(DEAL_II_PACKAGE_VERSION ${VERSION}) +SET(DEAL_II_PACKAGE_STRING "${DEAL_II_PACKAGE_NAME} ${DEAL_II_PACKAGE_VERSION}") +SET(DEAL_II_PACKAGE_URL "") +STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" DEAL_II_MAJOR "${VERSION}") +STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_MINOR "${VERSION}") +SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX}) + + + # # General configuration options: @@ -82,7 +91,7 @@ OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK # -# Now, configure and configure a lot of things: +# Now, configure a lot of things: # # used as a dummy target for all the stuff that has to be done before the diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 61bf7ecf1b..0d3bcdcc02 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -5154,130 +5154,6 @@ int main () { -dnl ------------------------------------------------------------- -dnl Check whether the numeric_limits classes are available -dnl -dnl Usage: DEAL_II_HAVE_STD_NUMERIC_LIMITS -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_HAVE_STD_NUMERIC_LIMITS, dnl -[ - AC_MSG_CHECKING(for std::numeric_limits classes) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ -#include - ], - [ - return std::numeric_limits::min(); - ], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_STD_NUMERIC_LIMITS, 1, - [Define if the compiler's library in use provides - std::numeric_limits classes in the appropriate header file]) - ], - [ - AC_MSG_RESULT(no) - ]) -]) - - - -dnl ------------------------------------------------------------- -dnl Check whether the numeric_limits classes are available -dnl -dnl Usage: DEAL_II_HAVE_STD_OSTREAM_HEADER -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_HAVE_STD_OSTREAM_HEADER, dnl -[ - AC_MSG_CHECKING(for header) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ -#include -void f (const std::ostream &out); - ], - [ - ], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_STD_OSTREAM_HEADER, 1, - [Define if the compiler provides an header file]) - ], - [ - AC_MSG_RESULT(no) - ]) -]) - - - -dnl ------------------------------------------------------------- -dnl Check whether the header is available -dnl -dnl Usage: DEAL_II_HAVE_STD_OSTREAM_HEADER -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_HAVE_STD_IOSFWD_HEADER, dnl -[ - AC_MSG_CHECKING(for header) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ -#include -void f (const std::ostream &out); - ], - [ - ], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_STD_IOSFWD_HEADER, 1, - [Define if the compiler provides an header file]) - ], - [ - AC_MSG_RESULT(no) - ]) -]) - - - -dnl ------------------------------------------------------------- -dnl Check whether the std::vector::iterator is just a plain pointer -dnl -dnl Usage: DEAL_II_CHECK_VECTOR_ITERATOR_IS_POINTER -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_VECTOR_ITERATOR_IS_POINTER, dnl -[ - AC_MSG_CHECKING(whether vector iterators are plain pointers) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ -#include -template void f(T) {} - -template void f(int *); -template void f(std::vector::iterator); - ], - [ - ], - [ - AC_MSG_RESULT(no) - ], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(DEAL_II_VECTOR_ITERATOR_IS_POINTER, 1, - [Define if vector iterators are just plain pointers]) - ]) -]) - - - dnl ------------------------------------------------------------- dnl Check whether glibc-like stacktrace information is available dnl for the Exception class. If it is, then try to also determine diff --git a/deal.II/contrib/cmake/modules/configure_threads.cmake b/deal.II/contrib/cmake/modules/configure_threads.cmake index 6780635c1b..14e06f5f3d 100644 --- a/deal.II/contrib/cmake/modules/configure_threads.cmake +++ b/deal.II/contrib/cmake/modules/configure_threads.cmake @@ -1,5 +1,8 @@ FIND_PACKAGE(Threads REQUIRED) +# TODO: Necessary link commands for threads? Or are they set automatically +# by the package? + IF(DEAL_II_ALLOW_CONTRIB) FIND_PACKAGE(TBB) ELSE() diff --git a/deal.II/contrib/cmake/tests/check_for_cxx_features.cmake b/deal.II/contrib/cmake/tests/check_for_cxx_features.cmake index 36af404f74..8aa63402c8 100644 --- a/deal.II/contrib/cmake/tests/check_for_cxx_features.cmake +++ b/deal.II/contrib/cmake/tests/check_for_cxx_features.cmake @@ -1,4 +1,5 @@ INCLUDE(CheckCXXSourceCompiles) +INCLUDE(CheckIncludeFiles) # # Check for various CXX Features. @@ -6,7 +7,6 @@ INCLUDE(CheckCXXSourceCompiles) - # # gcc2.95 doesn't have the std::iterator class, but the standard # requires it, so check whether we have to work around it @@ -33,3 +33,52 @@ CHECK_CXX_SOURCE_COMPILES( int main(){return 0;} " HAVE_STD_STRINGSTREAM) + + +# +# Check whether the numeric_limits classes are available +# +CHECK_CXX_SOURCE_COMPILES( + " + #include + unsigned int i = std::numeric_limits::min(); + int main(){return 0;} + " + HAVE_STD_NUMERIC_LIMITS) + + +# +# Check whether the std::vector::iterator is just a plain pointer +# +CHECK_CXX_SOURCE_COMPILES( + " + #include + template void f(T) {} + template void f(int *); + template void f(std::vector::iterator); + int main(){return 0;} + " + DEAL_II_VECTOR_ITERATOR_IS_NOT_POINTER) + +IF(NOT DEAL_II_VECTOR_ITERATOR_IS_NOT_POINTER) + SET(DEAL_II_VECTOR_ITERATOR_IS_POINTER 1) +ENDIF() + + +# +# Checks for various header files: +# + +CHECK_INCLUDE_FILES("ostream" HAVE_STD_OSTREAM_HEADER) +CHECK_INCLUDE_FILES("iosfwd" HAVE_STD_IOSFWD_HEADER) +CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H) +CHECK_INCLUDE_FILES("stdlib.h" HAVE_STDLIB_H) +CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H) +CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H) +CHECK_INCLUDE_FILES("sys/stat.h" HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILES("sys/syscall.h" HAVE_SYS_SYSCALL_H) +CHECK_INCLUDE_FILES("sys/times.h" HAVE_SYS_TIMES_H) +CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H) + + +# /* Defined to 1 if you have the `strtrs_' function. */HAVE_STRTRS_ 1 diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 32f04518f5..1a66ce9923 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -15,7 +15,6 @@ #define __deal2__config_h - /** * Two macro names that we put at the top and bottom of all deal.II files * and that will be expanded to "namespace dealii {" and "}". @@ -24,22 +23,31 @@ #define DEAL_II_NAMESPACE_CLOSE } /* Define to the full name of this package. */ -#cmakedefine DEAL_II_PACKAGE_NAME "@DEAL_II_PACKAGE_NAME@" +#define DEAL_II_PACKAGE_NAME "@DEAL_II_PACKAGE_NAME@" /* Define to the one symbol short name of this package. */ -#cmakedefine DEAL_II_PACKAGE_TARNAME "@DEAL_II_PACKAGE_TARNAME@" +#define DEAL_II_PACKAGE_TARNAME "@DEAL_II_PACKAGE_TARNAME@" /* Define to the version of this package. */ -#cmakedefine DEAL_II_PACKAGE_VERSION "@DEAL_II_PACKAGE_VERSION@" +#define DEAL_II_PACKAGE_VERSION "@DEAL_II_PACKAGE_VERSION@" /* Define to the full name and version of this package. */ -#cmakedefine DEAL_II_PACKAGE_STRING "@DEAL_II_PACKAGE_STRING@" +#define DEAL_II_PACKAGE_STRING "@DEAL_II_PACKAGE_STRING@" /* Define to the address where bug reports for this package should be sent. */ -#cmakedefine DEAL_II_PACKAGE_BUGREPORT "@DEAL_II_PACKAGE_BUGREPORT@" +#define DEAL_II_PACKAGE_BUGREPORT "@DEAL_II_PACKAGE_BUGREPORT@" /* Define to the home page for this package. */ -#cmakedefine DEAL_II_PACKAGE_URL "@DEAL_II_PACKAGE_URL@" +#define DEAL_II_PACKAGE_URL "@DEAL_II_PACKAGE_URL@" + +/* Path to the deal.II directory */ +#define DEAL_II_PATH "@DEAL_II_PATH@" + +/* Major version number of deal.II */ +#define DEAL_II_MAJOR "@DEAL_II_MAJOR@" + +/* Minor version number of deal.II */ +#define DEAL_II_MINOR "@DEAL_II_MINOR@" @@ -57,6 +65,47 @@ classes (early gcc versions did not) */ #cmakedefine HAVE_STD_STRINGSTREAM 1 +/* Defined if the compiler's library in use provides std::numeric_limits + classes in the appropriate header file */ +#cmakedefine HAVE_STD_NUMERIC_LIMITS 1 + +/* Defined if vector iterators are just plain pointers */ +#cmakedefine DEAL_II_VECTOR_ITERATOR_IS_POINTER 1 + +/* Defined if the compiler provides an header file */ +#cmakedefine HAVE_STD_OSTREAM_HEADER 1 + +/* Defined if the compiler provides an header file */ +#cmakedefine HAVE_STD_IOSFWD_HEADER 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SYSCALL_H 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIMES_H 1 + +/* Defined to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Defined to 1 if you have the `strtrs_' function. */ +#cmakedefine HAVE_STRTRS_ 1 + + diff --git a/deal.II/include/deal.II/base/config.h.in.old b/deal.II/include/deal.II/base/config.h.in.old index 3ffbd67fbc..b393933e82 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -106,9 +106,6 @@ the top-level directory. */ #cmakedefine DEAL_II_LONG_DOUBLE_LOOP_BUG -/* Major version number of deal.II */ -#cmakedefine DEAL_II_MAJOR - /* Defined if the compiler refuses to allow the explicit specialization of static member arrays. For the exact failure mode, look at aclocal.m4 in the top-level directory. */ @@ -129,9 +126,6 @@ the top-level directory. */ #cmakedefine DEAL_II_MEMBER_VAR_SPECIALIZATION_BUG -/* Minor version number of deal.II */ -#cmakedefine DEAL_II_MINOR - /* Set to the minimal number of elements a std::vector can always hold, i.e. its minimal capacity. */ #cmakedefine DEAL_II_MIN_BOOL_VECTOR_CAPACITY @@ -164,9 +158,6 @@ member classes when giving a full class specification. */ #cmakedefine DEAL_II_NESTED_CLASS_TEMPL_FRIEND_BUG -/* Path to the deal.II directory */ -#cmakedefine DEAL_II_PATH - /* Defined if the compiler does not support the substitution-failure-is-not-an-error paradigm. For the details, look at aclocal.m4 in the top-level directory. */ @@ -235,9 +226,6 @@ /* Defined if a Trilinos installation was found and is going to be used */ #cmakedefine DEAL_II_USE_TRILINOS -/* Define if vector iterators are just plain pointers */ -#cmakedefine DEAL_II_VECTOR_ITERATOR_IS_POINTER - /* This error appears in the Apple edition of the gcc 3.3, which ships with Darwin7.9.0 and probably previous version. It leads to problems during linking. For the details, look at aclocal.m4 in the top-level directory. */ @@ -443,43 +431,6 @@ /* Define to 1 if you have the `ssygv_' function. */ #cmakedefine HAVE_SSYGV_ -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDLIB_H - -/* Define if the compiler provides an header file */ -#cmakedefine HAVE_STD_IOSFWD_HEADER - -/* Define if the compiler's library in use provides std::numeric_limits - classes in the appropriate header file */ -#cmakedefine HAVE_STD_NUMERIC_LIMITS - -/* Define if the compiler provides an header file */ -#cmakedefine HAVE_STD_OSTREAM_HEADER - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRING_H - -/* Define to 1 if you have the `strtrs_' function. */ -#cmakedefine HAVE_STRTRS_ - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_SYSCALL_H - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TIMES_H - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TYPES_H - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TEUCHOS_PARAMETERLIST_HPP -- 2.39.5