It also works for me on Linux: R> sourceCpp("/tmp/yueli.cpp")
R> set.seed(42) R> x <- matrix(rnorm(4),2,2) R> y <- matrix(rnorm(4),2,2) R> fmatMultiply(x, y) [,1] [,2] [1,] 0.515698 2.03786 [2,] -0.295452 -0.91346 R> so I strongly suspect that what I just stated is true: it works if R uses an external (complete) LAPACK; it fails when R internal's LAPACK is used as sgemm is of no interest to R. Use mat instead of fmat, or if you insist, rebuild R on the server. Dirk PS My version of your file below // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- // we only include RcppArmadillo.h which pulls Rcpp.h in for us #include <RcppArmadillo.h> // [[Rcpp::depends(RcppArmadillo)]] using namespace Rcpp; using namespace arma; // [[Rcpp::export]] fmat fmatMultiply(fmat x, fmat y) { fmat ans = x * y; return ans; } /*** R set.seed(42) x <- matrix(rnorm(4),2,2) y <- matrix(rnorm(4),2,2) fmatMultiply(x, y) */ -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel