From: Matthias Maier Date: Mon, 10 Sep 2012 15:38:39 +0000 (+0000) Subject: Some platform checks X-Git-Tag: v8.0.0~1079^2~934 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b968f5dda817acc5421afe92a577be29ac7b7533;p=dealii.git Some platform checks git-svn-id: https://svn.dealii.org/branches/branch_cmake@26270 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index df4544d4e0..b5202e81e2 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -1,17 +1,33 @@ PROJECT(deal.II) + SET(VERSION "8.0.pre") + + + +# +# General configuration for cmake: +# + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -#TODO: -SET(CMAKE_CXX_FLAGS "-std=c++0x -D_REENTRANT -fPIC -O2 -march=native") #TODO: c++0x Features umschalten SET(CMAKE_INCLUDE_CURRENT_DIR true) +SET(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/" + "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/" + "${CMAKE_SOURCE_DIR}/contrib/cmake/tests/" + ) + # # General configuration options: # +#TODO: +SET(CMAKE_CXX_FLAGS "-std=c++0x -Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") #TODO: c++0x Features umschalten + OPTION(DEAL_II_WITH_THREADS "Build deal.II with support for threads. This pulls in libtbb as a dependency." ON) @@ -32,9 +48,6 @@ OPTION(DEAL_II_WITH_METIS "Build deal.II with support for Metis." OFF) -# TODO: The rest ;-) - - OPTION(DEAL_II_ALLOW_CONTRIB "Allow the use of contrib libraries bundled with the source tarball. Note: If set to off DEAL_II_FORCE_CONTRIB* will still pull in bundled @@ -56,23 +69,28 @@ OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK OFF) + # # Now, configure and prepare a lot of things: # -SET(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/" - ) - -# # used as a dummy target for all the stuff that has to be done before the # library can be compiled: -# ADD_CUSTOM_TARGET(deal_ii_target_dependencies) -# TODO: Version Mumbo Jumbo + +# +# Platform checks: +# + +INCLUDE(check_cxx_features) + + + +# +# Feature configuration: +# INCLUDE(prepare_boost) @@ -84,8 +102,6 @@ IF(DEAL_II_WITH_UMFPACK) INCLUDE(prepare_umfpack) ENDIF() -# TODO: The rest... - # @@ -95,6 +111,7 @@ ENDIF() ADD_SUBDIRECTORY(common/expand_instantiations) + # # Compile the library: # diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index be5682fe56..61bf7ecf1b 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -4951,70 +4951,6 @@ AC_DEFUN(DEAL_II_ICC_C_WD_1572, dnl ]) -dnl ------------------------------------------------------------- -dnl gcc2.95 doesn't have the std::iterator class, but the standard -dnl requires it, so check whether we have to work around it -dnl -dnl Usage: DEAL_II_HAVE_STD_ITERATOR -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_HAVE_STD_ITERATOR, dnl -[ - AC_MSG_CHECKING(for std::iterator class) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ -#include - class MyIterator : public std::iterator - {}; - ], - [], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_STD_ITERATOR_CLASS, 1, - [Define if the compiler's library in use provides a - std::iterator class (early gcc versions did not)]) - ], - [ - AC_MSG_RESULT(no) - ]) -]) - - - - -dnl ------------------------------------------------------------- -dnl Up to early gcc2.95 releases, the i/ostringstream classes were not -dnl available. check their availability, or whether we have to fall back -dnl to the old strstream classes. -dnl -dnl Usage: DEAL_II_HAVE_STD_STRINGSTREAM -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_HAVE_STD_STRINGSTREAM, dnl -[ - AC_MSG_CHECKING(for std::i/ostringstream classes) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ -#include - ], - [ - std::istringstream i; - std::ostringstream o; - ], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_STD_STRINGSTREAM, 1, - [Define if the compiler's library in use provides - std::i/ostringstream classes (early gcc versions did not)]) - ], - [ - AC_MSG_RESULT(no) - ]) -]) diff --git a/deal.II/contrib/cmake/modules/macro_expand_instantiations.cmake b/deal.II/contrib/cmake/macros/macro_expand_instantiations.cmake similarity index 100% rename from deal.II/contrib/cmake/modules/macro_expand_instantiations.cmake rename to deal.II/contrib/cmake/macros/macro_expand_instantiations.cmake diff --git a/deal.II/contrib/cmake/modules/prepare_boost.cmake b/deal.II/contrib/cmake/modules/prepare_boost.cmake index a9a8566101..ab8ae05c85 100644 --- a/deal.II/contrib/cmake/modules/prepare_boost.cmake +++ b/deal.II/contrib/cmake/modules/prepare_boost.cmake @@ -20,6 +20,7 @@ IF(NOT DEAL_II_FORCE_CONTRIB_BOOST) ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_SERIALIZATION_LIBRARY_DEBUG} ) + # TODO: Renaming! SET(DEAL_II_USE_EXTERNAL_BOOST TRUE) ENDIF() ENDIF() diff --git a/deal.II/contrib/cmake/modules/prepare_threads.cmake b/deal.II/contrib/cmake/modules/prepare_threads.cmake index 700d489dfd..6780635c1b 100644 --- a/deal.II/contrib/cmake/modules/prepare_threads.cmake +++ b/deal.II/contrib/cmake/modules/prepare_threads.cmake @@ -30,5 +30,6 @@ LIST(APPEND deal_ii_external_debug_libraries ${TBB_DEBUG_LIBRARY} ) +# TODO: Renaming! SET(DEAL_II_USE_MT TRUE) SET(DEAL_II_USE_MT_POSIX TRUE) diff --git a/deal.II/contrib/cmake/tests/check_cxx_features.cmake b/deal.II/contrib/cmake/tests/check_cxx_features.cmake new file mode 100644 index 0000000000..36af404f74 --- /dev/null +++ b/deal.II/contrib/cmake/tests/check_cxx_features.cmake @@ -0,0 +1,35 @@ +INCLUDE(CheckCXXSourceCompiles) + +# +# Check for various CXX Features. +# + + + + +# +# gcc2.95 doesn't have the std::iterator class, but the standard +# requires it, so check whether we have to work around it +# +CHECK_CXX_SOURCE_COMPILES( + " + #include + class MyIterator : public std::iterator{}; + int main(){return 0;} + " + HAVE_STD_ITERATOR_CLASS) + + +# +# Up to early gcc2.95 releases, the i/ostringstream classes were not +# available. check their availability, or whether we have to fall back +# to the old strstream classes. +# +CHECK_CXX_SOURCE_COMPILES( + " + #include + std::istringstream i; + std::ostringstream o; + int main(){return 0;} + " + HAVE_STD_STRINGSTREAM) diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index ae536f7812..98911b026c 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -27,14 +27,39 @@ -/* Configured in prepare_boost.cmake: */ + +/* + * Configured in check_cxx_features: + */ + + +/* Defined if the compiler's library in use provides a std::iterator class + (early gcc versions did not) */ +#cmakedefine HAVE_STD_ITERATOR_CLASS 1 + +/* Defined if the compiler's library in use provides std::i/ostringstream + classes (early gcc versions did not) */ +#cmakedefine HAVE_STD_STRINGSTREAM 1 + + + + + +/* + * Configured in prepare_boost.cmake: + */ + /* Defined if deal.II is configured with an external Boost library */ #cmakedefine DEAL_II_USE_EXTERNAL_BOOST -/* Configured in prepare_threads.cmake: */ + +/* + * Configured in prepare_threads.cmake: + */ + /* Flag indicating whether the library shall be compiled for multithreaded * applications. If so, then it is set to one, otherwise to zero. @@ -64,7 +89,11 @@ -/* Configured in prepare_umfpack.cmake: */ + +/* + * Configured in prepare_umfpack.cmake: + */ + /* Defined if deal.II was configured with UMFPACK support */ #cmakedefine HAVE_LIBUMFPACK 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 bf931e9cd1..e3e8fe3a6c 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -452,10 +452,6 @@ /* Define if the compiler provides an header file */ #cmakedefine HAVE_STD_IOSFWD_HEADER -/* Define if the compiler's library in use provides a std::iterator class - (early gcc versions did not) */ -#cmakedefine HAVE_STD_ITERATOR_CLASS - /* Define if the compiler's library in use provides std::numeric_limits classes in the appropriate header file */ #cmakedefine HAVE_STD_NUMERIC_LIMITS @@ -463,10 +459,6 @@ /* Define if the compiler provides an header file */ #cmakedefine HAVE_STD_OSTREAM_HEADER -/* Define if the compiler's library in use provides std::i/ostringstream - classes (early gcc versions did not) */ -#cmakedefine HAVE_STD_STRINGSTREAM - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H