]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use mpic++ or mpicxx before trying mpiCC.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 5 Nov 2011 20:46:08 +0000 (20:46 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 5 Nov 2011 20:46:08 +0000 (20:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@24724 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/configure
deal.II/configure.in
deal.II/doc/news/changes.h

index 8594628719c0f6921914b101edf153e65b9883ad..203928a9e0c3262fe3d35a47c7179d596ed06f24 100755 (executable)
@@ -711,7 +711,6 @@ GXX_VERSION
 GXX_BRAND
 ac_ct_CXX
 CXXFLAGS
-CXX
 OBJEXT
 EXEEXT
 ac_ct_CC
@@ -719,6 +718,7 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+CXX
 target_os
 target_vendor
 target_cpu
@@ -2592,20 +2592,55 @@ $as_echo_n "checking whether to explicitly use MPI... " >&6; }
 $as_echo "yes" >&6; }
 
            if test "x$CXX" = "x" ; then
+              for ac_prog in mpic++ mpicxx mpiCC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$CXX" && break
+done
+
              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI C++ compiler" >&5
 $as_echo_n "checking for MPI C++ compiler... " >&6; }
-             if ((which mpiCC 2>&1) > /dev/null) ; then
-                CXX=mpiCC ;
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: mpiCC" >&5
-$as_echo "mpiCC" >&6; }
+             if test "x$CXX" = "x" ; then
+                as_fn_error $? "none found" "$LINENO" 5
               else
-               if ((which mpicxx 2>&1) > /dev/null) ; then
-                  CXX=mpicxx ;
-                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: mpicxx" >&5
-$as_echo "mpicxx" >&6; }
-                else
-                 as_fn_error $? "no MPI C++ compiler found" "$LINENO" 5
-                fi
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
               fi
             fi
 
index 2b7bbad176fd301cae3b51e1549d11d0018377f8..90dec2dfdb52fd5eca960db7b291a385245efc56 100644 (file)
@@ -85,9 +85,13 @@ AC_MSG_RESULT(---------------- configuring C/C++ compilers ----------------)
 
 
 dnl See if the user has specified --enable-mpi. If so, and if $CXX and $CC have
-dnl not been set to a particular value, then override them with 'mpiCC' and
-dnl 'mpicc'. The latter should always work, but sometimes the former is
-dnl called 'mpicxx' instead :-(
+dnl not been set to a particular value, then override them.
+dnl
+dnl While for the C compiler the issue is simple (it should be 'mpicc', the
+dnl issue is not quite as trivial for the C++ compiler: 'mpiCC' should in
+dnl principle work, but we've seen systems where that refers to the C
+dnl compiler, so try 'mpic++' and 'mpicxx' first as these should really
+dnl be unambiguous names although they may not be available on all systems.
 AC_ARG_ENABLE(mpi,
        AS_HELP_STRING([--enable-mpi],
        [Select MPI-enabled compilers and MPI support in deal.II.]),
@@ -97,17 +101,12 @@ AC_ARG_ENABLE(mpi,
            AC_MSG_RESULT(yes)
 
            if test "x$CXX" = "x" ; then
+              AC_CHECK_PROGS(CXX,[mpic++ mpicxx mpiCC])
              AC_MSG_CHECKING(for MPI C++ compiler)
-             if ((which mpiCC 2>&1) > /dev/null) ; then
-                CXX=mpiCC ;
-               AC_MSG_RESULT(mpiCC)
+             if test "x$CXX" = "x" ; then
+                AC_MSG_ERROR(none found)
               else
-               if ((which mpicxx 2>&1) > /dev/null) ; then
-                  CXX=mpicxx ;
-                 AC_MSG_RESULT(mpicxx)
-                else
-                 AC_MSG_ERROR(no MPI C++ compiler found)
-                fi
+               AC_MSG_RESULT([$CXX])
               fi
             fi
 
index 4a9565f70a75d9b9f09fc10e2e383193c1322ee6..57e437c3d16af32449d1bc3be8d196d40dd6b400 100644 (file)
@@ -34,6 +34,13 @@ inconvenience this causes.
 <h3>General</h3>
 
 <ol>
+<li> Fixed: On some systems, <code>mpiCC</code> turns out to alias the
+C compiler, not the C++ compiler as expected. Consequently, try to use
+<code>mpic++</code> or <code>mpicxx</code> before <code>mpiCC</code> as
+these should really be unambiguous.
+<br>
+(Wolfgang Bangerth, 2011/11/05)
+
 <li> Fixed: Intel's ICC compiler identifies itself as <code>icpc version
 12.1.0 (gcc version 4.2.1 compatibility)</code> which we mistook as being
 GCC version 4.2. This is now fixed.

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.