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
Feature request: use_rcpp_armadillo() and use_rcpp_eigen() #421
Comments
usethis already has use_rcpp() to set up packages to use Rcpp. Similarly, it would be helpful to have use_rcpp_armadillo() and use_rcpp_eigen() to set up packages to use RcppArmadillo and RcppEigen (@alexpghayes requested this feature in issue r-lib#421). This commit adds both of these functions, as well as tests for them. use_rcpp_armadillo() ensures Rcpp and RcppArmadillo are in "LinkingTo" in the DESCRIPTION and that Rcpp is in "Imports", creates the src/ directory and an appropriate .gitignore, as use_rcpp() does, sets up the proper src/Makevars and src/Makevars.win files (respecting any existing content in those files), informs the user how to fix up their NAMESPACE file, and instructs them to run devtools::document(). Similarly, use_rcpp_eigen() ensures Rcpp and RcppEigen are in "LinkingTo" and "Imports" in the DESCRIPTION, creates the src/ directory and an appropriate .gitignore, as use_rcpp() does, informs the user how to fix up their NAMESPACE file, and instructs them to run devtools::document().
usethis already has use_rcpp() to set up packages to use Rcpp. Similarly, it would be helpful to have use_rcpp_armadillo() and use_rcpp_eigen() to set up packages to use RcppArmadillo and RcppEigen (@alexpghayes requested this feature in issue r-lib#421). This commit adds both of these functions, as well as tests for them. use_rcpp_armadillo() ensures Rcpp and RcppArmadillo are in "LinkingTo" in the DESCRIPTION and that Rcpp is in "Imports", creates the src/ directory and an appropriate .gitignore, as use_rcpp() does, sets up the proper src/Makevars and src/Makevars.win files (respecting any existing content in those files), informs the user how to fix up their NAMESPACE file, and instructs them to run devtools::document(). Similarly, use_rcpp_eigen() ensures Rcpp and RcppEigen are in "LinkingTo" and "Imports" in the DESCRIPTION, creates the src/ directory and an appropriate .gitignore, as use_rcpp() does, informs the user how to fix up their NAMESPACE file, and instructs them to run devtools::document().
I came to open an issue on this also. I went ahead and wrote up these functions (and tests for them), and I'm ready to open a pull request as soon as "someone from the team agrees" (the prerequisite given in |
@duckmayr usethis is "resting" right now but you should go ahead and make the PR. |
@jennybc Done, thanks! I think the commit message was clear and complete, but feel free to reach out with questions. When you come back to it, something to note is it looks like there was a snag on the AppVeyor build when I opened the PR: The tests I added for the new functions failed as the errors "'RcppArmadillo' must be installed before you can take a dependency on it." and "'RcppEigen' must be installed before you can take a dependency on it." were thrown from |
Yeah have a look around the tests for other ways to handle, such as:
|
* Add use_rcpp_armadillo() and use_rcpp_eigen(). (closes #421). Note: This is the second coming of PR #601 based on feedback from @jennybc. She requested the design pattern in #645 for testing a package without needing to add it to the Suggests field. This is important as RcppArmadillo has a hard dependency on R >= 3.2. * usethis itself doesn't need RcppEigen in Suggests * Style
RStudio provides package templates for packages that use
Rcpp
andRcppArmadillo
, but if you decide to useRcppArmadillo
mid-project it can be a bit tricky to remember what goes where. I useRcppArmadillo
infrequently and can never remember the setup that needs to happen. Having helpersuse_rcpp_armadillo
use_rcpp_eigen
would be incredibly convenient.
The text was updated successfully, but these errors were encountered: