0

I am a beginner of Rcpp. I encountered many difficulties in creating an R package(BSMHM2) for the Rcpp function. Before giving the error information, I quickly introduced what I have down as below.

I wrote several functions with .cpp file (like f_Bbeta.cpp, f_order.cpp and f_mmult.cpp). These functions were used in the main function (mcmc.cpp) and I put them all in \src. Specifically, in f_order.cpp, f_mvnorm and f_wishart, I included the RcppArmadillo.h while RcppEigen.h was included in f_mmult.cpp. Some cpp files, such as f_beta.cpp, will call the function f_mmult and f_mvnorm.

When I use R CMD check BSMHM2, it seems that I have two types of error. The first was like this form:

g++ -m32 -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I"C:/Program Files/R/R-3.2.2/library/Rcpp/include" -I"C:/Program Files/R/R-3.2.2/library/RcppArmadillo/include" -I"C:/Program Files/R/R-3.2.2/library/RcppEigen/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c f_Bbeta.cpp -o f_Bbeta.o

Another type of error was like f_wishart.o:f_wishart.cpp:(.text+0xc93): undefined reference to `dpotrf_'

It will be so grateful if any experts in Rcpp could help to solve this problem. Thank you!

Kai Kang
  • 1
  • 1
  • Please provide problem summery not whole console log here. – CodeChanger Jun 15 '17 at 06:51
  • Thanks for your suggestion. I have modified the question. – Kai Kang Jun 15 '17 at 08:06
  • Mixing `Armadillo` and `Eigen` is perfectly fine as long as each routine use the appropriate library specific function. I think something isn't setup correctly as `DPOTRF` is part of `LAPACK`. Where is the `BSMHM2` codebase? GitHub? – coatless Jun 15 '17 at 14:41
  • There are several existence proofs on CRAN using both packages. – Dirk Eddelbuettel Jun 15 '17 at 16:55
  • Facing a similar question, I searched CRAN for an example - e.g. the `nlmixr` package suggests both RcppArmadillo and RcppEigen: https://cran.r-project.org/web/packages/nlmixr/index.html – A.Fischer Mar 12 '22 at 12:52

0 Answers0