if test x"$_ax_prog_cc_mpi_mpi_found"= xyes;then :
use_mpi=yes
:
else
use_mpi=no
:
fi
ENABLE_MPI=1
if test"x$use_mpi"="xno";then :
ENABLE_MPI=
if test"x$with_mpi"="xyes";then :
as_fn_error $?"CC doesn't appear to be a valid MPI compiler and MPI support was requested. See INSTALL document or try adding CC=mpicc to your configure command line.""$LINENO" 5
fi
else
{$as_echo"$as_me:${as_lineno-$LINENO}: not checking whether the mpicc compiler works">&5
$as_echo"$as_me: not checking whether the mpicc compiler works">&6;}
ENABLE_MPI=1
$as_echo"#define HAVE_MPI /**/">>confdefs.h
fi
# Check whether --with-gcc was given.
if test"${with_gcc+set}"=set;then :
withval=$with_gcc;
else
with_gcc=yes
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
#error GCC ERROR
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO";then :
else
if test"x$with_gcc"="xyes";then :
as_fn_error which is strongly recommended for building Darshan. To force use of a non-GCC compatible compiler "CC doesn't appear to be a GNU-compatible compiler""$LINENO" 5
AS_HELP_STRING([--without-mpi], [Build without support for MPI]))
AS_IF([test "x$with_mpi" = "xno"],
ENABLE_MPI=,
[AC_DEFINE([HAVE_MPI], [], [Define if build is MPI-enabled])])
[AS_HELP_STRING([--without-mpi], [Build without support for MPI])],
,
[with_mpi=auto])
AX_PROG_CC_MPI([test x"$with_mpi" != xno],
[use_mpi=yes],
[use_mpi=no])
dnl Check to see if CC is an MPI compiler
dnl TODO: better error message here
AS_IF([test "x$ENABLE_MPI" = "x1"],
[AC_MSG_CHECKING(whether the mpicc compiler works)
AC_TRY_COMPILE([#include <mpi.h>], [int ret = MPI_Init(0, (void*)0)],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
AC_MSG_ERROR(CC doesn't appear to be a valid MPI compiler. See INSTALL document or try adding CC=mpicc to your configure command line.))],
AC_MSG_NOTICE(not checking whether the mpicc compiler works))
ENABLE_MPI=1
AS_IF([test "x$use_mpi" = "xno"],
[ENABLE_MPI=
AS_IF([test "x$with_mpi" = "xyes"],
[AC_MSG_ERROR(CC doesn't appear to be a valid MPI compiler and MPI support was requested. See INSTALL document or try adding CC=mpicc to your configure command line.)],)],
[ENABLE_MPI=1
AC_DEFINE([HAVE_MPI], [], [Define if build is MPI-enabled])])
dnl check for GCC compiler support
AC_ARG_WITH(gcc,
[AS_HELP_STRING([--without-gcc], [Build without a GCC-compatible compiler])],
,
[with_gcc=yes])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(,[
#ifndef __GNUC__
#error GCC ERROR
#endif
])],
[],
[AS_IF([test "x$with_gcc" = "xyes"],
[AC_MSG_ERROR(CC doesn't appear to be a GNU-compatible compiler, which is strongly recommended for building Darshan. To force use of a non-GCC compatible compiler, add --without-gcc to your configure command line.)],)])