Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Open MPI programs with autoconf/automake?
From: Raymond Wan (rwan_at_[hidden])
Date: 2008-11-09 22:38:30


Hi Nuno,

Thank you for the link and your update to it. I definitely don't mind
that it isn't "pretty"! :-)

Since your post, I've been trying to understand it and how to work it
in. But, I think I've been making some progress over the weekend.

Thank you!

Ray

Nuno Sucena Almeida wrote:
> Hi,
> see if this macro solves your problem:
> http://autoconf-archive.cryp.to/acx_mpi.html
>
> it requires some improvement, but might be a start. Since I only have OpenMPI
> I use it in the following way(it's not pretty):
>
> configure.ac:
> (...)
> dnl Check for MPI
> dnl This check will set the MPICC and MPICXX variables to the MPI compiler
> ones
> dnl if the library is found, or to the regular compilers if not.
> AC_ARG_WITH(mpi, [AC_HELP_STRING([--with-mpi],
> [enable MPI support [default=yes]])],
> [case "${withval}" in
> yes|no) with_mpi=$withval;;
> *)
> AC_MSG_ERROR(bad value ${withval} for --with-mpi);;
> esac],
> [with_mpi=yes])
> if test "x$with_mpi" = "xyes"; then
> ACX_MPI([], [AC_MSG_ERROR(could not find mpi library for --with-mpi)])
> AC_DEFINE(HAVE_MPI)
> MPI_CXXLIBS=`mpicxx --showme:link`
> MPI_CXXFLAGS=`mpicxx --showme:compile`
> AC_SUBST(MPI_CXXLIBS)
> AC_SUBST(MPI_CXXFLAGS)
> else
> MPICC="$CC"
> MPICXX="$CXX"
> AC_SUBST(MPICC)
> AC_SUBST(MPICXX)
> fi
> AM_CONDITIONAL([WE_HAVE_MPI],[test "x$with_mpi" = "xyes"])
> (...)
>
>
> Makefile.am:
> (...)
> # MPI headers/libraries:
> INCLUDES+=$(MPI_CXXFLAGS)
> OTHERLIBS+=$(MPI_CXXLIBS)
>
>
> etc
> I would start by improving the mentioned macro with specific support for each
> MPI implementation...
>
> Nuno
>
> On Thursday 06 November 2008 06:35:33 am Raymond Wan wrote:
>
>> I'm not sure if this is relevant to this mailing list, but I'm trying to
>> get autoconf/automake working with an Open MPI program I am writing (in
>>
>
>