Re: [R] using src/Makevars file

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 20 May 2005 - 20:42:39 EST

Why do you expect FF to specify a Fortran compiler when F77 works on the command line?

I would expect F77 to work.

On Thu, 19 May 2005, Joel Bremson wrote:

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

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
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 21:48:16 2005

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