Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name attribute in RcppExports no longer works #702

Closed
mbertolacci opened this issue Jun 1, 2017 · 3 comments
Closed

Name attribute in RcppExports no longer works #702

mbertolacci opened this issue Jun 1, 2017 · 3 comments

Comments

@mbertolacci
Copy link

I updated Rcpp to version 0.12.11 from 0.12.10 and suddenly exported functions with name="" attributes no longer work.

This appears to be due to the CallEntries in RcppExport.cpp using the incorrect name to derive a function pointer.

Example exported code:

// [[Rcpp::export(name=".stick_breaking_mixture")]]
Rcpp::List stickBreakingMixture(
    unsigned int nLoop,
    unsigned int nWarmUp,
    //...

RcppExport wrapper:

// stickBreakingMixture
Rcpp::List stickBreakingMixture(unsigned int nLoop, unsigned int nWarmUp, ...);
RcppExport SEXP BayesSpec_stickBreakingMixture(SEXP nLoopSEXP, SEXP nWarmUpSEXP, ...) {

Corresponding CallEntries entry:

    {"BayesSpec_.stick_breaking_mixture", (DL_FUNC) &BayesSpec_.stick_breaking_mixture, 9},

I think this function pointer should be &BayesSpec_stickBreakingMixture

Note that I have checked and this is not due simply to the use of '.' in the exported name.

@eddelbuettel eddelbuettel changed the title Name attribute no longer working Name attribute in RcppExports no longer works Jun 1, 2017
@eddelbuettel
Copy link
Member

Possible. @jjallaire Any quick idea which regexps to tune?

In the meantime consider the fallback of calling tools::package_native_routine_registration_skeleton(".") to create your own src/init.c.

@jjallaire
Copy link
Member

Bummed that this one snuck through. At least anyone who runs into this will get a local compilation error (rather than "silently" incorrect code) so has a chance to fix before submitting to CRAN. Just submitted a PR with the fix.

@eddelbuettel
Copy link
Member

I could as a convenience roll up 0.12.11.1 for the rcpp drat repo.

eddelbuettel added a commit that referenced this issue Jun 1, 2017
…ation

Fix native registration for exports with name attribute (fixes #702)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants