[Rcpp-devel] RcppArmadillo-based code not finding Lapack routines

Davor Cubranic cubranic at stat.ubc.ca
Tue Sep 28 00:20:46 CEST 2010

I created a clean RcppArmadillo-based package using RcppArmadillo.package.skeleton and edited the example .cpp file to call arma::eig_sym. That works with no errors. Here is the output of 'otool -L' on the generated .so file:

        /Library/Frameworks/R.framework/Versions/2.10/Resources/lib/libRlapack.dylib (compatibility version 2.10.0, current version 2.10.1)
        /Library/Frameworks/R.framework/Versions/2.10/Resources/lib/libRblas.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/lib/libgfortran.2.dylib (compatibility version 3.0.0, current version 3.0.0)
        /Library/Frameworks/R.framework/Versions/2.10/Resources/lib/libR.dylib (compatibility version 2.10.0, current version 2.10.1)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
        /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib (compatibility version 1.0.0, current version 268.0.1)

The package that does show this error has only one difference in the linked libraries: vecLib is missing. I'm guessing this could well be the reason for the error. But for the life of me I don't see anything that would cause this in the package building process. FWIW, Makevars and DESCRIPTION in both working and non-working package have same entries for package dependencies and link flags. Also, the final building step that creates the shared library looks the same for both packages:

g++-4.2 -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o eigsym.so rcpparma_hello_world.o /Library/Frameworks/R.framework/Versions/2.10/Resources/library/Rcpp/lib/x86_64/libRcpp.a -L/Library/Frameworks/R.framework/Resources/lib/x86_64 -lRlapack -L/Library/Frameworks/R.framework/Resources/lib/x86_64 -lRblas -lgfortran -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

g++-4.2 -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o broken.so broken.o /Library/Frameworks/R.framework/Versions/2.10/Resources/library/Rcpp/lib/x86_64/libRcpp.a -L/Library/Frameworks/R.framework/Resources/lib/x86_64 -lRlapack -L/Library/Frameworks/R.framework/Resources/lib/x86_64 -lRblas -lgfortran -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation


On 2010-09-27, at 1:29 PM, Davor Cubranic wrote:

> On 2010-09-27, at 12:54 PM, Dirk Eddelbuettel wrote:
>> On 27 September 2010 at 12:43, Davor Cubranic wrote:
>> | After I upgraded to RcppArmadillo 0.2.6, running existing code that uses it throws the following error:
>> | 
>> | run-time error: eig_sym(): need LAPACK
>> | 
>> | Any idea what might be causing this? I'm trying to create a minimal code needed to reproduce the problem, and strangely enough, this works fine:
>> Hm, works here as is:
> Right, that fragment works fine, it's the real code that bombs. I'll post a small example that reproduces the error when I have it.
> Davor
> _______________________________________________
> 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

More information about the Rcpp-devel mailing list