'How should you package non-R library dependencies?
I am writing an R package which requires a binary file that I have wrapped for use with R code (using system2). To work, the binary file requires a .dylib dependency to be put into /Library/Audio/ on Mac. Once this is in place, the binary can be called anywhere on the system (e.g., via my wrapping of it in R from a package) and will produce the desired result.
How can I solve the (simpler) problem of packaging the .dylib dependency with my package to work on a Mac? If I include it alongside the binary in /bin, calling the command to the binary via system2 does not work, unless the binary in /Library/Audio. So on the user installing my R package, do I have to move the .dylib dependency to that location on the user's system? This seems dangerous, so is there another, better way of doing it?
More broadly (and probably more difficult), is there a way of achieving this to work on other common systems (e.g., Windows) too?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|