[R] using src/Makevars file

From: Joel Bremson <joel3000_at_gmail.com>
Date: Fri 20 May 2005 - 10:20:11 EST


Hi all,

Thanks to all who offered advice on using F95 in R.

Now I'm trying to compile a test package using gfortran, Linux 2.4.21 and R 2.1.0.

I was able to successfully compile and use a test F95 routine by setting my environment variables as follows in bash:

export PATH=~/bin/:$PATH
export F77=gfortran
export LD_LIBRARY_PATH=~/bin/irun/lib
export GFORTRAN_STDIN_UNIT=-1

Now I'm trying to write a Makevars file for my test package and not quite sure how to do it. I've tried

FF=gfortran
GFORTRAN_STDIN_UNIT=-1
FLIBS=/home/jbremson/bin/irun/lib/libgfortran.a

but when running an R CMD check on the package I see that it's still using g77 to compile:

-----output----
...

** libs
g77 -fPIC -g -O2 -c estimate.f -o estimate.o estimate.f: In subroutine `estimate':
estimate.f:20:
forall (i = 1:nxrows) beta(i) = i * 2
^
Invalid declaration of or reference to symbol `forall' at (^) [initially seen at (^)]
...

----end output ----

The code compiles using:
gfortran -c estimate.f

I can run my code if I build the .so by hand and then dyn.load it.

Here is my F95 test code:

subroutine estimate(beta, yij, nij, nxrows, nxcols,xmat, & irequest, ierror)

integer nxrows, nxcols, yij, nij, irequest, ierror double precision beta(nxrows), xmat(nxrows,nxcols) integer i

i = 0
c fortran 95 version
forall (i = 1:nxrows) beta(i) = i * 2

ierror = 0
end

Regards,

Joel Bremson
UC Davis

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 20 10:25:25 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:56 EST