You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to wrap the optim library of @kthor in R via an R package using Rcpp/RcppArmadillo. Indeed, optim relies on armadillo itself.
To do that, I put the headers of optim into inst/include/ and the cpp files into src/. Then I tried to link everything in the src/Makevars files, and the package installation (including compilation of optim) is fine (at least, the package can be installed). The Makevars can be found there :
However, when I call the corresponding R functions, I get the following Armadillo errors in R which I do not have wheh running them in 'pure' C++ (I am pretty sure it is not a syntax problem, the Rcpp code and the original C++ code are hopefully identical, except for the headers).
If someone with experience in writing R packages including external librarieis can at least check that the flags and libs in the Makevars are correctly set for optim/armadillo requirements, it would help a lot.
Thanks for your time
The text was updated successfully, but these errors were encountered:
I am trying to wrap the optim library of @kthor in R via an R package using Rcpp/RcppArmadillo. Indeed, optim relies on armadillo itself.
To do that, I put the headers of optim into inst/include/ and the cpp files into src/. Then I tried to link everything in the src/Makevars files, and the package installation (including compilation of optim) is fine (at least, the package can be installed). The Makevars can be found there :
https://github.com/jchiquet/optimLibR/blob/414015b08a5e316de17b1e0b5385718abd23da6a/src/Makevars#L1-L41
Then I tried to create two small Rcpp functions for two examples available in the original optim library, starting with the following lines
However, when I call the corresponding R functions, I get the following Armadillo errors in R which I do not have wheh running them in 'pure' C++ (I am pretty sure it is not a syntax problem, the Rcpp code and the original C++ code are hopefully identical, except for the headers).
If someone with experience in writing R packages including external librarieis can at least check that the flags and libs in the Makevars are correctly set for optim/armadillo requirements, it would help a lot.
Thanks for your time
The text was updated successfully, but these errors were encountered: