From 1aa0a555b46dfd01bcb097c9ef35e415db6dd03f Mon Sep 17 00:00:00 2001 From: barate Date: Thu, 24 Sep 2009 12:36:26 +0000 Subject: [PATCH] Made libBatch an optional prerequisite. --- configure.ac | 30 ++++++---- src/Launcher/DummyBatchTest.cxx | 41 ++++++++++++++ src/Launcher/DummyLauncher.cxx | 97 +++++++++++++++++++++++++++++++++ src/Launcher/Launcher.cxx | 6 +- src/Launcher/Launcher.hxx | 6 +- src/Launcher/Makefile.am | 17 +++++- 6 files changed, 176 insertions(+), 21 deletions(-) create mode 100644 src/Launcher/DummyBatchTest.cxx create mode 100644 src/Launcher/DummyLauncher.cxx diff --git a/configure.ac b/configure.ac index b46a9257e..b335018d3 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 000000000..6e995a204 --- /dev/null +++ b/src/Launcher/DummyBatchTest.cxx @@ -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 index 000000000..fb9222b59 --- /dev/null +++ b/src/Launcher/DummyLauncher.cxx @@ -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& filesToExport, + const vector& 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)."); +} diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 9cdd800a4..9e14cc361 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -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; diff --git a/src/Launcher/Launcher.hxx b/src/Launcher/Launcher.hxx index 33e7fd76c..279adbdc3 100644 --- a/src/Launcher/Launcher.hxx +++ b/src/Launcher/Launcher.hxx @@ -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; } diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index d3e94733e..235bda841 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -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 \ -- 2.39.2