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

Comments

Projects
None yet
3 participants
@krlmlr
Contributor

krlmlr commented Jun 28, 2017

Example: krlmlr/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): krlmlr/tic.drat@7b0bdb3

This is with the latest Rcpp 5ca4f6a.

@jjallaire

This comment has been minimized.

Show comment
Hide comment
@jjallaire

jjallaire Jun 28, 2017

Member

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

Member

jjallaire commented Jun 28, 2017

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

@jjallaire jjallaire closed this in c505d2f Jun 29, 2017

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

Merge pull request #722 from RcppCore/bugfix/dot-package-name-registr…
…ation

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

This comment has been minimized.

Show comment
Hide comment
@krlmlr

krlmlr Jun 29, 2017

Contributor

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

Contributor

krlmlr commented Jun 29, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment