From: Julian Seward Date: Wed, 8 Mar 2006 15:26:10 +0000 (+0000) Subject: MPI build system refinements: just base everything off mpicc, and don't X-Git-Tag: svn/VALGRIND_3_2_0~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ae1dc4941732ca846af98eb1b45c73c313e5c33;p=thirdparty%2Fvalgrind.git MPI build system refinements: just base everything off mpicc, and don't try to figure out where mpi.h is. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5726 --- diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 39ba4a0332..29a3addf10 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -46,7 +46,7 @@ noinst_PROGRAMS = libmpiwrap.so #libmpiwrap_so_LDFLAGS = $(AM_FLAG_M3264_PRI) -g -shared libmpiwrap.so: mpiwrap.c $(MPI_CC) -g -O -fno-omit-frame-pointer -Wall -fpic -shared \ - -I../include -I@MPI_PREFIX@/include \ + -I../include \ $(AM_FLAG_M3264_PRI) \ -o libmpiwrap.so mpiwrap.c diff --git a/configure.in b/configure.in index e84ab5787a..d23458f521 100644 --- a/configure.in +++ b/configure.in @@ -597,59 +597,35 @@ AC_TYPE_SIGNAL AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr semtimedop]) -# Do we have a useable mpicc (MPI-ised C compiler) ? +# Do we have a useable MPI setup (mpicc, and suitable MPI2 headers?) MPI_CC="mpicc" AC_ARG_WITH(mpicc, - [ --with-mpicc= Specify name of MPI-ised C compiler], + [ --with-mpicc= Specify name of MPI2-ised C compiler], MPI_CC=$withval ) -AC_MSG_CHECKING([for usable mpicc]) +AC_MSG_CHECKING([for usable MPI2-compliant mpicc and mpi.h]) saved_CC=$CC CC=$MPI_CC -AC_TRY_COMPILE(, [ -int main ( ) { return 0; } -], -[ -ac_have_mpicc=yes -AC_MSG_RESULT([$MPI_CC]) -], [ -ac_have_mpicc=no -AC_MSG_RESULT([no]) -]) -CC=$saved_CC - - -# First consider --with-mpi=..., then check for mpi.h -saved_CC=$CC -CC=$MPI_CC -MPI_PREFIX="/usr" -AC_ARG_WITH(mpi, - [ --with-mpi=/path/to/mpi/install Specify location of MPI], - MPI_PREFIX=$withval -) - -AC_MSG_CHECKING([for $MPI_PREFIX/include/mpi.h]) - -AC_TRY_COMPILE(, [ -#include "$MPI_PREFIX/include/mpi.h" +AC_TRY_LINK(, [ +#include +#include int main ( int argc, char** argv ) - { int r = MPI_Init(&argc,&argv); return 0 ; } +{ + int r = MPI_Init(&argc,&argv); + r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL ); + return r; +} ], [ -ac_have_mpi_h=yes -AC_MSG_RESULT([yes]) +ac_have_mpi2=yes +AC_MSG_RESULT([yes, $MPI_CC]) ], [ -ac_have_mpi_h=no +ac_have_mpi2=no AC_MSG_RESULT([no]) ]) CC=$saved_CC -#if test x$ac_have_mpi_h = xyes ; then -# AC_DEFINE(HAVE_MPI_H, 1, [Define to 1 if mpi.h is available.]) -#fi - -AM_CONDITIONAL(BUILD_MPIWRAP, test x$ac_have_mpi_h = xyes) -AC_SUBST(MPI_PREFIX) +AM_CONDITIONAL(BUILD_MPIWRAP, test x$ac_have_mpi2 = xyes) AC_SUBST(MPI_CC)