From ripley at stats.ox.ac.uk  Tue Mar 15 07:32:00 2011
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 15 Mar 2011 06:32:00 +0000 (GMT)
Subject: [Rd] fortran 90 underscore error
In-Reply-To: <1991.89.243.32.35.1300139945.squirrel@paleo.ija.csic.es>
References: <BLU159-w408CB0E72A7114BFA5D24F4C80@phx.gbl>
	<AANLkTi=vsFizrAshwTzGYYUm2G=Kt-9ArH5CJDVAkhtw@mail.gmail.com>
	<FB725016-19BB-4A3D-9916-7301DAEAF7D9@r-project.org>
	<AANLkTi=8yJvD+1giF9KN80JENJAEpFYM8jBFbDcpEjrT@mail.gmail.com>
	<1991.89.243.32.35.1300139945.squirrel@paleo.ija.csic.es>
Message-ID: <alpine.LFD.2.02.1103150627550.2580@gannet.stats.ox.ac.uk>

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



[Rd] fortran 90 underscore error
Prof Brian Ripley