[Rcpp-devel] Using Goto blas in Mac OS

Anirban Mukherjee anirban.mukherjee at gmail.com
Mon Nov 1 03:23:15 CET 2010


Hi folks,

I bumped into the Google techtalk video on Friday and have been playing
around with Rcpp and RcppArmadillo over the weekend. Looks excellent! Thanks
for all the work.

When using RcppArmadillo with VecLib, things work as expected. If I change
the BLAS to Goto using the link libRBlas.dylib then I get

> fx <- cxxfunction( signature(x = "integer", y = "numeric" ) , '
+ int dim = as<int>( x ) ;
+ arma::mat z = as<double>(y) * arma::eye<arma::mat>( dim, dim ) ;
+ return wrap( arma::accu(z) ) ;
+ ', plugin = "RcppArmadillo" )
> fx( 2L, 5 )
Error in dyn.load(libLFile) :
  unable to load shared object
'/var/folders/jE/jEC73-DJEeSnEv72rVDHDE+++TM/-Tmp-//RtmplLeXZq/file444e0aa5.so':
  dlopen(/var/folders/jE/jEC73-DJEeSnEv72rVDHDE+++TM/-Tmp-//RtmplLeXZq/file444e0aa5.so,
6): Library not loaded: libgoto2_penrynp-r1.13.dylib
  Referenced from:
/var/folders/jE/jEC73-DJEeSnEv72rVDHDE+++TM/-Tmp-//RtmplLeXZq/file444e0aa5.so
  Reason: image not found

The above is for a 64 bit only Goto BLAS. The error for the ATLAS blas is
identical. I am using the CRAN binary which allows one to load any BLAS as a
shared library.

The fix so far has been to stick to the VecLib BLAS. However, these days, I
use either the ATLAS BLAS or the Goto BLAS on R/Mac OS (there have been a
few threads on the VecLib BLAS in Mac OS. multithreading on Nehalem is
broken in VecLib. found Goto works the best for me.)

Would supporting Goto or ATLAS on Mac OS be a major step, or a simpler
matter of changing a dynamic link some where to load the library? Looks
like libLFile is not picking up the correct path (VecLib is in the same
location as ATLAS and Goto)? Appreciate your thoughts.

sessionInfo below.

Thanks,
Anirban

> sessionInfo()
R version 2.12.0 Patched (2010-10-19 r53362)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] RcppArmadillo_0.2.8 Rcpp_0.8.6          inline_0.3.6

loaded via a namespace (and not attached):
[1] tools_2.12.0


-- 
Anirban Mukherjee | Assistant Professor, Marketing | LKCSB, SMU
5056 School of Business, 50 Stamford Road, Singapore 178899 | +65-6828-1932
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20101101/82a2a611/attachment.htm>


More information about the Rcpp-devel mailing list