<div dir="ltr">I wonder whether this is actually needed, see https://gist.github.com/nicebread/6920c8287d7bffb03007<div><br></div><div>If you have found a solution in the meantime, I would be interested.<br><br>On Sunday, March 6, 2016 at 1:27:52 AM UTC-5, Baptiste Auguie wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi again,<p>Following my previous message, I've made some progress after finding hints<br>on the list archives that the flag CPPFLAGS="-D__ACCELERATE__"  should help<br>direct R to use the Accelerate framework. It does help in this regard, as<br>./configure now confirms,</p><p>  External libraries:        readline, BLAS(Accelerate), LAPACK(in blas),<br>zlib, bzlib, PCRE, curl</p><p>Unfortunately, make fails because of a missing lzma.h, even though it<br>exists and lives in /usr/local/include/lzma.h. I have xz installed via brew.</p><p>Ideally I would like to be able to build R from source on my mac, but that<br>has proved harder than I anticipated. Alternatively,</p><p>- is there a way to redirect R's Lapack after installation, the same way as<br>for BLAS?<br>( as in<br>cd /Library/Frameworks/R.<wbr>framework/Resources/lib<br>ln -sf<br>/System/Library/Frameworks/<wbr>Accelerate.framework/<wbr>Frameworks/vecLib.framework/<wbr>Versions/Current/libBLAS.dylib<br>libRblas.dylib)</p><p>- could I somehow silence RcppArmadillo's solve() warning? (this is more of<br>a Rcpp-dev question, I'll ask there if it comes to that)</p><p>Thanks,</p><p>baptiste</p><p><br>On 5 March 2016 at 18:24, Baptiste Auguie <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="FIz3gLaSBAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">baptist...@gmail.com</a>> wrote:</p><p>> Dear list,<br>><br>> I have a package using RcppArmadillo for linear algebra; at some point in<br>> the calculation it solves a linear system. I understand the c++ Armadillo<br>> library hands this operation over to Lapack  Unfortunately, somewhere in my<br>> toolchain Armadillo has been configured to use R's internal subset<br>> of Lapack, which triggers the following warning every time I call the R<br>> function,<br>><br>> warning: solve(): refinement and/or equilibration not done due to crippled<br>> LAPACK<br>><br>> This doesn't sound very good, and is also a real nuisance in the terminal<br>> as I'm calling the function hundreds of times in a loop. I've installed the<br>> latest build from <a href="https://r.research.att.com" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fr.research.att.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNErNn-ngEbN82M7OgN0RaCXWORSlg';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fr.research.att.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNErNn-ngEbN82M7OgN0RaCXWORSlg';return true;">https://r.research.att.com</a>, built and installed the<br>> latest version of RcppArmadillo, but the problem persists.<br>><br>> I'm not sure if it's relevant to this question, but I've had some success<br>> with the related issue of switching from R's internal BLAS to the vecLib<br>> one,<br>><br>> cd /Library/Frameworks/R.<wbr>framework/Resources/lib<br>> ln -sf<br>> /System/Library/Frameworks/<wbr>Accelerate.framework/<wbr>Frameworks/vecLib.framework/<wbr>Versions/Current/libBLAS.dylib<br>> libRblas.dylib<br>><br>> giving me a considerable boost in performance. I'm not sure if something<br>> similar can be done for Lapack.<br>><br>> The next step I've taken was to try and build R myself, with explicit<br>> flags telling R to use an external Lapack from Apple's Accelerate (vecLib?)<br>> framework. I have not had any luck with that, every time some kind of error<br>> appears, and I could not find a recent tutorial with step-by-step<br>> instructions to build R on a Mac.<br>><br>> I've downloaded the R source, followed by<br>><br>> ./configure SHELL='/bin/bash' r_arch=x86_64 CC="gcc -arch x86_64<br>> -std=gnu99" CXX="g++ -arch x86_64" OBJC="gcc -arch x86_64" F77="gfortran<br>> -arch x86_64" FC="gfortran -arch x86_64" --with-system-zlib<br>> --with-blas='-framework vecLib' --with-lapack<br>><br>> with this summary at the end:<br>><br>> R is now configured for x86_64-apple-darwin15.3.0<br>><br>>   Source directory:          .<br>>   Installation directory:    /Library/Frameworks<br>><br>>   C compiler:                gcc -arch x86_64 -std=gnu99<br>>  -I/usr/local/include<br>>   Fortran 77 compiler:       gfortran -arch x86_64  -g -O2<br>><br>>   C++ compiler:              g++ -arch x86_64  -g -O2<br>>   C++ 11 compiler:           g++ -arch x86_64  -std=c++11 -g -O2<br>>   Fortran 90/95 compiler:    gfortran -arch x86_64 -g -O2<br>>   Obj-C compiler:     gcc -arch x86_64 -g -O2 -fobjc-exceptions<br>><br>>   Interfaces supported:      X11, aqua, tcltk<br>>   External libraries:        readline, zlib, bzlib, lzma, PCRE, curl<br>>   Additional capabilities:   NLS, ICU<br>>   Options enabled:           framework, shared BLAS, R profiling<br>><br>>   Capabilities skipped:      PNG, JPEG, TIFF, cairo<br>>   Options not enabled:       memory profiling<br>><br>>   Recommended packages:      yes<br>><br>> make<br>><br>> gives me this error:<br>><br>> byte-compiling package 'grDevices'<br>> Warning in solve.default(rgb) :<br>>   unable to load shared object<br>> '/Users/baptiste/Downloads/R-<wbr>rc/modules/x86_64/lapack.so':<br>>   dlopen(/Users/baptiste/<wbr>Downloads/R-rc/modules/x86_64/<wbr>lapack.so, 6):<br>> Symbol not found: __gfortran_compare_string<br>><br>> I've tried quite a few variations, but I'm shooting in the dark since I<br>> don't understand the issue. If I've missed a standard tutorial, please let<br>> me know.<br>><br>> Best regards,<br>><br>> baptiste<br>><br>> PS: my sessionInfo() using CRAN's R-devel<br>> R Under development (unstable) (2016-03-02 r70268)<br>> Platform: x86_64-apple-darwin13.4.0 (64-bit)<br>> Running under: OS X 10.11.3 (El Capitan)<br>> locale:<br>> [1] en_NZ.UTF-8/en_NZ.UTF-8/en_NZ.<wbr>UTF-8/C/en_NZ.UTF-8/en_NZ.UTF-<wbr>8<br>><br>> gfortran -v<br>> gfortran: warning: couldn’t understand kern.osversion ‘15.3.0<br>> Using built-in specs.<br>> COLLECT_GCC=gfortran<br>><br>> COLLECT_LTO_WRAPPER=/usr/<wbr>local/libexec/gcc/x86_64-<wbr>apple-darwin13.0.0/4.8.2/lto-<wbr>wrapper<br>> Target: x86_64-apple-darwin13.0.0<br>> Configured with: /Builds/gcc-4.8/gcc-4.8.2/<wbr>configure CC=clang CXX=clang++<br>> --enable-languages=fortran<br>> Thread model: posix<br>> gcc version 4.8.2 (GCC)<br>><br>><br>><br>></p><p>        [[alternative HTML version deleted]]</p><p>______________________________<wbr>_________________<br>R-SIG-Mac mailing list<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="FIz3gLaSBAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">R-SI...@r-project.org</a><br><a href="https://stat.ethz.ch/mailman/listinfo/r-sig-mac" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;">https://stat.ethz.ch/mailman/<wbr>listinfo/r-sig-mac</a></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></blockquote></div></div>