[Rd] boneheaded BLAS questions

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Thu Mar 18 04:21:41 CET 2021


Ben,

possibly useful project related to this
https://github.com/staticfloat/libblastrampoline
which is what Dirk referred to as the Julia state of art. It is actually much more complex than it sounds because of differences in naming and ABI between BLAS implementations, so simple switches don't work.
Dirk has the luxury of having control over what he compiles, but that is not always the case (like with Accelerate or MKL) ... 

Cheers,
Simon


> On 18/03/2021, at 3:53 PM, Ben Bolker <bbolker using gmail.com> 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!).
> 
>  I tried --with-lapack, no joy.
>  Will try to decipher the rules file tomorrow ...
> 
>  cheers
>   Ben
> 
> 
> On 3/17/21 10:25 PM, Dirk Eddelbuettel wrote:
>> Ben,
>> This stuff has worked unchanged since the 1990s when we had a _really_ far
>> sighted fellow in Debian come up with the 'switch the links' scheme which was
>> (and is) subsequently deployed by many numerical applications within Debian,
>> R and e.g. Octave included.
>> And I used this ability to switch over a decade ago in a never-quite-finished
>> paper which resulted in a package as well as a vignette as paper draft on
>> CRAN: gcbd [1] It used the ability to switch between implementation to time
>> and compare and benchmark the various BLAS and LAPACK libraries -- which was
>> then motivated by a comparison with GPUs. (The actual code / package is
>> stale-ish as some of the underlying packages have gone as eg the GPU one --
>> but the mechanics you are after still work the exact same way on Debian and
>> derivarives including Ubuntu and PopOS.)
>> (As a complete aside, the state of the art here is now one level up in
>> libraries based on flame/blis (a riff on blas) which can do a similar logical
>> switch _at runtime_ (rather than by flipping softlinks and restarting the
>> app). Julia and some other languages uses that, I think Fedora may have it in
>> its R build as well. Inaki may know more...)
>> That said, from the top of my head, I think you error may just be with the
>> second R compilation -- I always (i.e. for the Debian package) use both
>>   --with-blas --with-lapack
>> and not just --with-blas. And I do there is public: if you know where to look
>> you can see the exact invocation of the Debian build of the R package (which
>> Ubuntu and Pop and ... then shadow) [2]
>> Hth, Dirk
>> [1] https://cran.r-project.org/package=gcbd
>> [2] https://sources.debian.org/src/r-base/4.0.4-1/debian/rules/
>>     (and I apologise for how messy this still is)
>> 
> 
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



More information about the R-devel mailing list