]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Some platform checks
authorMatthias Maier <tamiko@kyomu.43-1.org>
Mon, 10 Sep 2012 15:38:39 +0000 (15:38 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Mon, 10 Sep 2012 15:38:39 +0000 (15:38 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26270 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/aclocal.m4
deal.II/contrib/cmake/macros/macro_expand_instantiations.cmake [moved from deal.II/contrib/cmake/modules/macro_expand_instantiations.cmake with 100% similarity]
deal.II/contrib/cmake/modules/prepare_boost.cmake
deal.II/contrib/cmake/modules/prepare_threads.cmake
deal.II/contrib/cmake/tests/check_cxx_features.cmake [new file with mode: 0644]
deal.II/include/deal.II/base/config.h.in
deal.II/include/deal.II/base/config.h.in.old

index df4544d4e09d20ae268eb7fb436468e8a8551472..b5202e81e2f852ee6399f1b8928d148cea8d3e13 100644 (file)
@@ -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:
 #
index be5682fe56cdb0881f5b3dfa100bf5119f8d61eb..61bf7ecf1b9f3e245805965a93712b983d6c73ec 100644 (file)
@@ -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 <iterator>
-      class MyIterator : public std::iterator<std::bidirectional_iterator_tag,int>
-      {};
-    ],
-    [],
-    [
-      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 <sstream>
-    ],
-    [
-        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)
-    ])
-])
 
 
 
index a9a8566101b2e264794667fc62ef1f5f01629ad5..ab8ae05c85b8402001291fb68e0ad0a01e795aa4 100644 (file)
@@ -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()
index 700d489dfd178f69c65ee6d31fdd0c2eb2c4f5dc..6780635c1b8ac286fb2d7b04ba89be744732a6c4 100644 (file)
@@ -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 (file)
index 0000000..36af404
--- /dev/null
@@ -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 <iterator>
+  class MyIterator : public std::iterator<std::bidirectional_iterator_tag,int>{};
+  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 <sstream>
+  std::istringstream i;
+  std::ostringstream o;
+  int main(){return 0;}
+  "
+  HAVE_STD_STRINGSTREAM)
index ae536f78124d65c9ad7337df30934885f4c7d88b..98911b026cdc1060df1ad7ee79647b3a45b0e510 100644 (file)
 
 
 
-/* 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.
 
 
 
-/* Configured in prepare_umfpack.cmake: */
+
+/*
+ * Configured in prepare_umfpack.cmake:
+ */
+
 
 /* Defined if deal.II was configured with UMFPACK support */
 #cmakedefine HAVE_LIBUMFPACK
index bf931e9cd1bfac25d96e8a054a9b8c5bdfb2df37..e3e8fe3a6cf80ab1766a516998d9ed14f9c14ab6 100644 (file)
 /* Define if the compiler provides an <iosfwd> 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
 /* Define if the compiler provides an <ostream> 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 <strings.h> header file. */
 #cmakedefine HAVE_STRINGS_H
 

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.