1 dnl Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 AC_DEFUN([CHECK_MPI],[
24 AC_REQUIRE([AC_PROG_CC])dnl
27 [AC_HELP_STRING([--with-mpi_lib=DIR],[directory path of MPICH lib installation])],
28 MPILIBREQUESTED="$withval")
31 [AC_HELP_STRING([--with-mpi=DIR],[root directory path of MPICH installation])],
32 MPIREQUESTED="yes",MPIREQUESTED="no")
38 if test x"$MPIREQUESTED" = xyes; then
41 echo ---------------------------------------------
43 echo ---------------------------------------------
46 if test "x$withval" != "xyes"; then
48 MPI_INCLUDES="-I$MPI_HOME/include"
49 if test "x$MPI_HOME" = "x/usr"
53 MPI_LIBS="-L$MPI_HOME/lib"
57 if test x"$MPILIBREQUESTED" != x; then
58 MPI_LIBS="-L$MPILIBREQUESTED"
61 CPPFLAGS_old="$CPPFLAGS"
62 CPPFLAGS="$MPI_INCLUDES $CPPFLAGS"
63 AC_CHECK_HEADER(mpi.h,WITHMPI="yes",WITHMPI="no")
64 CPPFLAGS="$CPPFLAGS_old"
66 if test "$WITHMPI" = "yes";then
68 LDFLAGS_old="$LDFLAGS"
69 LDFLAGS="$MPI_LIBS $LDFLAGS"
70 AC_CHECK_LIB(elan,elan_init,MPI_LIBS="$MPI_LIBS -lelan")
71 AC_CHECK_LIB(mpi,MPI_Init,WITHMPI="yes",WITHMPI="no")
72 AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
73 LDFLAGS="$LDFLAGS_old"
77 if test "$WITHMPI" = "yes";then
79 MPI_LIBS="$MPI_LIBS -lmpi -lmpio -lmpiCC"
86 if test "$WITHMPI" = no; then
88 dnl ---------------------------------------------
90 dnl ---------------------------------------------
95 if test "$WITHMPICH" = no; then
97 dnl ---------------------------------------------
99 dnl ---------------------------------------------
106 if test "$WITHLAM" = no; then
108 dnl ---------------------------------------------
110 dnl ---------------------------------------------
119 if test x$WITHMPI2 = xyes; then
120 CPPFLAGS="-DHAVE_MPI2 $CPPFLAGS"
121 CORBA_IDLCXXFLAGS="-DHAVE_MPI2 $CORBA_IDLCXXFLAGS"
122 CORBA_IDLPYFLAGS="-DHAVE_MPI2 $CORBA_IDLPYFLAGS"
126 AC_SUBST(MPI_INCLUDES)
129 AM_CONDITIONAL(MPI_IS_OK, [test x"$mpi_ok" = xyes])