By default, do not build any MPI feature. 54/12454/1
Sylvestre Ledru [Fri, 6 Sep 2013 11:38:41 +0000 (13:38 +0200)]
To enable it, use --with-mpi

Change-Id: I622c5e17a600f961f16edc86d8c75aa31e630fee

scilab/Makefile.am
scilab/Makefile.in
scilab/configure
scilab/configure.ac
scilab/m4/mpi.m4
scilab/modules/console/src/c/others/initMPI.c [new file with mode: 0644]
scilab/modules/console/src/c/others/initMPI.h [new file with mode: 0644]
scilab/modules/console/src/c/others/mainscic.cpp
scilab/modules/core/includes/machine.h.in

index 40d717c..6434cd0 100644 (file)
@@ -34,8 +34,6 @@ bin_PROGRAMS          = scilab-bin scilab-cli-bin
 bin_SCRIPTS                    = bin/scilab bin/scilab-adv-cli bin/scilab-cli \
 bin/scinotes bin/xcos
 
-CXX = $(OPENMPI_CXX)
-
 if IS_MACOSX
 bin_SCRIPTS            += bin/checkmacosx.applescript
 endif
@@ -81,6 +79,12 @@ scilab_cli_bin_SOURCES       = $(top_srcdir)/modules/console/src/c/others/mainscic.cpp
 scilab_cli_bin_CPPFLAGS = -DWITHOUT_GUI $(scilab_bin_CPPFLAGS)
 scilab_cli_bin_LDADD   = $(COMMON_LIBS) $(top_builddir)/modules/libscilab-cli.la $(FLIBS)
 
+if MPI
+CXX = $(OPENMPI_CXX)
+scilab_bin_SOURCES += $(top_srcdir)/modules/console/src/c/others/initMPI.c
+scilab_cli_bin_SOURCES += $(top_srcdir)/modules/console/src/c/others/initMPI.c
+endif
+
 
 if NEED_JAVA
 # Don't do it for scilab_cli_bin. We want to be able to call it without
index f48dce5..26810f6 100644 (file)
@@ -115,10 +115,12 @@ bin_PROGRAMS = scilab-bin$(EXEEXT) scilab-cli-bin$(EXEEXT)
 @USE_STATIC_SYSTEM_LIB_FALSE@am__append_5 = -lstdc++
 #-static-libgfortran
 @IS_MACOSX_TRUE@am__append_6 = -framework Cocoa
+@MPI_TRUE@am__append_7 = $(top_srcdir)/modules/console/src/c/others/initMPI.c
+@MPI_TRUE@am__append_8 = $(top_srcdir)/modules/console/src/c/others/initMPI.c
 
 #  The user wants to compile the localization files
-@GENERATE_LOCALIZATION_FILES_TRUE@am__append_7 = localization
-@COMPILATION_TESTS_TRUE@am__append_8 = check-java
+@GENERATE_LOCALIZATION_FILES_TRUE@am__append_9 = localization
+@COMPILATION_TESTS_TRUE@am__append_10 = check-java
 DIST_COMMON = $(top_srcdir)/Makefile.call_scilab.am \
        $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
        $(top_srcdir)/configure $(am__configure_deps) \
@@ -256,7 +258,11 @@ call_scilab_readwritestring_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
        $(call_scilab_readwritestring_CFLAGS) $(CFLAGS) \
        $(call_scilab_readwritestring_LDFLAGS) $(LDFLAGS) -o $@
-am_scilab_bin_OBJECTS = scilab_bin-mainscic.$(OBJEXT)
+am__scilab_bin_SOURCES_DIST =  \
+       $(top_srcdir)/modules/console/src/c/others/mainscic.cpp \
+       $(top_srcdir)/modules/console/src/c/others/initMPI.c
+@MPI_TRUE@am__objects_1 = scilab_bin-initMPI.$(OBJEXT)
+am_scilab_bin_OBJECTS = scilab_bin-mainscic.$(OBJEXT) $(am__objects_1)
 scilab_bin_OBJECTS = $(am_scilab_bin_OBJECTS)
 am__DEPENDENCIES_1 =
 am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
@@ -265,7 +271,12 @@ scilab_bin_DEPENDENCIES = $(am__DEPENDENCIES_2) \
 scilab_bin_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
        $(CXXFLAGS) $(scilab_bin_LDFLAGS) $(LDFLAGS) -o $@
-am_scilab_cli_bin_OBJECTS = scilab_cli_bin-mainscic.$(OBJEXT)
+am__scilab_cli_bin_SOURCES_DIST =  \
+       $(top_srcdir)/modules/console/src/c/others/mainscic.cpp \
+       $(top_srcdir)/modules/console/src/c/others/initMPI.c
+@MPI_TRUE@am__objects_2 = scilab_cli_bin-initMPI.$(OBJEXT)
+am_scilab_cli_bin_OBJECTS = scilab_cli_bin-mainscic.$(OBJEXT) \
+       $(am__objects_2)
 scilab_cli_bin_OBJECTS = $(am_scilab_cli_bin_OBJECTS)
 scilab_cli_bin_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(top_builddir)/modules/libscilab-cli.la $(am__DEPENDENCIES_1)
@@ -369,8 +380,9 @@ DIST_SOURCES = $(call_scilab_c_SOURCES) \
        $(call_scilab_readwriteboolean_SOURCES) \
        $(call_scilab_readwritecomplexmatrix_SOURCES) \
        $(call_scilab_readwritematrix_SOURCES) \
-       $(call_scilab_readwritestring_SOURCES) $(scilab_bin_SOURCES) \
-       $(scilab_cli_bin_SOURCES)
+       $(call_scilab_readwritestring_SOURCES) \
+       $(am__scilab_bin_SOURCES_DIST) \
+       $(am__scilab_cli_bin_SOURCES_DIST)
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
        ctags-recursive dvi-recursive html-recursive info-recursive \
        install-data-recursive install-dvi-recursive \
@@ -511,7 +523,8 @@ CURL_CFLAGS = @CURL_CFLAGS@
 CURL_CONFIG = @CURL_CONFIG@
 CURL_LIBS = @CURL_LIBS@
 CURL_VERSION = @CURL_VERSION@
-CXX = $(OPENMPI_CXX)
+@MPI_TRUE@CXX = $(OPENMPI_CXX)
+CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
@@ -774,15 +787,19 @@ scilab_bin_CPPFLAGS = -I$(top_srcdir)/modules/io/includes/ \
 # Localization dep already exists because of the `exportLocaleToSystem' symbol
 # (causing issues on some platform)
 COMMON_LIBS = $(LTLIBINTL)
-scilab_bin_SOURCES = $(top_srcdir)/modules/console/src/c/others/mainscic.cpp
+scilab_bin_SOURCES =  \
+       $(top_srcdir)/modules/console/src/c/others/mainscic.cpp \
+       $(am__append_7)
 scilab_bin_LDADD = $(COMMON_LIBS) $(top_builddir)/modules/libscilab.la $(FLIBS)
 
 # Match scilab -nwni (ie command line without graphics)
-scilab_cli_bin_SOURCES = $(top_srcdir)/modules/console/src/c/others/mainscic.cpp
+scilab_cli_bin_SOURCES =  \
+       $(top_srcdir)/modules/console/src/c/others/mainscic.cpp \
+       $(am__append_8)
 scilab_cli_bin_CPPFLAGS = -DWITHOUT_GUI $(scilab_bin_CPPFLAGS)
 scilab_cli_bin_LDADD = $(COMMON_LIBS) $(top_builddir)/modules/libscilab-cli.la $(FLIBS)
 LANG_DOMAIN = scilab
-TARGETS_ALL = macros $(am__append_7) $(am__append_8)
+TARGETS_ALL = macros $(am__append_9) $(am__append_10)
 
 # check is performed with scilab, so use the serial-tests on purpose
 TESTS_ENVIRONMENT = LANG=C $(top_builddir)/bin/scilab-cli -nb -noatomsautoload -f
@@ -1100,7 +1117,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call_scilab_readwritecomplexmatrix-readwritecomplexmatrix.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call_scilab_readwritematrix-readwritematrix.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call_scilab_readwritestring-readwritestring.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scilab_bin-initMPI.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scilab_bin-mainscic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scilab_cli_bin-initMPI.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scilab_cli_bin-mainscic.Po@am__quote@
 
 .c.o:
@@ -1236,6 +1255,34 @@ call_scilab_readwritestring-readwritestring.obj: $(top_srcdir)/modules/call_scil
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(call_scilab_readwritestring_CFLAGS) $(CFLAGS) -c -o call_scilab_readwritestring-readwritestring.obj `if test -f '$(top_srcdir)/modules/call_scilab/examples/basicExamples/readwritestring.c'; then $(CYGPATH_W) '$(top_srcdir)/modules/call_scilab/examples/basicExamples/readwritestring.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/modules/call_scilab/examples/basicExamples/readwritestring.c'; fi`
 
+scilab_bin-initMPI.o: $(top_srcdir)/modules/console/src/c/others/initMPI.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scilab_bin-initMPI.o -MD -MP -MF $(DEPDIR)/scilab_bin-initMPI.Tpo -c -o scilab_bin-initMPI.o `test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c' || echo '$(srcdir)/'`$(top_srcdir)/modules/console/src/c/others/initMPI.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/scilab_bin-initMPI.Tpo $(DEPDIR)/scilab_bin-initMPI.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$(top_srcdir)/modules/console/src/c/others/initMPI.c' object='scilab_bin-initMPI.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scilab_bin-initMPI.o `test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c' || echo '$(srcdir)/'`$(top_srcdir)/modules/console/src/c/others/initMPI.c
+
+scilab_bin-initMPI.obj: $(top_srcdir)/modules/console/src/c/others/initMPI.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scilab_bin-initMPI.obj -MD -MP -MF $(DEPDIR)/scilab_bin-initMPI.Tpo -c -o scilab_bin-initMPI.obj `if test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; then $(CYGPATH_W) '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/modules/console/src/c/others/initMPI.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/scilab_bin-initMPI.Tpo $(DEPDIR)/scilab_bin-initMPI.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$(top_srcdir)/modules/console/src/c/others/initMPI.c' object='scilab_bin-initMPI.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scilab_bin-initMPI.obj `if test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; then $(CYGPATH_W) '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/modules/console/src/c/others/initMPI.c'; fi`
+
+scilab_cli_bin-initMPI.o: $(top_srcdir)/modules/console/src/c/others/initMPI.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_cli_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scilab_cli_bin-initMPI.o -MD -MP -MF $(DEPDIR)/scilab_cli_bin-initMPI.Tpo -c -o scilab_cli_bin-initMPI.o `test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c' || echo '$(srcdir)/'`$(top_srcdir)/modules/console/src/c/others/initMPI.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/scilab_cli_bin-initMPI.Tpo $(DEPDIR)/scilab_cli_bin-initMPI.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$(top_srcdir)/modules/console/src/c/others/initMPI.c' object='scilab_cli_bin-initMPI.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_cli_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scilab_cli_bin-initMPI.o `test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c' || echo '$(srcdir)/'`$(top_srcdir)/modules/console/src/c/others/initMPI.c
+
+scilab_cli_bin-initMPI.obj: $(top_srcdir)/modules/console/src/c/others/initMPI.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_cli_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scilab_cli_bin-initMPI.obj -MD -MP -MF $(DEPDIR)/scilab_cli_bin-initMPI.Tpo -c -o scilab_cli_bin-initMPI.obj `if test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; then $(CYGPATH_W) '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/modules/console/src/c/others/initMPI.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/scilab_cli_bin-initMPI.Tpo $(DEPDIR)/scilab_cli_bin-initMPI.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$(top_srcdir)/modules/console/src/c/others/initMPI.c' object='scilab_cli_bin-initMPI.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(scilab_cli_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scilab_cli_bin-initMPI.obj `if test -f '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; then $(CYGPATH_W) '$(top_srcdir)/modules/console/src/c/others/initMPI.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/modules/console/src/c/others/initMPI.c'; fi`
+
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
index da28363..1124533 100755 (executable)
@@ -1776,7 +1776,7 @@ Optional Packages:
   --without-fftw          Disable the interface to the FFTW 3 library
   --with-fftw-include=DIR Set the path to the FFTW headers
   --with-fftw-library=DIR Set the path to the FFTW libraries
-  --without-mpi           compile with MPI library
+  --with-mpi              compile with MPI library
   --without-openmp        Disable the usage of OpenMP (parallelization of some
                           algoritms)
   --with-libxml2=PREFIX   Set the path to your libxml2 installation
 ## MPI
 #################
 
-# Not in Scilab 5.0
+# Disable by default the build of MPI:
+# * It is hard to package
+# * People are administrating cluster know about rebuilding packages
+# * They use their own MPI library
 
 # Check whether --with-mpi was given.
 if test "${with_mpi+set}" = set; then :
@@ -21324,7 +21327,7 @@ fi
 
 
 MPI_ENABLE=no
-if test "$with_mpi" != no; then
+if test "$with_mpi" == yes; then
 
 #"$with_openmpi_path" != 'yes' -a "$with_openmpi_path" != 'no'
 #if test false != true; then
 #OPENMPI_HEADER="$openmpi_dir/include/mpi.h"
 #OPENMPI_DIR="$openmpi_dir"
 
+
+$as_echo "#define ENABLE_MPI /**/" >>confdefs.h
+
+
 LIBS="$saved_LIBS"
 CFLAGS=$saved_cflags
 
@@ -21529,7 +21536,7 @@ CFLAGS=$saved_cflags
 fi
 
 
- if test "$with_mpi" != no; then
+ if test "$with_mpi" == yes; then
   MPI_TRUE=
   MPI_FALSE='#'
 else
@@ -25841,7 +25848,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 25844 "configure"
+#line 25851 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TCL_INCLUDE_PATH/$CHK_TCL_INC_NAME"
@@ -26152,7 +26159,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 26155 "configure"
+#line 26162 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TK_INCLUDE_PATH/$CHK_TK_INC_NAME"
@@ -26736,7 +26743,7 @@ $as_echo_n "checking saxon9he... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 26739 "configure"
+// #line 26746 "configure"
 import java.util.regex.Pattern;
 
 import net.sf.saxon.Version;
@@ -26851,7 +26858,7 @@ $as_echo_n "checking saxon... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 26854 "configure"
+// #line 26861 "configure"
 import java.util.regex.Pattern;
 
 import net.sf.saxon.Version;
@@ -26967,7 +26974,7 @@ $as_echo_n "checking saxon... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 26970 "configure"
+// #line 26977 "configure"
 import java.util.regex.Pattern;
 
 import com.icl.saxon.Loader;
@@ -33394,7 +33401,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 33397 "configure"
+#line 33404 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -33500,7 +33507,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 33503 "configure"
+#line 33510 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 2c2a1ff..ca5425a 100644 (file)
@@ -155,7 +155,7 @@ AC_PROG_GREP
 
 AC_ARG_WITH(fink_prefix,
 AC_HELP_STRING([--with-fink-prefix],[Provide a fink prefix. Default: /sw/ ]))
-# Need MacosX Version to specify some path.                                  
+# Need MacosX Version to specify some path.
 case "$host_os" in
      *Darwin* | *darwin*)
              AC_GET_MACOSX_VERSION
@@ -1352,19 +1352,22 @@ AM_CONDITIONAL(FFTW, test "$with_fftw" != no)
 ## MPI
 #################
 
-# Not in Scilab 5.0
+# Disable by default the build of MPI:
+# * It is hard to package
+# * People are administrating cluster know about rebuilding packages
+# * They use their own MPI library
 AC_ARG_WITH(mpi,
-    AC_HELP_STRING([--without-mpi],[compile with MPI library]))
+    AC_HELP_STRING([--with-mpi],[compile with MPI library]))
 
 MPI_ENABLE=no
-if test "$with_mpi" != no; then
+if test "$with_mpi" == yes; then
    AC_OPENMPI()
    # We will have to detect other implementation of OpenMPI
    MPI_ENABLE=yes
 fi
 AC_SUBST(MPI_ENABLE)
 
-AM_CONDITIONAL(MPI, test "$with_mpi" != no)
+AM_CONDITIONAL(MPI, test "$with_mpi" == yes)
 
 #################
 ## OpenMP
index caa36c7..24c8927 100644 (file)
@@ -71,6 +71,8 @@ AC_CHECK_LIB([mpi], [MPI_Init],
 #OPENMPI_HEADER="$openmpi_dir/include/mpi.h"
 #OPENMPI_DIR="$openmpi_dir"
 
+AC_DEFINE([ENABLE_MPI],[],[Have MPI features])
+
 LIBS="$saved_LIBS"
 CFLAGS=$saved_cflags
 
diff --git a/scilab/modules/console/src/c/others/initMPI.c b/scilab/modules/console/src/c/others/initMPI.c
new file mode 100644 (file)
index 0000000..ca08b88
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - S/E - Sylvestre Ledru
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include <mpi.h>
+
+MPI_Errhandler errhdl;
+
+void MPIErrHandler(MPI_Comm * comm, int *errorcode, ...)
+{
+    char buffer[4096];
+    int resultlen;
+
+    MPI_Error_string(*errorcode, buffer, &resultlen);
+    buffer[resultlen] = 0;
+    fprintf(stderr,_("MPI error: %s\n"), buffer);
+}
+
+
+int initScilabMPI()
+{
+    int flag;
+    MPI_Initialized(&flag);
+    if (!flag)
+    {
+        /* MPI Not yet initialized */
+        MPI_Init(NULL, NULL);
+    }
+}
diff --git a/scilab/modules/console/src/c/others/initMPI.h b/scilab/modules/console/src/c/others/initMPI.h
new file mode 100644 (file)
index 0000000..594322f
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - S/E - Sylvestre Ledru
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+/**
+ * Initialize the MPI features
+ */
+int initScilabMPI(void);
+
index d9fd115..4a63b15 100644 (file)
@@ -14,8 +14,6 @@
 #include <unistd.h>             /* isatty */
 #include <stdlib.h>             /* stdin */
 #include <stdio.h>
-  /* THIS IS TEMPORARY CODE FOR SCILAB / MPI */
-#include <mpi.h>
 extern "C" {
 #include "core_math.h"
 #include "version.h"
@@ -32,6 +30,11 @@ extern "C" {
 #include "signal_mgmt.h"
 #include "cliDisplayManagement.h"
 
+#ifdef ENABLE_MPI
+#include "initMPI.h"
+#endif
+
+
 #ifdef __APPLE__
 #include "initMacOSXEnv.h"
 #endif
@@ -63,25 +66,10 @@ int F77_DUMMY_MAIN()
 }
 #endif
 
-  /* THIS IS TEMPORARY CODE FOR SCILAB / MPI */
-MPI_Errhandler errhdl;
-
-/* should be moved elsewhere */
-void MPIErrHandler(MPI_Comm * comm, int *errorcode, ...)
-{
-    char buffer[4096];
-    int resultlen;
-
-    MPI_Error_string(*errorcode, buffer, &resultlen);
-    buffer[resultlen] = 0;
-    printf("Erreur mpi : %s\n", buffer);
-}
-
 int main(int argc, char **argv)
 {
-
     int i;
-    int no_startup_flag = 0, flag;
+    int no_startup_flag = 0;
     int memory = MIN_STACKSIZE;
 
     char *initial_script = NULL;
@@ -94,13 +82,9 @@ int main(int argc, char **argv)
     setFPUToDouble();
 #endif
 
-    /* THIS IS TEMPORARY CODE FOR SCILAB / MPI */
-    MPI_Initialized(&flag);
-    if (!flag)
-    {
-        /* MPI Not yet initialized */
-        MPI_Init(NULL, NULL);
-    }
+#ifdef ENABLE_MPI
+    initScilabMPI();
+#endif
 
     InitializeLaunchScilabSignal();
 
index bec4c81..c23ce43 100644 (file)
@@ -23,6 +23,9 @@
 /* CURL version */
 #undef CURL_VERSION
 
+/* Have MPI features */
+#undef ENABLE_MPI
+
 /* Define to 1 if translation of program messages to the user's native
    language is requested. */
 #undef ENABLE_NLS