Dear R-users, I want to install R on our new Red Hat machine and I want R to use ATLAS for its linear algebra calculations. The R-admin manual recommends building ATLAS into a shared BLAS library, which means that R should be able of detecting the library at RUN-TIME and fall back if there is none. I remember there was a discussion how to make R use BLAS, but that seems to deal with static linking only. Actually the very existence of that discussion made me doubt about the things that are probably obvious. So here are my questions: * Do I need to make any modifications to the configure in order to build R that can dynamically link with BLAS shared library? If not, than the precompiled binary distribution should be able of doing this as well, right? * I assume that the order of building BLAS and R does not matter (as opposed to the static linking case). * How do I tell that R successfully finds the BLAS shared library? Thanks, Vadim -------------------------------------------------- DISCLAIMER This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Trading Group may, at its discretion, monitor and review the content of all e-mail communications. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Vadim> * Do I need to make any modifications to the configure in order to Vadim> build R that can dynamically link with BLAS shared library? If not, Vadim> than the precompiled binary distribution should be able of doing Vadim> this as well, right? That is how we worked it out for Debian where both Atlas and the standard (non-optimized) Blas provide a shared library libblas.so. The default one is /usr/lib/libblas.so.* and is found by default; the optimized Atlas version sits in /usr/lib/$ARCH/libblas.so.* [1] Currently, this requires us to tell the dynamic linker ld.so about it via the LD_LIBRARY_PATH variable which is set from the R shell script. We tried to get the glibc maintainers to automatically look into /usr/lib/$ARCH but were unsuccessful. Vadim> * I assume that the order of building BLAS and R does not matter (as Vadim> opposed to the static linking case). Correct. Vadim> * How do I tell that R successfully finds the BLAS shared library? Use ldd. Without the variable, the default libblas is found: edd at homebud:~> ldd /usr/lib/R/bin/R.bin libblas.so.2 => /usr/lib/libblas.so.2 (0x40023000) <---- HERE libm.so.6 => /lib/libm.so.6 (0x40074000) libz.so.1 => /usr/lib/libz.so.1 (0x40096000) libreadline.so.4 => /lib/libreadline.so.4 (0x400a6000) libdl.so.2 => /lib/libdl.so.2 (0x400cb000) libncurses.so.5 => /lib/libncurses.so.5 (0x400cf000) libc.so.6 => /lib/libc.so.6 (0x4010f000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) With LD_LIBRARY_PATH set, the Atlas one is found edd at homebud:~> LD_LIBRARY_PATH=/usr/lib/atlas/ ldd /usr/lib/R/bin/R.bin libblas.so.2 => /usr/lib/atlas/libblas.so.2 (0x40016000) <--- HERE libm.so.6 => /lib/libm.so.6 (0x402a4000) libz.so.1 => /usr/lib/libz.so.1 (0x402c6000) libreadline.so.4 => /lib/libreadline.so.4 (0x402d6000) libdl.so.2 => /lib/libdl.so.2 (0x402fb000) libncurses.so.5 => /lib/libncurses.so.5 (0x402ff000) libc.so.6 => /lib/libc.so.6 (0x4033f000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) This works for us. You could of course install Debian instead of RH. Hope this helps, Dirk [1] Here, $ARCH will vary for "optimisable" processors such as the pIII or k7; my Celeron uses the default /usr/lib/atlas. -- Better to have an approximate answer to the right question than a precise answer to the wrong question. -- John Tukey -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 06-Nov-2001 Vadim Ogranovich wrote:> Dear R-users, > > I want to install R on our new Red Hat machine and I want R to use ATLAS for > its linear algebra calculations. The R-admin manual recommends building > ATLAS into a shared BLAS library, which means that R should be able of > detecting the library at RUN-TIME and fall back if there is none. > > I remember there was a discussion how to make R use BLAS, but that seems to > deal with static linking only. Actually the very existence of that > discussion made me doubt about the things that are probably obvious. So here > are my questions: > > * Do I need to make any modifications to the configure in order to build R > that can dynamically link with BLAS shared library? If not, than the > precompiled binary distribution should be able of doing this as well, right?Unfortunately not, because the precompiled binary is not dynamically linked with BLAS. As a matter of policy, I only link with libraries that are provided on the main Red Hat distribution. The blas library only appeared in the main distribution in release 7.1 (Previously it was on the Powertools CD). I have to cater for 7.0, 7.1 and 7.2, which means that you get the lowest common denominator. Martyn -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._