openblas

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

openblas

robin hankin-3
Hello, macosx 10.13.6, Rdevel  r76458

I'm trying to compile against openblas to reproduce an error on the
CRAN check page (my package is clean under winbuilder and all but one
of the checks).   I've downloaded and installed openblas 0.3.7 but I
am not 100% sure that it is being used by R.

Using

./configure --with-blas="-lopenblas"

Then running R to discover the PID I get:


Rd % lsof -p 17960|egrep -i blas

R       17960 rhankin  txt    REG    1,8     189224 33471762
/Users/rhankin/Rd/lib/R/lib/libRblas.dylib


But it is not clear to me how to interpret this.  Am I using openblas
as intended?  I suspect not, for I cannot reproduce the error.   Can
anyone advise?


[hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: openblas

plangfelder
I'm a linux guy so take the advice with a grain of salt... When you
run the configure script, look at the output at the end of the run, it
should either say

Options enabled:           shared BLAS, ...   (means you are using R BLAS)

or it should mention OpenBLAS in External libraries (meaning you are
using OpenBLAS).

You can also see the results in config.log of you search for BLAS.

Or you could use the old trick of replacing libRblas.dylib with a link
to the appropriate OpenBLAS dylib.

On Tue, May 7, 2019 at 5:01 PM robin hankin <[hidden email]> wrote:

>
> Hello, macosx 10.13.6, Rdevel  r76458
>
> I'm trying to compile against openblas to reproduce an error on the
> CRAN check page (my package is clean under winbuilder and all but one
> of the checks).   I've downloaded and installed openblas 0.3.7 but I
> am not 100% sure that it is being used by R.
>
> Using
>
> ./configure --with-blas="-lopenblas"
>
> Then running R to discover the PID I get:
>
>
> Rd % lsof -p 17960|egrep -i blas
>
> R       17960 rhankin  txt    REG    1,8     189224 33471762
> /Users/rhankin/Rd/lib/R/lib/libRblas.dylib
>
>
> But it is not clear to me how to interpret this.  Am I using openblas
> as intended?  I suspect not, for I cannot reproduce the error.   Can
> anyone advise?
>
>
> [hidden email]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: openblas

plangfelder
(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 <[hidden email]> wrote:

> thanks Peter, I appreciate your advice here.
>
> ./configure --with-blas="-lopenblas"  --without-recommended-packages
>
>
> gives me
>
>
>
>
>   Interfaces supported:        X11, aqua, tcltk
>
>   External libraries:          readline, curl
>
>   Additional capabilities:     JPEG, NLS, ICU
>
>   Options enabled:             shared BLAS, R profiling
>
>
>   Capabilities skipped:        PNG, TIFF, cairo
>
>   Options not enabled:         memory profiling
>
>
>   Recommended packages:        no
>
>
>
> so it doesn't look like it's using the openBlas... how come the arguments
> to ./configure are being ignored?
>
>
>
> <[hidden email]>
> [hidden email]
>
> <[hidden email]>
>
> <[hidden email]>
>
>
> On Wed, May 8, 2019 at 1:04 PM Peter Langfelder <
> [hidden email]> wrote:
>
>> I'm a linux guy so take the advice with a grain of salt... When you
>> run the configure script, look at the output at the end of the run, it
>> should either say
>>
>> Options enabled:           shared BLAS, ...   (means you are using R BLAS)
>>
>> or it should mention OpenBLAS in External libraries (meaning you are
>> using OpenBLAS).
>>
>> You can also see the results in config.log of you search for BLAS.
>>
>> Or you could use the old trick of replacing libRblas.dylib with a link
>> to the appropriate OpenBLAS dylib.
>>
>> On Tue, May 7, 2019 at 5:01 PM robin hankin <[hidden email]>
>> wrote:
>> >
>> > Hello, macosx 10.13.6, Rdevel  r76458
>> >
>> > I'm trying to compile against openblas to reproduce an error on the
>> > CRAN check page (my package is clean under winbuilder and all but one
>> > of the checks).   I've downloaded and installed openblas 0.3.7 but I
>> > am not 100% sure that it is being used by R.
>> >
>> > Using
>> >
>> > ./configure --with-blas="-lopenblas"
>> >
>> > Then running R to discover the PID I get:
>> >
>> >
>> > Rd % lsof -p 17960|egrep -i blas
>> >
>> > R       17960 rhankin  txt    REG    1,8     189224 33471762
>> > /Users/rhankin/Rd/lib/R/lib/libRblas.dylib
>> >
>> >
>> > But it is not clear to me how to interpret this.  Am I using openblas
>> > as intended?  I suspect not, for I cannot reproduce the error.   Can
>> > anyone advise?
>> >
>> >
>> > [hidden email]
>> >
>> > ______________________________________________
>> > [hidden email] mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: openblas

Dirk Eddelbuettel

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 | [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: openblas

Iñaki Ucar
In reply to this post by plangfelder
On Wed, 8 May 2019 at 04:52, Peter Langfelder
<[hidden email]> 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.

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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: openblas

Ralf Stubner
On 08.05.19 09:34, Iñaki Ucar wrote:

> On Wed, 8 May 2019 at 04:52, Peter Langfelder
> <[hidden email]> 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.
>
> R on Fedora uses openblas by default since Fedora 23. In fact, there's
> a specific package, openblas-Rblas, that provides libRblas.so.
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

--
Ralf Stubner
Senior Software Engineer / Trainer

daqana GmbH
Dortustraße 48
14467 Potsdam

T: +49 331 23 61 93 11
F: +49 331 23 61 93 90
M: +49 162 20 91 196
Mail: [hidden email]

Sitz: Potsdam
Register: AG Potsdam HRB 27966
Ust.-IdNr.: DE300072622
Geschäftsführer: Dr.-Ing. Stefan Knirsch, Prof. Dr. Dr. Karl-Kuno Kunze


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: openblas

plangfelder
On Wed, May 8, 2019 at 9:00 AM Ralf Stubner <[hidden email]> 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.

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

Peter

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: openblas

Iñaki Ucar
In reply to this post by Ralf Stubner
On Wed, 8 May 2019 at 18:00, Ralf Stubner <[hidden email]> wrote:

>
> On 08.05.19 09:34, Iñaki Ucar wrote:
> > On Wed, 8 May 2019 at 04:52, Peter Langfelder
> > <[hidden email]> 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.
> >
> > R on Fedora uses openblas by default since Fedora 23. In fact, there's
> > a specific package, openblas-Rblas, that provides libRblas.so.
>
> AFAIK a single-threaded OpenBLAS is used.

Of course it is the serial version. It wouldn't be a good policy to
ship a threaded shared library by default.

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

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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel