[Rcpp-devel] RcppArmadillo error

Dirk Eddelbuettel edd at debian.org
Thu Apr 1 16:57:00 CEST 2010


On 30 March 2010 at 16:12, Romain Francois wrote:
| > It is not certain that those will be the same as the libraries used by
| > Armadillo.  If they are not shared objects you run the risk of getting
| > two copies of Lapack, etc.  and possibly different BLAS, leading to
| > different performance characteristics and perhaps different results.
| 
| Hmmm. Interesting. I did not think of that problem.
| 
| On my machine, I have :
| 
| Rscript -e "RcppArmadillo:::LdFlags()"
| /Library/Frameworks/R.framework/Resources/library/Rcpp/lib/x86_64/libRcpp.a 
| -L/usr/lib -larmadillo
| 
| so linking against Rcpp "user" library and armadillo... but when I 
| manually set PKG_LIBS to just Rcpp user library, it still works, so we 
| actually do not need to link against armadillo library. armadillo itself 
| does not __need__ to get compiled into a library because it is all 
| templates.

But "it still works" is no proof. We had talked about this once before (I
think) and I pointed you to the Armadillo FAQ which states that it _can_ be
used without LAPACK but _should_ be used with LAPACK (for performance).

When you drop -llapack from the link line, the linker "simply" finds it via
R's library dependencies. So when Armadillo needs to find a Lapack routine
for inversion, it finds the one R uses.

But I do not think we can turn that upside down and not link Arma with lapack
as R can be build in several configurations so I fear we'd end with some that
are suitable for Arma and some that may not be. 

So Doug's warning is a good one. 

OTOH this was meant to be a simple demo package and I simply do not want to
spend a day or so on configure et al to make it more complicated than it
already is.

Dirk

-- 
  Registration is open for the 2nd International conference R / Finance 2010
  See http://www.RinFinance.com for details, and see you in Chicago in April!


More information about the Rcpp-devel mailing list