From edd @end|ng |rom deb|@n@org  Wed May  8 04:59:58 2019
From: edd @end|ng |rom deb|@n@org (Dirk Eddelbuettel)
Date: Tue, 7 May 2019 21:59:58 -0500
Subject: [Rd] openblas
In-Reply-To: <CA+hbrhWueSWO+sSWSuA7DLRVdyhuxGGScXrUrbU+OeuujwH6+Q@mail.gmail.com>
References: <CAHHjBM7eRSRnxX7e41EAAV0Zu3tK+nem-c_HGX-2ix0VGu8Bug@mail.gmail.com>
 <CA+hbrhWVM9sL_Sgsf=6HXXMr5XwdbAxOV7S3DDTVD0TPdOeuug@mail.gmail.com>
 <CAHHjBM5_uhvz9MKeSoTdk3MJNy+MzyL_uv1Bbgi4YUbXcXssYw@mail.gmail.com>
 <CA+hbrhWueSWO+sSWSuA7DLRVdyhuxGGScXrUrbU+OeuujwH6+Q@mail.gmail.com>
Message-ID: <23762.17966.789809.889514@rob.eddelbuettel.com>


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

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] openblas
Dirk Eddelbuettel