Skip to content

Autogeneration Warning for RcppExports.* #526

Description

@coatless

As shown in Rcpp function with no argument on StackOverflow, there may need to be some slight changes associated with:

  1. Code generation headers in RcppExports.cpp and RcppExports.R
  2. Documentation surrounding Rcpp.package.skeleton() and compileAttributes()

The current headers:

RcppExports.R

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

RcppExports.cpp

// This file was generated by Rcpp::compileAttributes
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

The proposed new headers:

RcppExports.R

# Generated by using Rcpp::compileAttributes() - do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

RcppExports.cpp

// Generated by using Rcpp::compileAttributes() - do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

Mimics the descriptor used by roxygen2:

% Generated by roxygen2: do not edit by hand

Documentation Changes

Rcpp.package.skeleton()

Modify the details section to emphasize autocreation and not to modify by hand

Current:

If the attributes argument is TRUE, then rather than generate the example files as described above, a single rcpp_hello_world.cpp file is created in the src directory and it's attributes are compiled using the compileAttributes function, so files RcppExports.R and RcppExports.cpp are generated as well.

Proposed:

If the attributes argument is TRUE, then rather than generate the example files as described above, a single rcpp_hello_world.cpp file is created in the src directory and it's attributes are compiled using the compileAttributes function. This leads to the files RcppExports.R and RcppExports.cpp being generated. They are automatically regenerated from \emph{scratch} each time compileAttributes is called. Therefore, one should not modify by hand either RcppExports file.

compileAttributes

Current

For C++ functions adorned with the Rcpp::export attribute, the C++ and R source code required to bind to the function from R is generated and added (respectively) to src/RcppExports.cpp or R/RcppExports.R.

Proposed:

For C++ functions adorned with the Rcpp::export attribute, the C++ and R source code required to bind to the function from R is generated and added (respectively) to src/RcppExports.cpp or R/RcppExports.R. Both of these files are automatically generated from \emph{scratch} each time compiledAttributes is run.

Tagging as a part of #506

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions