From 2d195e582aab7562664f10711238ea4644d81d97 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 22 Jan 2011 13:06:16 +0000 Subject: [PATCH] Also try mpicxx when using --enable-mpi for ./configure. git-svn-id: https://svn.dealii.org/trunk@23238 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 33 +++++++++++++++++++++++++++++++-- deal.II/configure.in | 32 +++++++++++++++++++++++++++++--- deal.II/doc/news/changes.h | 9 ++++++++- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index efbb8f8a05..9cc1253867 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -2589,8 +2589,37 @@ $as_echo_n "checking whether to explicitly use MPI... " >&6; } if test "x$enableval" = "xyes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - if test "x$CXX" = "x" ; then CXX=mpiCC ; fi - if test "x$CC" = "x" ; then CC=mpicc ; fi + + if test "x$CXX" = "x" ; then + { $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; } + 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 + fi + fi + + if test "x$CC" = "x" ; then + { $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 + CC=mpicc ; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: mpicc" >&5 +$as_echo "mpicc" >&6; } + else + as_fn_error $? "no MPI C compiler found" "$LINENO" 5 + fi + fi + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } diff --git a/deal.II/configure.in b/deal.II/configure.in index aafdb82ab2..68336502ad 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -85,7 +85,9 @@ 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 'mpicc'. +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 :-( AC_ARG_ENABLE(mpi, AS_HELP_STRING([--enable-mpi], [Select MPI-enabled compilers and MPI support in deal.II.]), @@ -93,8 +95,32 @@ AC_ARG_ENABLE(mpi, AC_MSG_CHECKING(whether to explicitly use MPI) if test "x$enableval" = "xyes" ; then AC_MSG_RESULT(yes) - if test "x$CXX" = "x" ; then CXX=mpiCC ; fi - if test "x$CC" = "x" ; then CC=mpicc ; fi + + if test "x$CXX" = "x" ; then + AC_MSG_CHECKING(for MPI C++ compiler) + if ((which mpiCC 2>&1) > /dev/null) ; then + CXX=mpiCC ; + AC_MSG_RESULT(mpiCC) + 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 + fi + fi + + if test "x$CC" = "x" ; then + AC_MSG_CHECKING(for MPI C compiler) + if ((which mpicc 2>&1) > /dev/null) ; then + CC=mpicc ; + AC_MSG_RESULT(mpicc) + else + AC_MSG_ERROR(no MPI C compiler found) + fi + fi + else AC_MSG_RESULT(no) fi]) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index be58a2aae7..80b942b22f 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -29,9 +29,16 @@ inconvenience this causes.

General

    +
  1. Fixed: When using the --enable-mpi to +./configure, the script only tried mpiCC +as the MPI C++ compiler. However, on some systems, it is called +mpicxx. The script now tries that as well. +
    +(Wolfgang Bangerth, 2011/01/22) +
  2. Fixed: When using Trilinos and using the Intel C++ compiler, we accidentally used invalid compiler flags that led to a warning -every time we compiled a file.. +every time we compiled a file.
    (Wolfgang Bangerth, 2011/01/22) -- 2.39.5