[R] ATLAS

Dirk Eddelbuettel edd at debian.org
Tue Nov 6 05:14:48 CET 2001


  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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list