Skip to content

openblas

6 messages · Peter Langfelder, Dirk Eddelbuettel, Ralf Stubner +1 more

#
(CCing the R-devel list, maybe someone will have a better answer.)

To be honest, I don't know how to. I wasn't able to configure R to use
OpenBLAS using the configure script and options on my Linux Fedora system.
I configure it without external BLAS, then replace the libRblas.dylib (.so
in my case) with a link to the OpenBLAS dynamic link library.

Peter
On Tue, May 7, 2019 at 7:39 PM robin hankin <hankin.robin at gmail.com> wrote:

            

  
  
#
On 7 May 2019 at 19:43, Peter Langfelder wrote:
| (CCing the R-devel list, maybe someone will have a better answer.)
| 
| To be honest, I don't know how to. I wasn't able to configure R to use
| OpenBLAS using the configure script and options on my Linux Fedora system.
| I configure it without external BLAS, then replace the libRblas.dylib (.so
| in my case) with a link to the OpenBLAS dynamic link library.

We have been doing this for nearly 20 years in Debian.  The configure call
when building R is

	./configure --prefix=/usr			\
		    --with-cairo			\
                    [... stuff omitted ...]             \
		    $(atlas)		\
		    $(lapack)		\
		    --enable-R-profiling		\
		    --enable-R-shlib			\
		    --enable-memory-profiling		\
		    --without-recommended-packages	\
		    --build $(buildarch)

where $(atlas) and $(lapack) these days simply are

        atlas         = --with-blas
        [...]
        lapack	      = --with-lapack

(and that used to be different on different architectures a long time
ago). As I recall the --enable-R-shlib is also helpful.

With that we have R using _external_ LAPACK and BLAS allowing us to switch
seamlessly between, inter alia, reference BLAS, ATLAS, OpenBLAS and MKL (see
my blog for the last one). MKL appeared to be marginally faster than OpenBLAS
at a larger installation footprint.

Full details are in this (somewhat sprawling, my bad) file:

  https://salsa.debian.org/edd/r-base/blob/master/debian/rules

Dirk
#
On Wed, 8 May 2019 at 04:52, Peter Langfelder
<peter.langfelder at gmail.com> wrote:
R on Fedora uses openblas by default since Fedora 23. In fact, there's
a specific package, openblas-Rblas, that provides libRblas.so.

$ ll /usr/lib64/R/lib/
total 64544
-rwxr-xr-x. 1 root root 60113776 feb 28 13:37 libRblas.so
-rwxr-xr-x. 1 root root  1961880 mar 11 20:37 libRlapack.so
-rwxr-xr-x. 1 root root   182304 mar 11 20:37 libRrefblas.so
-rwxr-xr-x. 1 root root  3828104 mar 11 20:37 libR.so

R reference blas is installed as libRrefblas.so.

I?aki
#
On 08.05.19 09:34, I?aki Ucar wrote:
AFAIK a single-threaded OpenBLAS is used. When compiling R from source
on a CentOS system I have used the configure option
'--with-blas="-lopenblasp"' to link with the pthread version of OpenBLAS.

cheerio
ralf
#
On Wed, May 8, 2019 at 9:00 AM Ralf Stubner <ralf.stubner at daqana.com> wrote:

            
Yes, that's the right incantation. Thanks for solving it for me...

Peter
#
On Wed, 8 May 2019 at 18:00, Ralf Stubner <ralf.stubner at daqana.com> wrote:
Of course it is the serial version. It wouldn't be a good policy to
ship a threaded shared library by default.
CentOS uses the reference BLAS by default instead. It's a long story.
But both CentOS and Fedora configure R with --enable-BLAS-shlib, so
you don't need to recompile it to use an optimized version.

I?aki