[R-pkg-devel] DESCRIPTION file question
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Sun Jul 23 00:22:20 CEST 2023
On 22 July 2023 at 16:07, Dirk Eddelbuettel wrote:
|
| Taylor,
|
| I believe we have been over this at StackOverflow but you may by now have
| deleted the question/
|
| On 21 July 2023 at 20:51, taylor brown via R-package-devel wrote:
| | I have a question about the DESCRIPTION file of an R package that has some c++ dependencies.
| |
| | This package of mine builds c++ code during an interactive R session, but
| | does not contain any source c++ in itself. The c++ files make reference to
| | some dependencies that are made available by other third party R packages.
| |
| | LinkingTo is the appropriate field for the DESCRIPTION file (usually) here, not Imports, but if If I remove the dependencies (BH and RcppEigen) from the Imports field, the code examples in the vignette will fail to build on a fresh machine.
| |
| | The NOTES in my build mention that, because I have no src/ directory, LinkingTo is ignored. Simultaneously, there is another note that mentions Imports is also excessive.
|
| As your package has no src/ directory and does no compilation itself, you do
| not need / have no use for LinkingTo to provide the include/ directory of one
| or more listed packages.
|
| (If you have offer that compilation ability in a helper function you need to
| tell the deal with it in the function. You can use `requireNamespace()` to
| check if a package is present, warn or error if not, and compute the include/
| directory location using R helper functions such as system.file().)
|
| | It’s kind of a catch 22. It feels like my options are either add the Imports lines and ignore the NOTE, or add a superfluous src/ directory to silence the NOTE. Which option is the preferred one? Or is there a third?
|
| I think all you need is in Writing R Extensions. For us to help you more a
| concrete example, maybe even from a mock package, would help.
PS An existing example is provided by the 'inline' package, originally by
Oleg Sklyar, extented by many, and maintained by me for some time. It lets
you work on code in C, C++, Fortran, ... and it compiles, links and loads it
for you from an R session just you seem to desire.
And 'inline' has no LinkingTo and only one Imports for 'methods' as it uses
some S4.
Hth, Dirk
--
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
More information about the R-package-devel
mailing list