Seal Plugins in SCRAM based CMS Projects

Complete: 4

NOTE: As of software release CMSSW_1_5_0 CMS no longer uses the SEAL plugin system.

Overview

SEAL modules/plugins are shared libraries with a special entry point through which the module properties are advertised. They are registered to a location known to the plug-in manager to make them available at run-time. One can find more information about SealPlugins in the WorkBook chapter SWGuideDeclarePlugins.

How to make a shared library seal plugin

The creation of seal plugins in SCRAM based CMS projects (e.g. CMSSW, IGUANA etc.) is done by
  • Adding seal plugin macros (e.g. DEFINE_SEAL_MODULE , DEFINE_SEAL_PLUGIN, DEFINE_ANOTHER_FWK_MODULE etc.) in one of the subsystem/package/src/*.cc file. Common practice is to add these macros in SealModule.cc or plugin.cc file)
  • Setting SEAL_PLUGIN_NAME=PluginName OR SEALPLUGIN=1 flag in the subsystem/package/CMS.BuildFile

IMPORTANT. If none of your *.cc files has DEFINE_SEAL_MODULE , DEFINE_SEAL_PLUGIN OR DEFINE_ANOTHER_FWK_MODULE etc. macros defined then please make sure that there is no SEAL_PLUGIN_NAME=PluginName OR SEALPLUGIN=1 flag in the subsystem/package/CMS.BuildFile.

Problem with this scheme is that as one can only build a single library out of subsystem/package/src directory which mean all the plugins, one wants to create, will be in this library. Loading of single plugin means loading of all other unwanted plugins too.

To provide the support of generating multiple plugins from a single package, a new directory subsystem/package/plugins is introduced in CMSSW (only available in nightly builds, CMSSW_1_3_0_pre1 and above). From this directory one can create multiple libraries each containing one or more plugins. By default all the libraries generated out of this are SealPlugins (unless explicitly mentioned in subsystem/package/plugins/CMS.BuildFile). e.g. one can have

    <use name=FWCore/Framework>
    <library name=XPlugin file=XPlugin.cc></library>
    <library name=YPlugin file="YPlugin1.cc YPlugin2.cc YPlugin3.cc">
      <lib name=CommonXY>
    </library>
    <library name=ZPlugin file=ZPlugin*.cc>
      <lib name=CommonXY>
    </library>
    <library name=CommonYZ file=CommonYZ.cc>
      <use name=tool_a>
      <use name=tool_b>
      <Flags SEALPLUGIN=0>
    </library>

where all the *Plugin.cc files should have all the required macros in them (e.g. DEFINE_SEAL_MODULE , DEFINE_ANOTHER_FWK_MODULE, DEFINE_SEAL_PLUGIN etc.). All the libraries, generated above, are by default SealPlugins (no need to say <Flags SEAL_PLUGIN_NAME=XPlugin> OR <Flags SEALPLUGIN=1>). One can create non-plugin libraries too out of this area by explicitly adding the <Flags SEALPLUGIN=0> flag for that specific library (e.g. CommonXY is not a SealPlugin library in the above BuildFile).

One can also generate executables from this area by adding something like

<bin name=testXPlugin file=testXPlugin.cpp></bin>

NOTE: This does not mean that now one can not generate seal plugins out of src/test/bin directories. The old scheme works as it is. The new scheme just allows you to generate more than one SealPlugin from a package directory.
NOTE: This new functionality is only available for CMSSW nightly builds, CMSSW_1_3_0_preX and above.

Review Status

Editor/reviewer and date Comments
Main.muzaffar - 19 Dec 2006 Page author
NicolaAmapane - 18 Jan 2007 page content last edited
JennyWilliams - 21 Feb 2007 page edited to fit in with swguide

Responsible: Main.muzaffar
Last reviewed by: MostRecentReviewer

Edit | Attach | Watch | Print version | History: r19 < r18 < r17 < r16 < r15 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r19 - 2009-11-25 - KatiLassilaPerini



 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback