Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-13 Thread Serguei Sokol
On 12/09/2019 11:07, Berend Hasselman wrote: On 12 Sep 2019, at 10:36, Serguei Sokol wrote: On 11/09/2019 21:38, Berend Hasselman wrote: The Lapack library is loaded automatically by R itself when it needs it for doing some calculation. You can force it to do that with a (dummy) solve for ex

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-12 Thread Göran Broström
Hi guys, interestingly, my problem seems to be solved by writing a FORTRAN wrapper for the Fortran code! (As long as the check doesn't get smarter...). This is the relevant part of my Fortran code: --- subroutine gmlfun(what, &

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-12 Thread Berend Hasselman
> On 12 Sep 2019, at 10:36, Serguei Sokol wrote: > > On 11/09/2019 21:38, Berend Hasselman wrote: >> The Lapack library is loaded automatically by R itself when it needs it for >> doing some calculation. >> You can force it to do that with a (dummy) solve for example. >> Put this at start of

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-12 Thread Serguei Sokol
On 11/09/2019 21:38, Berend Hasselman wrote: The Lapack library is loaded automatically by R itself when it needs it for doing some calculation. You can force it to do that with a (dummy) solve for example. Put this at start of your script: # dummy code to get LAPACK library loaded X1 <- diag

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-11 Thread Avraham Adler
I think better stated that it is subset that relied on a “bug” that was never trapped for until now. We’re it written “properly” this never would have arisen. At least to the best of my understanding. Avi On Wed, Sep 11, 2019 at 4:34 PM Göran Broström wrote: > > > On 2019-09-11 22:16, Avraham A

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-11 Thread Göran Broström
On 2019-09-11 22:16, Avraham Adler wrote: Can you write a small C function that calls LAPACK call that fro your Fortran code? Yes, an extra step but maybe less traumatic than rewriting parts of LAPACK directly. Yes, I know how to do that, but I find it somewhat bizarre that it is impossibl

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-11 Thread Avraham Adler
Can you write a small C function that calls LAPACK call that fro your Fortran code? Yes, an extra step but maybe less traumatic than rewriting parts of LAPACK directly. Avi On Wed, Sep 11, 2019 at 4:08 PM Göran Broström wrote: > Berend, > > I do not think this works with gfortran 7+. I am calli

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-11 Thread Göran Broström
Berend, I do not think this works with gfortran 7+. I am calling the BLAS subroutine dgemv from Fortran code in my package eha, and the check (with R-devel) gives: gmlfun.f:223:1: warning: type of ‘dgemv’ does not match original declaration [-Wlto-type-mismatch] & score, ione) ^

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-11 Thread Berend Hasselman
The Lapack library is loaded automatically by R itself when it needs it for doing some calculation. You can force it to do that with a (dummy) solve for example. Put this at start of your script: # dummy code to get LAPACK library loaded X1 <- diag(2,2) x1 <- rep(2,2) # X1;x1 z <- solve(X1,x1

[Rd] Fw: Calling a LAPACK subroutine from R

2019-09-11 Thread Giovanni Petris
Sorry for cross-posting, but I realized my question might be more appropriate for r-devel... Thank you, Giovanni From: R-help on behalf of Giovanni Petris Sent: Tuesday, September 10, 2019 16:44 To: r-h...@r-project.org Subject: [R] Calling a LAPACK su