1
dnl @synopsis TAC_ARG_CHECK_MPI
3
dnl Check to make sure any definitions set in TAC_ARG_CONFIG_MPI
4
dnl are valid, set the MPI flags. Test MPI compile using C++ compiler.
6
dnl @author Mike Heroux <mheroux@cs.sandia.gov>
8
AC_DEFUN([TAC_ARG_CHECK_MPI],
11
if test "X${HAVE_PKG_MPI}" = "Xyes"; then
13
if test -n "${MPI_DIR}" && test -z "${MPI_INC}"; then
14
MPI_INC="${MPI_DIR}/include"
17
if test -n "${MPI_INC}"; then
18
CPPFLAGS="${CPPFLAGS} -I${MPI_INC}"
22
AC_MSG_CHECKING(for mpi.h)
23
AC_TRY_CPP([#include "mpi.h"],
28
echo "Cannot link simple MPI program."
29
echo "Try --with-mpi-compilers to specify MPI compilers."
30
echo "Or try --with-mpi-libs, --with-mpi-incdir, --with-mpi-libdir"
31
echo "to specify all the specific MPI compile options."
33
AC_MSG_ERROR(MPI cannot link)
36
if test -n "${MPI_DIR}" && test -z "${MPI_LIBDIR}"; then
37
MPI_LIBDIR="${MPI_DIR}/lib"
40
if test -n "${MPI_LIBDIR}"; then
41
LDFLAGS="${LDFLAGS} -L${MPI_LIBDIR}"
44
if test -z "${MPI_LIBS}" && test -n "${MPI_LIBDIR}"; then
48
if test -n "${MPI_LIBS}"; then
49
LIBS="${MPI_LIBS} ${LIBS}"
53
# AC_MSG_CHECKING(whether MPI will link using C++ compiler)
54
# AC_TRY_LINK([#include <mpi.h>],
55
# [int c; char** v; MPI_Init(&c,&v);],
56
# [AC_MSG_RESULT(yes)],
59
# echo "Cannot link simple MPI program."
60
# echo "Try --with-mpi-cxx to specify MPI C++ compile script."
61
# echo "Or try --with-mpi-libs, --with-mpi-incdir, --with-mpi-libdir"
62
# echo "to specify all the specific MPI compile options."
64
# AC_MSG_ERROR(MPI cannot link)]