When attempting to compile a cpp function that uses RcppArmadillo (in
RStudio), I get the following two errors from files provided by
RcppArmadillo:
Error 1: In ~/RLibs/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp line
4467:
no matching function for call to ?arma::Gen<arma::Mat<double>,
arma::gen_zeros>::apply(arma::Mat<unsigned int>&) const?
Error 2: in
~/RLibs/RcppArmadillo/include/armadillo_bits/arma_static_check.hpp line 31:
size of array is negative and uninitialized const 'junk'
Environment details:
Platform: Linux fedora core 22, 4.0.6-300.fc22.x86_64
Armadillo version: 6.700.6
R: 3.3.0
RStudio: 1.0.143
NAMESPACE Contents:
exportPattern("^[[:alpha:]]+")
importFrom(Rcpp, evalCpp)
useDynLib(ThisPackage)
DESCRIPTION links to both Rcpp and RcppArmadillo
Any idea on how I could go about solving this?
Many thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170724/eb47bd00/attachment.html>
[Rcpp-devel] RcppArmadillo Mat_meat.hpp:4467 and arma_static_check.hpp:31 errors
5 messages · Patrick Veenstra, Dirk Eddelbuettel
Correction, Armadillo version: 7.900.2
On 24 July 2017 at 19:09, Patrick Veenstra <patrick at pveenstra.com> wrote:
When attempting to compile a cpp function that uses RcppArmadillo (in
RStudio), I get the following two errors from files provided by
RcppArmadillo:
Error 1: In ~/RLibs/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp
line 4467:
no matching function for call to ?arma::Gen<arma::Mat<double>,
arma::gen_zeros>::apply(arma::Mat<unsigned int>&) const?
Error 2: in ~/RLibs/RcppArmadillo/include/armadillo_bits/arma_static_check.hpp
line 31:
size of array is negative and uninitialized const 'junk'
Environment details:
Platform: Linux fedora core 22, 4.0.6-300.fc22.x86_64
Armadillo version: 6.700.6
R: 3.3.0
RStudio: 1.0.143
NAMESPACE Contents:
exportPattern("^[[:alpha:]]+")
importFrom(Rcpp, evalCpp)
useDynLib(ThisPackage)
DESCRIPTION links to both Rcpp and RcppArmadillo
Any idea on how I could go about solving this?
Many thanks!
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170724/eb8fc295/attachment.html>
Please provide a minimal yet reproducible example. Dirk
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
My apologies! I mistook what the code in those files were for. It seemed to be completely separate from my code. So I thought it was something about my environment. But in the process of setting up a reproducible example, I found that actually it was something in my own code. An accidental assignment of zeros<mat>(x,y) to a umat. Odd that this error came through in those files rather than directly in my cpp file. Anyway, lesson learnt! Don't assume anything! Thanks
On 24 July 2017 at 23:40, Dirk Eddelbuettel <edd at debian.org> wrote:
Please provide a minimal yet reproducible example. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170725/d44e7ef7/attachment.html>
On 25 July 2017 at 12:56, Patrick Veenstra wrote:
| My apologies! I mistook what the code in those files were for. It seemed to | be completely separate from my code. So I thought it was something about my | environment. But in the process of setting up a reproducible example, I | found that actually it was something in my own code. An accidental | assignment of zeros<mat>(x,y) to a umat. Odd that this error came through | in those files rather than directly in my cpp file. Anyway, lesson learnt! | Don't assume anything! Yes, been there, done that -- that is one of many reasons why creating a reproducible example is a good exercise. I too had numerous report dispappear that way before sending :) Dirk
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org