]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Made libBatch an optional prerequisite.
authorbarate <barate>
Thu, 24 Sep 2009 12:36:26 +0000 (12:36 +0000)
committerbarate <barate>
Thu, 24 Sep 2009 12:36:26 +0000 (12:36 +0000)
configure.ac
src/Launcher/DummyBatchTest.cxx [new file with mode: 0644]
src/Launcher/DummyLauncher.cxx [new file with mode: 0644]
src/Launcher/Launcher.cxx
src/Launcher/Launcher.hxx
src/Launcher/Makefile.am

index b46a9257ef0359cfaa40220b3243afa34f5c28c4..b335018d33df1e8e3405fcefc998f04eca048b9a 100644 (file)
@@ -221,14 +221,6 @@ echo
 
 CHECK_LIBXML
 
-echo
-echo ---------------------------------------------
-echo Testing libBatch
-echo ---------------------------------------------
-echo
-
-CHECK_LIBBATCH
-
 if test x$with_onlylauncher = xno; then
 echo
 echo ---------------------------------------------
@@ -365,6 +357,15 @@ echo ----------------------------------------------
 echo
 CHECK_CPPUNIT
 
+echo
+echo --------------------------------------------------------------
+echo Testing libBatch only required for batch functions in Launcher
+echo --------------------------------------------------------------
+echo
+
+CHECK_LIBBATCH
+AM_CONDITIONAL(WITH_BATCH, [test x"$libbatch_ok" = xyes])
+
 echo
 echo ============================================================
 echo testing products required only for documentation generation
@@ -420,12 +421,12 @@ function check_fatal_error {
 
 if test x$with_onlylauncher = xno; then
   if test x$corba_gen = xtrue; then
-    basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok libbatch_ok"
+    basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
   else
-    basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok libbatch_ok"
+    basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
   fi
 else
-  basic_mandatory_products="cc_ok threads_ok libxml_ok libbatch_ok"
+  basic_mandatory_products="cc_ok threads_ok libxml_ok"
 fi
 
 echo --- General mandatory products - Light configuration:
@@ -450,12 +451,17 @@ echo --- Kernel parallel extensions:
 summary $parallel_products
 echo
 
-optional_products="cppunit_ok numpy_ok"
+optional_products="cppunit_ok numpy_ok libbatch_ok"
 echo --- Optional products:
 echo ["    These products are optional because the KERNEL functions"]
 echo ["    using them are built only if the products are detected."]
 summary $optional_products
 echo
+if test x$libbatch_ok = xno; then
+  echo ["    Warning: Batch functions will not be available in"]
+  echo ["    Salome Launcher because they require libBatch."]
+  echo
+fi
 
 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
 
diff --git a/src/Launcher/DummyBatchTest.cxx b/src/Launcher/DummyBatchTest.cxx
new file mode 100644 (file)
index 0000000..6e995a2
--- /dev/null
@@ -0,0 +1,41 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// This implementation is an empty shell compiled only when libBatch is absent.
+// It will just throw exceptions when it is called.
+
+#include "BatchTest.hxx"
+#include "Launcher.hxx"
+
+BatchTest::BatchTest(const Engines::MachineDefinition& batch_descr) 
+{
+}
+
+BatchTest::~BatchTest()
+{
+}
+
+bool BatchTest::test()
+{
+  throw LauncherException("Method BatchTest::test() is not available "
+                          "(libBatch was not found at compilation time).");
+}
diff --git a/src/Launcher/DummyLauncher.cxx b/src/Launcher/DummyLauncher.cxx
new file mode 100644 (file)
index 0000000..fb9222b
--- /dev/null
@@ -0,0 +1,97 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// This implementation is an empty shell compiled only when libBatch is absent.
+// It will just throw exceptions when it is called.
+
+#include "Launcher.hxx"
+
+using namespace std;
+
+Launcher_cpp::Launcher_cpp()
+{
+}
+
+Launcher_cpp::~Launcher_cpp()
+{
+}
+
+long Launcher_cpp::submitJob(const string xmlExecuteFile,
+                             const string clusterName) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::submitJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
+
+long Launcher_cpp::submitSalomeJob(const string fileToExecute,
+                                   const vector<string>& filesToExport,
+                                   const vector<string>& filesToImport,
+                                   const batchParams& batch_params,
+                                   const machineParams& params) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::submitSalomeJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
+
+string Launcher_cpp::queryJob(long id,
+                              const machineParams& params) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::queryJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
+
+string Launcher_cpp::queryJob(long id,
+                              const string clusterName) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::queryJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
+
+void Launcher_cpp::deleteJob(const long id,
+                             const machineParams& params) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::deleteJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
+
+void Launcher_cpp::deleteJob(long id,
+                             const string clusterName) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::deleteJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
+
+void Launcher_cpp::getResultsJob(const string directory,
+                                 const long id,
+                                 const machineParams& params) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::getResultsJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
+
+void Launcher_cpp::getResultsJob(const string directory,
+                                 long id,
+                                 const string clusterName) throw (LauncherException)
+{
+  throw LauncherException("Method Launcher_cpp::getResultsJob is not available "
+                          "(libBatch was not found at compilation time).");
+}
index 9cdd800a4e2d5c4549a3188bb6f69bdfbe2ba63b..9e14cc361f7cb89d001e43ded743e79707ce3741 100644 (file)
@@ -321,7 +321,7 @@ string Launcher_cpp::queryJob( long id,
 }
 
 string Launcher_cpp::queryJob( long id, 
-                              const std::string clusterName)
+                              const std::string clusterName) throw (LauncherException)
 {
   machineParams params;
   params.hostname = clusterName;
@@ -359,7 +359,7 @@ void Launcher_cpp::deleteJob( const long id,
 }
 
 void Launcher_cpp::deleteJob( long id, 
-                             const std::string clusterName)
+                             const std::string clusterName) throw (LauncherException)
 {
   machineParams params;
   params.hostname = clusterName;
@@ -396,7 +396,7 @@ void Launcher_cpp::getResultsJob( const string directory,
 
 void Launcher_cpp::getResultsJob( const std::string directory, 
                                  long id, 
-                                 const std::string clusterName)
+                                 const std::string clusterName) throw (LauncherException)
 {
   machineParams params;
   params.hostname = clusterName;
index 33e7fd76c238ce0d9835c3e6dceef564f4037ce0..279adbdc3e1c3db1a7a3afdd26596151bd832bcf 100644 (file)
@@ -78,11 +78,11 @@ public:
                       const machineParams& params) throw(LauncherException);
 
   std::string queryJob( const long jobId, const machineParams& params) throw(LauncherException);
-  std::string queryJob( const long jobId, const std::string clusterName);
+  std::string queryJob( const long jobId, const std::string clusterName) throw(LauncherException);
   void deleteJob( const long jobId, const machineParams& params) throw(LauncherException);
-  void deleteJob( const long jobId, const std::string clusterName);
+  void deleteJob( const long jobId, const std::string clusterName) throw(LauncherException);
   void getResultsJob( const std::string directory, const long jobId, const machineParams& params ) throw(LauncherException);
-  void getResultsJob( const std::string directory, const long jobId, const std::string clusterName );
+  void getResultsJob( const std::string directory, const long jobId, const std::string clusterName ) throw (LauncherException);
 
   void SetResourcesManager( ResourcesManager_cpp* rm ) { _ResManager = rm; }
 
index d3e94733e0f402c86e4f81a9c9dad3002e4a7abd..235bda84177ed98c916c9506245771736c47e955 100644 (file)
@@ -91,10 +91,16 @@ if WITHONLYLAUNCHER
 else
   lib_LTLIBRARIES = libLauncher.la libSalomeLauncher.la
 endif
+
 libSalomeLauncher_la_SOURCES=\
-       BatchTest.cxx \
        SALOME_Launcher.cxx 
 
+if WITH_BATCH
+  libSalomeLauncher_la_SOURCES += BatchTest.cxx
+else
+  libSalomeLauncher_la_SOURCES += DummyBatchTest.cxx
+endif
+
 libSalomeLauncher_la_CPPFLAGS =\
        $(COMMON_CPPFLAGS)
 
@@ -107,8 +113,13 @@ libSalomeLauncher_la_LIBADD =\
 
 libLauncher_la_SOURCES=\
        SALOME_Launcher_Parser.cxx \
-       SALOME_Launcher_Handler.cxx  \
-       Launcher.cxx
+       SALOME_Launcher_Handler.cxx
+
+if WITH_BATCH
+  libLauncher_la_SOURCES += Launcher.cxx
+else
+  libLauncher_la_SOURCES += DummyLauncher.cxx
+endif
 
 libLauncher_la_CPPFLAGS =\
        -I$(srcdir)/../ResourcesManager \