From 17bc8a48887d6cac2326257184dedab2f414b3a0 Mon Sep 17 00:00:00 2001 From: boulant Date: Thu, 15 Dec 2005 11:34:48 +0000 Subject: [PATCH] =?utf8?q?Int=C3=A9gration=20biblioth=C3=A8que=20Batch=20v?= =?utf8?q?ersion=200.3.0=20(avec=20gestionnaire=20local)=20Finalisation=20?= =?utf8?q?de=20la=20partie=20swig.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- configure.ac | 10 ++- salome_adm/unix/SALOMEconfig.h.in | 22 +++++ salome_adm/unix/config_files/check_local.m4 | 69 +++++++++++++++ salome_adm/unix/config_files/check_lsf.m4 | 2 +- salome_adm/unix/config_files/check_mpi.m4 | 1 + salome_adm/unix/config_files/check_openpbs.m4 | 2 + src/Batch_SWIG/Makefile.am | 86 +++++++++++++++++++ src/Batch_SWIG/Makefile.in | 49 ----------- src/Makefile.am | 16 ++++ 9 files changed, 205 insertions(+), 52 deletions(-) create mode 100755 salome_adm/unix/config_files/check_local.m4 create mode 100644 src/Batch_SWIG/Makefile.am delete mode 100644 src/Batch_SWIG/Makefile.in diff --git a/configure.ac b/configure.ac index dcad852ea..08815f50a 100644 --- a/configure.ac +++ b/configure.ac @@ -202,10 +202,16 @@ CHECK_LSF dnl lsf_ok is set to yes by CHECK_LSF echo lsf = $lsf_ok +echo testing Local batch system +echo -------------------------- +localbatch_ok=no +CHECK_LOCAL +dnl localbatch_ok is set to yes by CHECK_LOCAL + WITH_BATCH=no -test x$openpbs_ok = xyes || test x$lsf_ok = xyes && WITH_BATCH=yes +test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes AC_SUBST(WITH_BATCH) - +AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes]) echo echo --------------------------------------------- diff --git a/salome_adm/unix/SALOMEconfig.h.in b/salome_adm/unix/SALOMEconfig.h.in index c1be35bd0..22372e97a 100644 --- a/salome_adm/unix/SALOMEconfig.h.in +++ b/salome_adm/unix/SALOMEconfig.h.in @@ -32,4 +32,26 @@ #define @MACHINE@ #endif + +/* A path to a rcp-like command */ +#define RCP "@RCP@" + +/* A path to a rm-like command */ +#define RM "@RM@" + +/* A path to a cp-like command */ +#define CP "@CP@" + +/* A path to a rsh-like command */ +#define RSH "@RSH@" + +/* A path to a scp-like command */ +#define SCP "@SCP@" + +/* A path to a sh-like command */ +#define SH "@SH@" + +/* A path to a ssh-like command */ +#define SSH "@SSH@" + #endif diff --git a/salome_adm/unix/config_files/check_local.m4 b/salome_adm/unix/config_files/check_local.m4 new file mode 100755 index 000000000..67274089f --- /dev/null +++ b/salome_adm/unix/config_files/check_local.m4 @@ -0,0 +1,69 @@ +# Check for Local +AC_DEFUN([CHECK_LOCAL], +[ + dnl AC_ARG_VAR([LOCAL], []) + AC_ARG_WITH([local], + AC_HELP_STRING([--with-local], + [tell configure script to use local submission. Default is --with-local.]), + [], + [withval=yes]) + + AC_MSG_CHECKING([for Local]) + + if test "x$withval" = "xyes" + then + WITH_LOCAL=yes + + AC_MSG_RESULT([$withval]) + + AC_ARG_VAR([RM], [A path to a rm-like command]) + AC_PATH_PROG([RM], [rm], [/bin/false]) + AC_DEFINE_UNQUOTED(RM, "$RM", [A path to a rm-like command]) + + AC_ARG_VAR([SH], [A path to a sh-like command]) + AC_PATH_PROG([SH], [sh], [/bin/false]) + AC_DEFINE_UNQUOTED(SH, "$SH", [A path to a sh-like command]) + AC_ARG_VAR([CP], [A path to a cp-like command]) + AC_PATH_PROG([CP], [cp], [/bin/false]) + AC_DEFINE_UNQUOTED(CP, "$CP", [A path to a cp-like command]) + + AC_ARG_VAR([RSH], [A path to a rsh-like command]) + AC_PATH_PROG([RSH], [rsh], [/bin/false]) + AC_DEFINE_UNQUOTED(RSH, "$RSH", [A path to a rsh-like command]) + AC_ARG_VAR([RCP], [A path to a rcp-like command]) + AC_PATH_PROG([RCP], [rcp], [/bin/false]) + AC_DEFINE_UNQUOTED(RCP, "$RCP", [A path to a rcp-like command]) + + AC_ARG_VAR([SSH], [A path to a ssh-like command]) + AC_PATH_PROG([SSH], [ssh], [/bin/false]) + AC_DEFINE_UNQUOTED(SSH, "$SSH", [A path to a ssh-like command]) + AC_ARG_VAR([SCP], [A path to a scp-like command]) + AC_PATH_PROG([SCP], [scp], [/bin/false]) + AC_DEFINE_UNQUOTED(SCP, "$SCP", [A path to a scp-like command]) + + + else + WITH_LOCAL=no + + AC_MSG_RESULT([no]) + + fi + + AM_CONDITIONAL(WITH_LOCAL, test $WITH_LOCAL = yes) + + localbatch_ok=$WITH_LOCAL + AC_SUBST(WITH_LOCAL) + AC_SUBST(RM) + AC_SUBST(SH) + AC_SUBST(CP) + AC_SUBST(RSH) + AC_SUBST(RCP) + AC_SUBST(SSH) + AC_SUBST(SCP) + + dnl _CS_gbo Pour forcer l'utilisation du config.h, inclu + dnl par les fichiers Batch_BatchManager_Local_*.cxx + dnl OWN_CONFIG_H=yes + dnl AC_SUBST(OWN_CONFIG_H) +]) + diff --git a/salome_adm/unix/config_files/check_lsf.m4 b/salome_adm/unix/config_files/check_lsf.m4 index a172d477d..a4faddb3c 100755 --- a/salome_adm/unix/config_files/check_lsf.m4 +++ b/salome_adm/unix/config_files/check_lsf.m4 @@ -72,7 +72,7 @@ AC_DEFUN([CHECK_LSF], fi - dnl AM_CONDITIONAL(WITH_LSF, test $WITH_LSF = 1) + AM_CONDITIONAL(WITH_LSF, test $WITH_LSF = yes) lsf_ok=$WITH_LSF if test $lsf_ok = no ; then diff --git a/salome_adm/unix/config_files/check_mpi.m4 b/salome_adm/unix/config_files/check_mpi.m4 index f5747403d..a9c97c9b8 100644 --- a/salome_adm/unix/config_files/check_mpi.m4 +++ b/salome_adm/unix/config_files/check_mpi.m4 @@ -107,4 +107,5 @@ AC_SUBST(WITHMPI) AC_SUBST(MPI_INCLUDES) AC_SUBST(MPI_LIBS) AC_SUBST(mpi_ok) +AM_CONDITIONAL(MPI_IS_OK, [test x"$mpi_ok" = xyes]) ])dnl diff --git a/salome_adm/unix/config_files/check_openpbs.m4 b/salome_adm/unix/config_files/check_openpbs.m4 index 014545886..977aa776d 100644 --- a/salome_adm/unix/config_files/check_openpbs.m4 +++ b/salome_adm/unix/config_files/check_openpbs.m4 @@ -61,5 +61,7 @@ AC_DEFUN([CHECK_OPENPBS], fi AC_SUBST(WITHOPENPBS) + AM_CONDITIONAL(WITH_OPENPBS, test $WITHOPENPBS = yes) + ]) diff --git a/src/Batch_SWIG/Makefile.am b/src/Batch_SWIG/Makefile.am new file mode 100644 index 000000000..3de642dc0 --- /dev/null +++ b/src/Batch_SWIG/Makefile.am @@ -0,0 +1,86 @@ +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : Makefile.am +# Author : Guillaume Boulant (CSSI) +# Module : KERNEL +# $Header$ + + +include $(top_srcdir)/salome_adm/unix/make_common_starter.am + +# +# =============================================================== +# Swig targets +# =============================================================== +# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm) +# +# Step 1: build the wrapping source files with swig +# +# libBatch_Swig.i -- swig --> swig_wrap.cpp +# libBatch_Swig.py +# +# Step 2: build the dynamic library from cpp built source files and +# dependant libraries. +# +# swig_wrap.cpp -- gcc --> swig_wrap.o |-- link --> _libBatch_Swig.la +# + | +# dependant libs | +# +# The file libBatch_Swig.py will be installed in +# /lib/python/site-package/salome. +# The library will be installed in the common place. +# + +BUILT_SOURCES = swig_wrap.cpp + +SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../Batch +SWIG_SOURCES = libBatch_Swig.i libBatch_Swig_exception.i libBatch_Swig_typemap.i + +pkgpython_PYTHON = libBatch_Swig.py +pkgpyexec_LTLIBRARIES = _libBatch_Swig.la +_libBatch_Swig_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES) +_libBatch_Swig_la_CPPFLAGS = @PYTHON_INCLUDES@ -I$(srcdir) -I$(srcdir)/../Batch +_libBatch_Swig_la_LDFLAGS = -module +_libBatch_Swig_la_LIBADD = ../Batch/libSalomeBatch.la @PYTHON_LIBS@ + +if WITH_OPENPBS +_libBatch_Swig_la_CPPFLAGS += @OPENPBS_INCLUDES@ +_libBatch_Swig_la_LIBADD += @OPENPBS_LIBDIR@ @OPENPBS_LIBS@ +endif + +swig_wrap.cpp : $(SWIG_SOURCES) + $(SWIG) $(SWIG_FLAGS) -o $@ $< + +CLEANFILES = swig_wrap.cpp + + +# +# =============================================================== +# Files to be installed +# =============================================================== +# + +# Scripts to be installed. +salomescript_SCRIPTS = Batch_test.py + +# You don't need to specify libBatch_Swig.py. It is automatically +# installed by means of the swig target pkgpython_PYTHON. diff --git a/src/Batch_SWIG/Makefile.in b/src/Batch_SWIG/Makefile.in deleted file mode 100644 index 89d6c9731..000000000 --- a/src/Batch_SWIG/Makefile.in +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : Makefile.in -# Author : Paul RASCLE, EDF -# Module : SALOME -# $Header$ - -top_srcdir=@top_srcdir@ -top_builddir=../.. -srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/idl - - -@COMMENCE@ - -# Libraries targets - -LIB = libBatch_Swigcmodule.la -LIB_SRC = - -SWIG_DEF = libBatch_Swig.i -EXPORT_PYSCRIPTS = libBatch_Swig.py Batch_test.py - -CPPFLAGS += $(PYTHON_INCLUDES) $(OPENPBS_INCLUDES) - -LDFLAGS += $(OPENPBS_LIBDIR) - -LIBS += $(PYTHON_LIBS) $(OPENPBS_LIBS) -lSalomeBatch - -@CONCLUDE@ diff --git a/src/Makefile.am b/src/Makefile.am index f11403da4..ca13e4a26 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,6 +53,11 @@ SUBDIRS = \ ModuleGenerator \ Communication +# +# The following packages are built under conditions. +# A condition is defined using the macro AM_CONDITIONAL (see the +# check_cppunit for example with CPPUNIT_IS_OK. +# if CPPUNIT_IS_OK SUBDIRS+= \ @@ -64,3 +69,14 @@ if CPPUNIT_IS_OK LifeCycleCORBA/Test \ UnitTests endif + + +if MPI_IS_OK + SUBDIRS+= MPIContainer TestMPIContainer +endif + +if WITH_BATCH + SUBDIRS += Batch Batch_SWIG +endif + + -- 2.39.2