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

Invalid registration code for packages with dot in name #721

Closed
krlmlr opened this issue Jun 28, 2017 · 3 comments
Closed

Invalid registration code for packages with dot in name #721

krlmlr opened this issue Jun 28, 2017 · 3 comments

Comments

@krlmlr
Copy link
Contributor

krlmlr commented Jun 28, 2017

Example: ropensci-archive/tic.drat@1370bec#diff-cccf79352b3795dd56362ef855dd939bR23

The generated code reads (comments mine):

static const R_CallMethodDef CallEntries[] = {
    {"tic.drat_divide", (DL_FUNC) &tic.drat_divide, 2}, // remove this
    {"tic_drat_divide", (DL_FUNC) &tic_drat_divide, 2},
    {NULL, NULL, 0}
};

RcppExport void R_init_tic.drat(DllInfo *dll) { // use underscore instead of dot
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}

The exported function can be called when I register manually (but compileAttributes() still insists on adding its own code): ropensci-archive/tic.drat@7b0bdb3

This is with the latest Rcpp 5ca4f6a.

@jjallaire
Copy link
Member

Good catch! I think we need to substitute underscore for dot as you said. I'll fix this ASAP.

jjallaire added a commit that referenced this issue Jun 29, 2017
…ation

Replace dot (".") with underscore ("_") in package names when generating native routine registrations (fixes #721)
@krlmlr
Copy link
Contributor Author

krlmlr commented Jun 29, 2017

Thanks @jjallaire for the quick fix! Works as advertised: ropensci-archive/tic.drat@aff657e.

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