[R-SIG-Mac] Fwd: os x / g95 package namespace load problem

Simon Urbanek simon.urbanek at r-project.org
Fri Jun 24 02:28:30 CEST 2005


Joel,

On Jun 23, 2005, at 7:52 PM, Joel Bremson wrote:

> The reason I'm using the Makefile is the code which needs to be  
> compiled under g95. It appears to me that a build with Makevars  
> will use gcc-3.3 for linking, and completely ignores my f90 files:

R ignores .f90 files because it supports only generic fortran files  
with .f extension (which are assumed to be f77). From the output it  
is evident that you're using the CRAN binary which was build with and  
for gcc3. There is no g90/95 compiler in gcc3 so R is not configured  
to support it - you can use Fortran 77 code only.

If you need f90/95, you may want to use gcc4 instead, because it has  
a Fortran 95 compiler. Currently R doesn't support separate f77 and  
f90/95 compilers directly, so the easiest way is to simply use  
gfortran from gcc4 as if it was f77. As for Macs - you can either  
compile R yourself using gcc4 or use the Tiger G5 binary that I  
posted on the this list recently (if you have a G5). Even if you  
don't have a G5, you can still install the compiler from that binary,  
because it works on a G4 as well. If you configure R to use f90/95  
compiler as default, then all you need to do is to rename .f90 to .f  
and R will compile the package for you.

Actually, which compiler did you try to use? Apple provides no  
Fortran compiler at all, so I wonder what you choose.

You may try your luck with some other g90/95 compiler, but then  
you're really on your own. The problem is that each Fortran compiler  
has a set of supporting libraries, specific flags and behavior. The  
only reliable way to use such separate f77 and f90/95 compilers is to  
use autoconf to determine all necessary flags - you could use  
modified parts of R's Fortran detection code to do that. If you  
decide to do the latter, I can try to help you there if you send me  
the necessary files.

FWIW: What we are discussing here is pretty much platform- 
independent. You could ignore all this if all you want to is have one- 
shot solution (then just configure R with gfortran and copy the flags  
to your Makefile), but others wouldn't be able to use your package.

Cheers,
Simon



More information about the R-SIG-Mac mailing list