[Rcpp-devel] failed to compile code on the server with simple operations on matrices with type fmat {RcppArmadillo}

Dirk Eddelbuettel edd at debian.org
Wed Jun 3 12:37:47 CEST 2015


On 2 June 2015 at 23:11, Yue Li wrote:
| Dear List,
| 
| I’m having an issue with compiling Rcpp code using ‘fmat’ matrix type on the
| server ( Linux distro:
| CentOS release 5.11 (Final)) and wondering if someone has a quick fix.
| 
| Basically, the following code works fine on my Macbook (R 3.2) but not on the
| server (Run/sessionInfo pasted).
| 
| Any help would be greatly appreciated!
| 
| Many thanks,
| Yue
| 
| 
| Code (test_fmat.cpp):
| // -*- 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, BH, bigmemory)]]
| 
| 
| using namespace Rcpp;
| using namespace arma;
| 
| // [[Rcpp::export]]
| fmat fmatMultiply(fmat x, fmat y)

fmat makes no sense __in the interface to R__ as R only has doubles, not floats.

We told you that once before (in the bigMemory thread).

| {
|         fmat ans = x * y;
| 
|             
| 
|         return ans;
| }
| 
| 
| 
| In R:
| > sourceCpp('test_fmat.cpp')
| Error in dyn.load("/tmp/RtmpGGitfL/sourcecpp_20827ca6cab1/sourceCpp_99301.so")
| : 
|   unable to load shared object '/tmp/RtmpGGitfL/sourcecpp_20827ca6cab1/
| sourceCpp_99301.so':
|   /tmp/RtmpGGitfL/sourcecpp_20827ca6cab1/sourceCpp_99301.so: undefined symbol:
| sgemm_

We do not know how this R on CentOS was built but as R does not use single
precsions and does provide multiplication for it, you were not expected to
get this to work anyway.  It may be that R on CentOS uses R's internal
Rlapack (without sgemm for the reason given) whereas on the Mac you got lucky
with an external LAPACK.

In any event, the error is yours.

Dirk


| > sessionInfo()
| R version 3.1.0 (2014-04-10)
| Platform: x86_64-unknown-linux-gnu (64-bit)
| 
| locale:
| [1] C
| 
| attached base packages:
| [1] stats     graphics  grDevices utils     datasets  methods   base     
| 
| other attached packages:
| [1] Rcpp_0.11.3
| 
| loaded via a namespace (and not attached):
| [1] BH_1.54.0-4               RcppArmadillo_0.4.450.1.0
| [3] bigmemory_4.5.1           bigmemory.sri_0.1.3      
| [5] tools_3.1.0              
| > 
| 
| 
| 
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list