[Rd] fortran 90 underscore error

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Mar 15 07:32:00 CET 2011


We have no position about Fortran 90.  We provide the means to specify 
an F90 compiler and note that its use is not portable as not all 
platforms have one.  (A very few are still using gcc3 with g77.)

This simply is not an R issue, and seems specific to your unstated 
platform (*PLEASE* do follow the posting guide).

On Mon, 14 Mar 2011, jgarcia at ija.csic.es wrote:

> Hi there,
>
> I am preparing a package based on Fortran 90 code. I've put the main code
> is a MODULE, and I'm having several error messages with the linker:
>
>> R CMD SHLIB --output=mylib.so nrtype.f90 topbalmod.f90 runmodels.f90
>
> The several error messages are related with the addition of an underscore
> to function names (no problem with subroutine names). E.g.:
>
> topbalmod.o:topbalmod.f90:<.text+0x357f>: undefined reference to 'runga_'
>
> After some googling, AFAIK, it seems the addition of underscores (I'm
> using gfortran) may be avoided by the option -fno-underscoring, but its
> use is not recomended as it is not of general use by all compilers.
>
> I'm just wondering if R developers just recommend not to use user defined
> fortran functions at all to avoid this problem, or alternatively if you
> could provided with some example about how to circumvent it (perhaps to
> convert all fortran 90 functions into subroutines?).
>
> Thanks and best regards.
>
> Javier
> ---

-- 
Brian D. Ripley,                  ripley at 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



More information about the R-devel mailing list