]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Detect and configure the clang C++ frontend for LLVM.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 21 Aug 2011 04:10:39 +0000 (04:10 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 21 Aug 2011 04:10:39 +0000 (04:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@24153 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index d1e416eae20fe712e4792534aa2fffdf42758628..83423fbb8866ca39ebe7a1a9d9e4136083700e3f 100644 (file)
@@ -300,11 +300,21 @@ AC_DEFUN(DEAL_II_DETERMINE_CXX_BRAND, dnl
                          GXX_VERSION=pathscale_cc
                          GXX_VERSION_DETAILED="$GXX_VERSION"
                         else
-                          dnl  Aw, nothing suitable found...
-                          AC_MSG_RESULT(Unrecognized C++ compiler -- Try to go ahead and get help from dealii@dealii.org)
-                          GXX_BRAND=Unknown
-                         GXX_VERSION=unknown_cc
-                          GXX_VERSION_DETAILED="$GXX_VERSION"
+
+                         is_clang="`($CXX --version 2>&1) | grep clang`"
+                         if test "x$is_clang" != x ; then
+                            AC_MSG_RESULT(C++ compiler is clang)
+                           GXX_BRAND=clang
+                           GXX_VERSION=clang
+                           GXX_VERSION_DETAILED="$GXX_VERSION"
+                         else
+
+                            dnl  Aw, nothing suitable found...
+                            AC_MSG_RESULT(Unrecognized C++ compiler -- Try to go ahead and get help from dealii@dealii.org)
+                            GXX_BRAND=Unknown
+                           GXX_VERSION=unknown_cc
+                           GXX_VERSION_DETAILED="$GXX_VERSION"
+                          fi
                         fi
                       fi
                     fi
@@ -621,6 +631,16 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl
           DEAL_II_ADD_EXTERNAL_LIBS_AT_TAIL(-lm)
           ;;
 
+      clang*)
+          dnl Like many other compilers, clang produces warnings for array
+         dnl accesses out of bounds, even if they are in code that's dead
+         dnl for this dimension. suppress this
+          CXXFLAGSG="$CXXFLAGS -DDEBUG -g -Wall -Wno-array-bounds -Wno-parentheses -Wno-delete-non-virtual-dtor -Wno-unneeded-internal-declaration -Wno-unused-function -Wno-unused-variable"
+          CXXFLAGSO="$CXXFLAGS -O2"
+         CXXFLAGSPIC="-fPIC"
+         LDFLAGSPIC="-fPIC"
+         ;;
+
       intel_icc*)
           dnl Earlier icc versions used -Kxxx for flags. Later versions use
           dnl the gcc convention -fxxx. Also, at least since icc11, the
@@ -2044,6 +2064,10 @@ AC_DEFUN(DEAL_II_CHECK_MULTITHREADING, dnl
            LDFLAGS="$LDFLAGS -lpthread"
            ;;
 
+        clang*)
+           LDFLAGS="$LDFLAGS -lpthread"
+           ;;
+
        pgCC*)
            LDFLAGS="$LDFLAGS -lpthread"
            ;;
index 45b3b6b20dbc4826e46527dd10881facd4ac53f7..e9bec392947933081b92e3c158ac0e6e374b5b94 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 23754 .
+# From configure.in Revision: 24112 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.68 for deal.II 7.1.pre.
 #
@@ -3998,11 +3998,22 @@ $as_echo "C++ compiler is PathScale C++" >&6; }
                          GXX_VERSION=pathscale_cc
                          GXX_VERSION_DETAILED="$GXX_VERSION"
                         else
-                                                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unrecognized C++ compiler -- Try to go ahead and get help from dealii@dealii.org" >&5
+
+                         is_clang="`($CXX --version 2>&1) | grep clang`"
+                         if test "x$is_clang" != x ; then
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: result: C++ compiler is clang" >&5
+$as_echo "C++ compiler is clang" >&6; }
+                           GXX_BRAND=clang
+                           GXX_VERSION=clang
+                           GXX_VERSION_DETAILED="$GXX_VERSION"
+                         else
+
+                                                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unrecognized C++ compiler -- Try to go ahead and get help from dealii@dealii.org" >&5
 $as_echo "Unrecognized C++ compiler -- Try to go ahead and get help from dealii@dealii.org" >&6; }
-                          GXX_BRAND=Unknown
-                         GXX_VERSION=unknown_cc
-                          GXX_VERSION_DETAILED="$GXX_VERSION"
+                            GXX_BRAND=Unknown
+                           GXX_VERSION=unknown_cc
+                           GXX_VERSION_DETAILED="$GXX_VERSION"
+                          fi
                         fi
                       fi
                     fi
@@ -4663,6 +4674,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
           ;;
 
+      clang*)
+                                   CXXFLAGSG="$CXXFLAGS -DDEBUG -g -Wall -Wno-array-bounds"
+          CXXFLAGSO="$CXXFLAGS -O2"
+         CXXFLAGSPIC="-fPIC"
+         LDFLAGSPIC="-fPIC"
+         ;;
+
       intel_icc*)
                                                          case "$GXX_VERSION" in
            intel_icc5 | intel_icc6 | intel_icc7 | intel_icc8 | intel_icc9)
@@ -5435,6 +5453,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
            LDFLAGS="$LDFLAGS -lpthread"
            ;;
 
+        clang*)
+           LDFLAGS="$LDFLAGS -lpthread"
+           ;;
+
        pgCC*)
            LDFLAGS="$LDFLAGS -lpthread"
            ;;

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.