1

I have been building an r-package that runs RcppParallel and calls nloptr from the cpp in parallel. Currently, the package will not build as it can't find the 'nloptrAPI.h' file.

The build log outputs: * checking dependencies in R code ... NOTE Namespaces in Imports field not imported from: ‘RcppArmadillo’ ‘nloptr’

My question is if there is a simple fix for this. Or if I would have to rewrite the function to call 'nlopt' from the cpp version and add a 'makevars' file to the package.

The src only contains my written functions and the generated RcppExports.

skatz
  • 115
  • 7
  • 2
    I think you need to show us your package structure. – Qiang Kou Jul 12 '18 at 13:46
  • Do you have something like `LinkingTo: nloptr (>1.1.0)` in your `DESCRIPTION`? – Ralf Stubner Jul 12 '18 at 19:28
  • Within the description I; Imports: nloptr ( >= 1.1.9) and LinkingTo: nloptr – skatz Jul 12 '18 at 21:23
  • There is quite a bit of discussion in an issue ticket of the nloptr repo; I also believe you need the github version supports the header file interface whereas the CRAN version may not. – Dirk Eddelbuettel Jul 13 '18 at 03:26
  • Thanks, Dirk. The GitHub version solved this problem quickly and easily. As I am thinking about publishing my work, I thought I should ask about using the GitHub 'nloptr' over the 'nlopt cpp'. – skatz Jul 13 '18 at 08:48

0 Answers0