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

Comments

Projects
None yet
3 participants
@mbertolacci

mbertolacci commented Jun 1, 2017

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 from Name attribute no longer working to Name attribute in RcppExports no longer works Jun 1, 2017

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel Jun 1, 2017

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.

Member

eddelbuettel commented Jun 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@jjallaire

jjallaire Jun 1, 2017

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.

Member

jjallaire commented Jun 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel Jun 1, 2017

Member

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

Member

eddelbuettel commented Jun 1, 2017

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

Merge pull request #703 from RcppCore/bugfix/rcpp-export-name-registr…
…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