Discussion:
[Rcpp-devel] Warning when using modules
Hmamouche Youssef
2017-10-30 21:12:39 UTC
Permalink
Hi,

In a Rcpp package with the use of modules to convert c++ class,
i get the following warning when I tested the module:

Found more than one class "Rcpp-moduleName" in cache; using the first, from
namespace 'packageName'.

To loadmodule, i use the following way in the module.R file:

- loadModule('moduleName', TRUE)

- Module ('moduleName', PACKAGE = "packageName").

Is it possible to hide this warning ?

Thanks,

Youssef
Dirk Eddelbuettel
2017-10-30 21:52:27 UTC
Permalink
On 30 October 2017 at 22:12, Hmamouche Youssef wrote:
| Hi,
|
| In a Rcpp package with the use of modules to convert c++ class,
| i get the following warning when I tested the module:
|
| Found more than one class "Rcpp-moduleName" in cache; using the first, from
| namespace 'packageName'.
|
| To loadmodule, i use the following way in the module.R file:
|
| - loadModule('moduleName', TRUE)
|
| - Module ('moduleName', PACKAGE = "packageName").
|
| Is it possible to hide this warning ?

You probably want to fix your code. You likely have more than one Module
defined as Rcpp-moduleName. As the lookup is by name, this is probably not
what you want.

Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Hmamouche Youssef
2017-10-30 22:56:06 UTC
Permalink
Yes, i have more than one module, but each one is defined with different
name.
Post by Dirk Eddelbuettel
| Hi,
|
| In a Rcpp package with the use of modules to convert c++ class,
|
| Found more than one class "Rcpp-moduleName" in cache; using the first, from
| namespace 'packageName'.
|
|
| - loadModule('moduleName', TRUE)
|
| - Module ('moduleName', PACKAGE = "packageName").
|
| Is it possible to hide this warning ?
You probably want to fix your code. You likely have more than one Module
defined as Rcpp-moduleName. As the lookup is by name, this is probably not
what you want.
Dirk
--
Hmamouche Youssef
2017-10-31 16:34:36 UTC
Permalink
Well, i tried one module exposing one class. But the problem still the
same. I don't think this is about fixing code, because the problem is
resolved when i changed the way of loading the module:

*moduleName <- Module( "moduleName" )*
*.onLoad <- function(libname, pkgname) {}*

Instead of *loadModule ("moduleName", TRUE)*. So the loadModule () function
that causes this warning.
Post by Hmamouche Youssef
Yes, i have more than one module, but each one is defined with different
name.
Post by Dirk Eddelbuettel
| Hi,
|
| In a Rcpp package with the use of modules to convert c++ class,
|
| Found more than one class "Rcpp-moduleName" in cache; using the first, from
| namespace 'packageName'.
|
|
| - loadModule('moduleName', TRUE)
|
| - Module ('moduleName', PACKAGE = "packageName").
|
| Is it possible to hide this warning ?
You probably want to fix your code. You likely have more than one Module
defined as Rcpp-moduleName. As the lookup is by name, this is probably not
what you want.
Dirk
--
Dirk Eddelbuettel
2017-10-31 16:53:24 UTC
Permalink
On 31 October 2017 at 17:34, Hmamouche Youssef wrote:
| Well, i tried one module exposing one class. But the problem still the
| same. I don't think this is about fixing code, because the problem is
| resolved when i changed the way of loading the module:
|
| *moduleName <- Module( "moduleName" )*
| *.onLoad <- function(libname, pkgname) {}*
|
| Instead of *loadModule ("moduleName", TRUE)*. So the loadModule () function
| that causes this warning.

You are making it difficult for us to help you as we have no idea about your
code. You have one advantage: you can look at our working packages.

Take RcppAnnoy. It has one templated class, instantiating three different
Rcpp Modules objects, which are then loaded via

## ensure module gets loaded
loadModule("AnnoyAngular", TRUE)
loadModule("AnnoyEuclidean", TRUE)
loadModule("AnnoyManhattan", TRUE)

The one C++ is pretty simple too: it has no repeated symbol, class, module,
or whatever names and loads.

Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Continue reading on narkive:
Loading...