From cc7a51c17e666638d3d91cc9683489fd186ee428 Mon Sep 17 00:00:00 2001 From: secher Date: Wed, 4 Jun 2008 10:43:40 +0000 Subject: [PATCH] add --with-onlylauncher configure option to build kernel with only Batch, ResourceManager and Launcher --- Makefile.am | 6 +- configure.ac | 78 ++++++++++++++--------- resources/Makefile.am | 7 +- src/Batch/Batch_FactBatchManager.cxx | 4 +- src/Batch/Makefile.am | 17 +++-- src/Launcher/Makefile.am | 10 ++- src/Makefile.am | 8 ++- src/ResourcesManager/Makefile.am | 6 +- src/ResourcesManager/ResourcesManager.cxx | 4 +- src/ResourcesManager/ResourcesManager.hxx | 2 +- 10 files changed, 98 insertions(+), 44 deletions(-) diff --git a/Makefile.am b/Makefile.am index 63730a5e5..d3b87e52d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,11 @@ endif ACLOCAL_AMFLAGS = -I salome_adm/unix/config_files -SUBDIRS = $(IDLDIR) salome_adm src doc bin resources +if WITHONLYLAUNCHER + SUBDIRS = src resources +else + SUBDIRS = $(IDLDIR) salome_adm src doc bin resources +endif DIST_SUBDIRS= idl salome_adm src doc bin resources diff --git a/configure.ac b/configure.ac index e487aa532..96e62e718 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,12 @@ AC_ARG_ENABLE(corba_gen, esac],[corba_gen=true]) AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue) +# ---- option to build only launcher, resources manager and batch classes +AC_ARG_WITH(onlylauncher, + --with-onlylauncher, + WITHONLYLAUNCHER="yes",WITHONLYLAUNCHER="no") +AM_CONDITIONAL(WITHONLYLAUNCHER, test x$WITHONLYLAUNCHER = xyes) + # ---------------------------------------------------------------------------- echo @@ -172,6 +178,15 @@ dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON AM_PATH_PYTHON(2.3) CHECK_SWIG +echo +echo --------------------------------------------- +echo Testing libxml2 +echo --------------------------------------------- +echo + +CHECK_LIBXML + +if test x$WITHONLYLAUNCHER = xno; then echo echo --------------------------------------------- echo testing HDF5 @@ -236,18 +251,14 @@ echo CHECK_BOOST -echo -echo --------------------------------------------- -echo Testing libxml2 -echo --------------------------------------------- -echo - -CHECK_LIBXML - fi # --- end test corba # ---------------------------------------------------------------------------- +fi +# --- end test ONLYLAUNCHER +# ---------------------------------------------------------------------------- + echo echo ============================================================ echo testing parallel products @@ -408,10 +419,14 @@ function check_fatal_error { # -------------------------------------- -if test x$corba_gen = xtrue; then - basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok" +if test x$WITHONLYLAUNCHER = xno; then + if test x$corba_gen = xtrue; then + 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" + fi else - basic_mandatory_products="cc_ok threads_ok hdf5_ok" + basic_mandatory_products="cc_ok threads_ok libxml_ok" fi echo --- General mandatory products - Light configuration: @@ -419,19 +434,21 @@ summary $basic_mandatory_products check_fatal_error $basic_mandatory_products echo -corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok libxml_ok" -if test x$corba_gen = xtrue; then - echo --- CORBA mandatory products - default configuration: - summary $corba_mandatory_products - check_fatal_error $corba_mandatory_products -else - echo --- CORBA products not required - option --disable-corba-gen - if test x"$WITH_BATCH" = xyes; then - echo --- BATCH mode mandatory products - default configuration: - summary "python_ok" - check_fatal_error "python_ok" - else +if test x$WITHONLYLAUNCHER = xno; then + corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok" + if test x$corba_gen = xtrue; then + echo --- CORBA mandatory products - default configuration: + summary $corba_mandatory_products + check_fatal_error $corba_mandatory_products + else + echo --- CORBA products not required - option --disable-corba-gen + if test x"$WITH_BATCH" = xyes; then + echo --- BATCH mode mandatory products - default configuration: + summary "python_ok" + check_fatal_error "python_ok" + else echo --- Python not required - option --enable-batch=no + fi fi fi echo @@ -454,9 +471,11 @@ echo --- Html documentation products: only required for doc production summary $htmldoc_products echo +if test x$WITHONLYLAUNCHER = xno; then echo echo "Default ORB : $DEFAULT_ORB" echo +fi dnl generals files which could be included in every makefile @@ -475,6 +494,7 @@ else AC_SUBST(SETX) SETX="set -x" fi +if test x$WITHONLYLAUNCHER = xno; then echo echo --------------------------------------------- echo copying resource files, shell scripts, and @@ -497,17 +517,18 @@ do done cd $ROOT_BUILDDIR +AC_OUTPUT_COMMANDS([ \ + chmod +x ./bin/*; \ + chmod +x ./bin/salome/* \ +]) +fi + echo echo --------------------------------------------- echo generating Makefiles and configure files echo --------------------------------------------- echo -AC_OUTPUT_COMMANDS([ \ - chmod +x ./bin/*; \ - chmod +x ./bin/salome/* \ -]) - # This list is initiated using autoscan and must be updated manually # when adding a new file .in to manage. When you execute # autoscan, the Makefile list is generated in the output file configure.scan. @@ -588,4 +609,3 @@ AC_OUTPUT([ \ ./src/Utils/Makefile \ ./src/Utils/Test/Makefile \ ]) - diff --git a/resources/Makefile.am b/resources/Makefile.am index 687202153..76ad823d8 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -33,10 +33,15 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am DEPRECATED_FILES= -dist_salomeres_DATA=\ +if WITHONLYLAUNCHER + dist_salomeres_DATA=\ + CatalogResources.xml +else + dist_salomeres_DATA=\ CatalogResources.xml \ config \ channel.cfg \ KERNELCatalog.xml \ SALOMEDS_Resources \ $(DEPRECATED_FILES) +endif diff --git a/src/Batch/Batch_FactBatchManager.cxx b/src/Batch/Batch_FactBatchManager.cxx index 61d18fbd0..6667814a0 100644 --- a/src/Batch/Batch_FactBatchManager.cxx +++ b/src/Batch/Batch_FactBatchManager.cxx @@ -28,9 +28,9 @@ #include #include +#include #include "Batch_BatchManagerCatalog.hxx" #include "Batch_FactBatchManager.hxx" -#include "utilities.h" using namespace std; namespace Batch { @@ -41,7 +41,7 @@ namespace Batch { BatchManagerCatalog::addFactBatchManager(type.c_str(), this); ostringstream msg; msg << "FactBatchManager of type '" << type << "' inserted into catalog"; - MESSAGE(msg.str().c_str()); + cerr << msg.str().c_str() << endl; } // Destructeur diff --git a/src/Batch/Makefile.am b/src/Batch/Makefile.am index b936e299a..e00d64868 100644 --- a/src/Batch/Makefile.am +++ b/src/Batch/Makefile.am @@ -113,15 +113,20 @@ LIB_SRC = \ LIB_CPPFLAGS = \ - ${PYTHON_INCLUDES} \ + ${PYTHON_INCLUDES} +if !WITHONLYLAUNCHER + LIB_CPPFLAGS += \ -I$(srcdir)/../Basics \ -I$(srcdir)/../SALOMELocalTrace \ - -I$(top_builddir)/salome_adm/unix + -I$(top_builddir)/salome_adm/unix +endif -LIB_LIBADD = \ +LIB_LIBADD = +if !WITHONLYLAUNCHER + LIB_LIBADD += \ ../SALOMELocalTrace/libSALOMELocalTrace.la \ ../Basics/libSALOMEBasics.la - +endif # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -157,7 +162,9 @@ LIB_SRC +=\ Batch_Job_Local.cxx \ Batch_IOMutex.cxx -LIB_CPPFLAGS += -DHAVE_CONFIG_H +if !WITHONLYLAUNCHER + LIB_CPPFLAGS += -DHAVE_CONFIG_H +endif endif diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index bd61a22d8..2bc48a529 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -93,7 +93,11 @@ COMMON_LIBS =\ # Libraries targets # =============================================================== # -lib_LTLIBRARIES = libLauncher.la libSalomeLauncher.la +if WITHONLYLAUNCHER + lib_LTLIBRARIES = libLauncher.la +else + lib_LTLIBRARIES = libLauncher.la libSalomeLauncher.la +endif libSalomeLauncher_la_SOURCES=\ SALOME_Launcher.cxx @@ -131,7 +135,9 @@ libLauncher_la_LIBADD =\ # Executables targets # =============================================================== # -bin_PROGRAMS = SALOME_LauncherServer +if !WITHONLYLAUNCHER + bin_PROGRAMS = SALOME_LauncherServer +endif SALOME_LauncherServer_SOURCES =\ SALOME_LauncherServer.cxx diff --git a/src/Makefile.am b/src/Makefile.am index 82efa8787..681c55a3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -100,6 +100,10 @@ DIST_SUBDIRS = \ # check_cppunit for example with CPPUNIT_IS_OK. # +if WITHONLYLAUNCHER + SUBDIRS = Batch Batch_SWIG ResourcesManager Launcher +else + SUBDIRS = $(SUBDIR_BASE) if WITH_BATCH @@ -127,5 +131,7 @@ else endif endif if WITH_PACO_PARALLEL -SUBDIRS += $(SUBDIR_PARALLEL) + SUBDIRS += $(SUBDIR_PARALLEL) endif + +endif \ No newline at end of file diff --git a/src/ResourcesManager/Makefile.am b/src/ResourcesManager/Makefile.am index 94db53c20..ea5695722 100755 --- a/src/ResourcesManager/Makefile.am +++ b/src/ResourcesManager/Makefile.am @@ -71,7 +71,11 @@ COMMON_LIBS =\ # Libraries targets # =============================================================== # -lib_LTLIBRARIES = libResourcesManager.la libSalomeResourcesManager.la +if WITHONLYLAUNCHER + lib_LTLIBRARIES = libResourcesManager.la +else + lib_LTLIBRARIES = libResourcesManager.la libSalomeResourcesManager.la +endif libSalomeResourcesManager_la_SOURCES =\ SALOME_ResourcesManager.cxx diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index b5226b18e..ef28d7597 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -58,10 +58,12 @@ ResourcesManager_cpp(const char *xmlFilePath) : */ //============================================================================= -ResourcesManager_cpp::ResourcesManager_cpp() +ResourcesManager_cpp::ResourcesManager_cpp() throw(ResourcesException) { cerr << "ResourcesManager_cpp constructor" << endl; _isAppliSalomeDefined = (getenv("APPLI") != 0); + if(!getenv("KERNEL_ROOT_DIR")) + throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!!"); if (_isAppliSalomeDefined) { diff --git a/src/ResourcesManager/ResourcesManager.hxx b/src/ResourcesManager/ResourcesManager.hxx index 2396540a3..d1f47e3b3 100644 --- a/src/ResourcesManager/ResourcesManager.hxx +++ b/src/ResourcesManager/ResourcesManager.hxx @@ -56,7 +56,7 @@ class ResourcesManager_cpp public: ResourcesManager_cpp(const char *xmlFilePath); - ResourcesManager_cpp(); + ResourcesManager_cpp() throw(ResourcesException); ~ResourcesManager_cpp(); -- 2.39.2