[Rcpp-devel] Using Goto blas in Mac OS

Dirk Eddelbuettel edd at debian.org
Mon Nov 1 04:58:44 CET 2010


Hi,

On 1 November 2010 at 10:23, Anirban Mukherjee wrote:
| 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.

Our pleasure! 
 
| 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

We do not do anything particular. We just let R and the OS load the right one
for us.

| like libLFile is not picking up the correct path (VecLib is in the same
| location as ATLAS and Goto)? Appreciate your thoughts.

As I don't have a Mac / OS X, I cannot comment on particulars about OS X. I
sort-of heard about the recent stories about veclib but as I am the person to
ask for advice; try r-sig-mac.  

In general replacing a BLAS implementation is just a matter of making it
visible to the dynamic linker -- I used that very feature on a recent paper
on BLAS benchmarking (see my blog and the gcbd package on CRAN which has the
paper as a vignette).  But again, I limited myself to Linux there as that is
what I use.  

Lastly, but you probably know this, the R manuals 'Writing R Extensions'
and/or 'Installation and Administration' should have the pertinent details.

| 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

You are one Rcpp version behind here. We did release 0.8.7 right after R 2.12.0.

Hope this helps,  Dirk
 

 
| 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
| 
| ----------------------------------------------------------------------
| _______________________________________________
| 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

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


More information about the Rcpp-devel mailing list