Discussion:
[Rcpp-devel] RcppArmadillo Mat_meat.hpp:4467 and arma_static_check.hpp:31 errors
Patrick Veenstra
2017-07-24 18:09:07 UTC
Permalink
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!
Patrick Veenstra
2017-07-24 18:13:21 UTC
Permalink
Correction, Armadillo version: 7.900.2
Post by Patrick Veenstra
When attempting to compile a cpp function that uses RcppArmadillo (in
RStudio), I get the following two errors from files provided by
Error 1: In ~/RLibs/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp
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
size of array is negative and uninitialized const 'junk'
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
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!
Dirk Eddelbuettel
2017-07-24 22:40:02 UTC
Permalink
Please provide a minimal yet reproducible example.

Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Patrick Veenstra
2017-07-25 11:56:38 UTC
Permalink
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
Post by Dirk Eddelbuettel
Please provide a minimal yet reproducible example.
Dirk
--
Dirk Eddelbuettel
2017-07-25 12:29:00 UTC
Permalink
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 | ***@debian.org
Loading...