Cleanup of the MPI detection code + fix an issue in the feedback display 77/12477/3
Sylvestre Ledru [Tue, 10 Sep 2013 13:43:29 +0000 (15:43 +0200)]
Change-Id: If3bb334bffe2f9a95325d279ae73814227a2c1fb

scilab/aclocal.m4
scilab/configure
scilab/configure.ac
scilab/m4/mpi.m4

index 90bd6d5..2509a71 100644 (file)
@@ -1784,7 +1784,7 @@ AC_DEFUN([AM_NLS],
   AC_SUBST([USE_NLS])
 ])
 
-# po.m4 serial 20 (gettext-0.18.2)
+# po.m4 serial 21 (gettext-0.18.3)
 dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -1811,6 +1811,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
   AC_REQUIRE([AC_PROG_INSTALL])dnl
   AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+  AC_REQUIRE([AC_PROG_SED])dnl
   AC_REQUIRE([AM_NLS])dnl
 
   dnl Release version of the gettext macros. This is used to ensure that
index b408d9d..cd51642 100755 (executable)
@@ -658,7 +658,6 @@ ac_ct_DUMPBIN
 DUMPBIN
 LD
 FGREP
-SED
 LIBTOOL
 GRAPHICS_ENABLE
 DEMOTOOLS_ENABLE
@@ -755,6 +754,7 @@ GMSGFMT
 MSGFMT
 GETTEXT_MACRO_VERSION
 USE_NLS
+SED
 POW_LIB
 LIBM
 GUI_ENABLE
 #######################
 
 # gettext.  See http://www.gnu.org/software/hello/manual/gettext/AM_005fGNU_005fGETTEXT.html
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
 $as_echo_n "checking whether NLS is requested... " >&6; }
 MPI_ENABLE=no
 if test "$with_mpi" == yes; then
 
-#"$with_openmpi_path" != 'yes' -a "$with_openmpi_path" != 'no'
-#if test false != true; then
-   # Look if mpicc (which provides cflags and ldflags) is available
-#   AC_MSG_CHECKING([openmpi, for mpicc])
-#   OPENMPI_FOUND=0
-#   MPICC="$with_openmpi/bin/mpicc"
-#        if test -x "$MPICC"; then
-#                AC_MSG_RESULT([$MPICC])
-#                              OPENMPI_CC=$MPICC
-#                              OPENMPI_FOUND=1
-#              fi
-#   if test $OPENMPI_FOUND -eq 0; then
-#   MPICC="$with_openmpi/mpicc"
-#        if test -x "$MPICC"; then
-#                              OPENMPI_FOUND=1
-#                              OPENMPI_CC=$MPICC
-#                AC_MSG_RESULT([$MPICC])
-#        fi
-#   fi
-#              if test $OPENMPI_FOUND -eq 0; then
-#                AC_MSG_ERROR([Unable to find $MPICC. Please check the path you provided])
-#              else
-#                      unset OPENMPI_FOUND
-#              fi
-#else
                for ac_prog in mpicc
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -21447,7 +21491,6 @@ test -n "$OPENMPI_CXX" || OPENMPI_CXX="no"
                if test "x$MPICXX" = "xno"; then
                                as_fn_error $? "Unable to find mpicxx in the path. Please check your installation of openmpi (example : openmpi & openmpi-dev with Debian)" "$LINENO" 5
                fi
-#fi
 saved_cflags=$CFLAGS
 saved_cxxflags=$CXXFLAGS
 saved_LIBS="$LIBS"
@@ -21521,13 +21564,6 @@ CXXFLAGS=$saved_cppflags
 
 
 
-#CFLAGS="$CFLAGS $OPENMPI_FLAGS"
-#AC_CHECK_LIB(xml2,xmlInitParserCtxt,,[AC_MSG_ERROR([pcre : library missing])])
-
-
-#AC_CHECK_HEADERS([pcre/tree.h],,[AC_MSG_ERROR([pcre : library missing missing])])
-
-# Gets compilation and library flags
 
    # We will have to detect other implementation of OpenMPI
    MPI_ENABLE=yes
@@ -25846,7 +25882,7 @@ CPPFLAGS="$CPPFLAGS -I$CHK_TCL_INCLUDE_PATH"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later" >&5
 $as_echo_n "checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later... " >&6; }
 cat > conftest.$ac_ext <<EOF
-#line 25849 "configure"
+#line 25885 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TCL_INCLUDE_PATH/$CHK_TCL_INC_NAME"
@@ -26157,7 +26193,7 @@ CPPFLAGS="$CPPFLAGS $TCL_INC_PATH -I$CHK_TK_INCLUDE_PATH $X_CFLAGS"
 $as_echo_n "checking if tk is version $CHK_TK_MAJOR.$CHK_TK_MINOR or later... " >&6; }
 
 cat > conftest.$ac_ext <<EOF
-#line 26160 "configure"
+#line 26196 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TK_INCLUDE_PATH/$CHK_TK_INC_NAME"
@@ -26741,7 +26777,7 @@ $as_echo_n "checking saxon9he... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 26744 "configure"
+// #line 26780 "configure"
 import java.util.regex.Pattern;
 
 import net.sf.saxon.Version;
@@ -26856,7 +26892,7 @@ $as_echo_n "checking saxon... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 26859 "configure"
+// #line 26895 "configure"
 import java.util.regex.Pattern;
 
 import net.sf.saxon.Version;
@@ -26972,7 +27008,7 @@ $as_echo_n "checking saxon... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 26975 "configure"
+// #line 27011 "configure"
 import java.util.regex.Pattern;
 
 import com.icl.saxon.Loader;
@@ -33399,7 +33435,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 33402 "configure"
+#line 33438 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -33505,7 +33541,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 33508 "configure"
+#line 33544 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -43453,7 +43489,7 @@ echo "  ARPACK LIBS ........... = $ARPACK_LIBS"
 echo ""
 
 
-if test "$with_openmpi" != "no"; then
+if test "$with_mpi" == yes; then
    echo "OpenMPI Configuration:"
    echo "OpenMPI LIBS ........... = $OPENMPI_LIBS"
    echo "OpenMPI C Compiler ..... = $OPENMPI_CC"
index ca5425a..7642e25 100644 (file)
@@ -2111,7 +2111,7 @@ echo "  ARPACK LIBS ........... = $ARPACK_LIBS"
 echo ""
 
 
-if test "$with_openmpi" != "no"; then
+if test "$with_mpi" == yes; then
    echo "OpenMPI Configuration:"
    echo "OpenMPI LIBS ........... = $OPENMPI_LIBS"
    echo "OpenMPI C Compiler ..... = $OPENMPI_CC"
index 272c3ef..7eb9dc9 100644 (file)
@@ -1,45 +1,20 @@
 dnl
 dnl Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 dnl Copyright (C) INRIA - 2007 - Sylvestre Ledru
-dnl 
+dnl
 dnl This file must be used under the terms of the CeCILL.
 dnl This source file is licensed as described in the file COPYING, which
 dnl you should have received as part of this distribution.  The terms
-dnl are also available at    
+dnl are also available at
 dnl http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 dnl
 dnl Detection of openmpi
 dnl When we check :
 dnl * if the path is provided or that we have to find it ourself
 dnl * if it is available
-dnl * what are the compilation flags 
+dnl * what are the compilation flags
 dnl * what are linking flags
 AC_DEFUN([AC_OPENMPI], [
-#"$with_openmpi_path" != 'yes' -a "$with_openmpi_path" != 'no'
-#if test false != true; then
-   # Look if mpicc (which provides cflags and ldflags) is available
-#   AC_MSG_CHECKING([openmpi, for mpicc])
-#   OPENMPI_FOUND=0
-#   MPICC="$with_openmpi/bin/mpicc" 
-#        if test -x "$MPICC"; then
-#                AC_MSG_RESULT([$MPICC])
-#                              OPENMPI_CC=$MPICC
-#                              OPENMPI_FOUND=1
-#              fi
-#   if test $OPENMPI_FOUND -eq 0; then
-#   MPICC="$with_openmpi/mpicc" 
-#        if test -x "$MPICC"; then
-#                              OPENMPI_FOUND=1
-#                              OPENMPI_CC=$MPICC
-#                AC_MSG_RESULT([$MPICC])
-#        fi
-#   fi
-#              if test $OPENMPI_FOUND -eq 0; then
-#                AC_MSG_ERROR([Unable to find $MPICC. Please check the path you provided])
-#              else
-#                      unset OPENMPI_FOUND
-#              fi
-#else
                AC_CHECK_PROGS(OPENMPI_CC,mpicc,no)
                if test "x$MPICC" = "xno"; then
                                AC_MSG_ERROR([Unable to find mpicc in the path. Please check your installation of openmpi (example : openmpi & openmpi-dev with Debian)])
@@ -48,7 +23,6 @@ AC_DEFUN([AC_OPENMPI], [
                if test "x$MPICXX" = "xno"; then
                                AC_MSG_ERROR([Unable to find mpicxx in the path. Please check your installation of openmpi (example : openmpi & openmpi-dev with Debian)])
                fi
-#fi
 saved_cflags=$CFLAGS
 saved_cxxflags=$CXXFLAGS
 saved_LIBS="$LIBS"
@@ -76,11 +50,4 @@ AC_SUBST(OPENMPI_CFLAGS)
 AC_SUBST(OPENMPI_CXXFLAGS)
 AC_SUBST(OPENMPI_LIBS)
 
-#CFLAGS="$CFLAGS $OPENMPI_FLAGS"
-#AC_CHECK_LIB(xml2,xmlInitParserCtxt,,[AC_MSG_ERROR([pcre : library missing])])
-
-
-#AC_CHECK_HEADERS([pcre/tree.h],,[AC_MSG_ERROR([pcre : library missing missing])])     
-
-# Gets compilation and library flags
 ])