Re: [R-pkg-devel] R package does not find DLL routine

2020-07-01 Thread Lisa GM
Dear Dirk, dear Ivan, thanks for your suggestions. I agree that R packages aren't meant to be build that way, and even though this is an academic project but since the source code wasn't written by me it is not my decision if, where and when to publish it openly. In any case, directly linking to a

Re: [R-pkg-devel] R package does not find DLL routine

2020-06-28 Thread Ivan Krylov
On Sun, 28 Jun 2020 12:43:53 +0200 Lisa GM wrote: > "sum_c" not resolved from current namespace (sum) As mentioned by Dirk Eddelbuettel, this is not the way R packages are supposed to be built [*], but if you are absolutely positive you cannot build the DLL from source together with the package

Re: [R-pkg-devel] R package does not find DLL routine

2020-06-28 Thread Dirk Eddelbuettel
Hi Lisa, On 28 June 2020 at 20:32, Lisa GM wrote: | Thank you so much for your quick reply. I'm not particularly set on the | 'inline' package especially if it's becoming outdated. I looked into using Please report bugs or shortcomings in an issue ticket at GitHub. I am also its maintainer and

Re: [R-pkg-devel] R package does not find DLL routine

2020-06-28 Thread Lisa GM
Dear Dirk, Thank you so much for your quick reply. I'm not particularly set on the 'inline' package especially if it's becoming outdated. I looked into using Rcpp but I couldn't figure out how to compile my c++ code outside of the package and only include the DLL. My problem is that I cannot publi

Re: [R-pkg-devel] R package does not find DLL routine

2020-06-28 Thread Dirk Eddelbuettel
Lisa, Sorry, I misread your code. There is a possible array overrun, so we need argument n and p, apparently. A likely better version, and demo running the right code are below. The rest of the reasoning likely stands, methinks. Code ---

Re: [R-pkg-devel] R package does not find DLL routine

2020-06-28 Thread Dirk Eddelbuettel
Lisa, One can do what you do, but it is fraught with some difficulties (as you experienced) and even more so once you try to do this portably. Helper packages exists: the `inline` package is the oldest of this class and still supports the .C() interface you used here. And which for a few years n

[R-pkg-devel] R package does not find DLL routine

2020-06-28 Thread Lisa GM
Hi, I would like to create an R package that calls a DLL (in my case a .dylib) which is already compiled. If I load and then call the DLL in a regular .R file it works fine but when I try to add the DLL to the package it doesn't work anymore. I'm using devtools and roxygen2 to update and compile t