Le 09/05/2013 12:43, Jeff Squyres (jsquyres) a écrit : > On May 8, 2013, at 4:16 PM, Brice Goglin <brice.gog...@inria.fr> wrote: > >> But this issue is only in the embedders (OMPI), not in the embeddee >> (hwloc), right? > Yes. > >> I can get plugins to work in tests/embedded by adding 2 lines to its >> configure.ac (see the attached patch, which also removes your error >> message and creates a shared lib containing libhwloc_embedded). >> >> In short, I don't really see what risk we would be taking on the hwloc >> side if we keep embedding+plugins possible (and still don't enable >> plugins by default). > Ok. It's probably worth documenting, though. In the OMPI case, for example, > OMPI cannot be opened in a private namespace (e.g., as a python plugin) and > then have hwloc also opened in a private namespace; hwloc must be opened in a > public namespace. This has caused unhappiness in certain cases where > upper-layer application authors were trying to open all plugins in private > namespaces but couldn't. The same will be true with hwloc: those who embed > hwloc should be *strongly advised* to not use libltdl (even though it's not > the default) because of the private/public namespace issue. >
Something like this? --- a/doc/hwloc.doxy +++ b/doc/hwloc.doxy @@ -2147,6 +2147,9 @@ is registered to the hwloc core. Components are then only enabled if the topology configuration requests it, as explained in the previous sections. +Also note that plugins should carefully be enabled and used when +embedding hwloc in another project, see \ref embed for details. + \section plugins_adding Adding new discovery components and plugins The types and functions cited below are declared in the hwloc/plugins.h header. @@ -2338,6 +2341,14 @@ you can directly integrate hwloc's m4 configure macro into your configure script. You can then invoke hwloc's configuration tests and build setup by calling an m4 macro (see below). +Although hwloc plugins may be used in embedded mode, the embedder +project will have to manually setup libltdl in its build system so +that hwloc can load its plugins. +Also, embedders should avoid using their own plugins and hwloc plugins +simultaneously because of possible issues with public and private +namespaces when using libltdl. +The embedder project is strongly advised not to use libltdl. + \section embedding_m4 Using hwloc's M4 Embedding Capabilities Every project is different, and there are many different ways of Brice