[Rd] boneheaded BLAS questions

Iñaki Ucar |uc@r @end|ng |rom |edor@project@org
Thu Mar 18 10:34:52 CET 2021

On Thu, 18 Mar 2021 at 05:10, Dirk Eddelbuettel <edd using debian.org> wrote:
> On 17 March 2021 at 22:53, Ben Bolker wrote:
> |    Thanks.  I know it's supposed to Just Work (and I definitely
> | appreciate all the work that's gone into making it Just Work 99% of the
> | time!).
> And for what it is worth, the aforementioned 'switching from within' solution
> is using FlexiBLAS (not BLIS as I had said in the previous email), and was
> described in an R application R here:
>   https://www.enchufa2.es/archives/switch-blas-lapack-without-leaving-your-r-session.html

Thanks, Dirk. Yes, since Fedora 33 (current release), we leverage this
excellent work by Martin Köhler et al. [1], so that every BLAS/LAPACK
consumer in Fedora is linked against FlexiBLAS, which enables
transparent live switching. And there are R and octave packages
providing bindings, as shown in the post above. Julia is in fact the
only component that is currently *not* using it due to the
particularities of their BLAS/LAPACK stack management, but they are
interested in FlexiBLAS too and some work is underway [2].

If you are interested in this, Ben, you could compile FlexiBLAS
yourself, docs are very clear and it's pretty straightforward. And
then you only need to tell R to link against libflexiblas. For that,
as previously described, we use (see lines 691-693 in [3]):

--with-lapack --with-blas=flexiblas

A small tweak in the configure is required though (see line 679 in
[3]; in fact, I should port a proper fix upstream, but I didn't find
the time yet). And if you have any issue Martin or myself could help.

[1] https://www.mpi-magdeburg.mpg.de/projects/flexiblas
[2] https://github.com/mpimd-csc/flexiblas/issues/12
[3] https://src.fedoraproject.org/rpms/R/blob/rawhide/f/R.spec

Iñaki Úcar

More information about the R-devel mailing list