]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: from bernard Secher
authorprascle <prascle>
Mon, 12 Dec 2005 18:36:18 +0000 (18:36 +0000)
committerprascle <prascle>
Mon, 12 Dec 2005 18:36:18 +0000 (18:36 +0000)
salome_adm/unix/config_files/check_lam.m4

index ae21b56fe91d53eb910fcee86b9aa7ed7f65ab54..9d9619a9c03a2c88152e7fc6fae18354c37ab49d 100644 (file)
@@ -62,27 +62,26 @@ if test "$WITHLAM" = yes; then
   fi
 
   if test "$WITHLAM" = "yes";then
-    WITHLAM="no"
-
-    if test "$WITHLAM" = "no";then
-      CPPFLAGS="$MPI_INCLUDES $CPPFLAGS"
-      LIBS="$LIBS -lmpi++"
-      AC_TRY_LINK([
-      #include <mpi.h>
-      ], [int argc=0; char **argv=0; MPI_Init(&argc,&argv);],
-      WITHLAM="yes",WITHLAM="no")
-      if test "$WITHLAM" = "yes";then
-        MPI_LIBS="$MPI_LIBS -lmpi++"
-      fi
-      LIBS="$LIBS_old"
-      CPPFLAGS="$CPPFLAGS_old"
 
+    CPPFLAGS="$MPI_INCLUDES $CPPFLAGS"
+    LIBS="$LIBS -lmpi++"
+    AC_MSG_CHECKING(for MPI_Init in -lmpi++)
+    AC_TRY_LINK([
+         #include <mpi.h>
+         ], [int argc=0; char **argv=0; MPI_Init(&argc,&argv);],
+         WITHLAM="yes",WITHLAM="no")
+
+    CPPFLAGS="$CPPFLAGS_old"
+    if test "$WITHLAM" = "yes";then
+
+      AC_MSG_RESULT(yes)
+      MPI_LIBS="$MPI_LIBS -lmpi++"
       AC_CHECK_LIB(mpi++,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
-      LDFLAGS="$LDFLAGS_old"
-      LIBS="$LIBS_old"
-    fi
 
-    if test "$WITHLAM" = "no";then
+    else
+      AC_MSG_RESULT(no)
+
+      LIBS="$LIBS_old"
       AC_CHECK_LIB(lam,lam_mp_init,WITHLAM="yes",WITHLAM="no")
       if test "$WITHLAM" = "yes";then
         MPI_LIBS="$MPI_LIBS -llam"
@@ -91,15 +90,17 @@ if test "$WITHLAM" = yes; then
 
       AC_CHECK_LIB(mpi,MPI_Init,WITHLAM="yes",WITHLAM="no")
       if test "$WITHLAM" = "yes";then
-        MPI_LIBS="$MPI_LIBS -lmpi"
+        MPI_LIBS="-lmpi $MPI_LIBS"
       fi
 
       AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
-      LDFLAGS="$LDFLAGS_old"
-      LIBS="$LIBS_old"
+
     fi
   fi
 
+  LDFLAGS="$LDFLAGS_old"
+  LIBS="$LIBS_old"
+
   if test "$WITHLAM" = "yes";then
      WITHMPI="yes"
      mpi_ok=yes