Skip to content

R-alpha: Re: pow_dd & pow_di [was f2clib.c etc..] -- yes, please !

3 messages · Martin Maechler, Ross Ihaka, Thomas Lumley

#
>> On Fri, 1 Aug 1997, Kurt Hornik wrote:
>>> Thomas,
    >>> 
    >>> Could you add the "-lf2c" at the end of the line @$(LD)
    >>> $(SHLIBLDFLAGS) -o $(LIBNAME).so $(OBJS) in acepack's
    >>> src-c/Makefile?
    >>> 
    >>> I ran across an identical pow_dd problem recently with another
    >>> package.  Did we always need the "-lf2c", or is this a feature of
    >>> the new version?
    >>> 

    >> This is very strange.  My copy works ok as is, in all the versions
    >> of R I have installed (including 0.50a1). On the other hand, using
    >> nm reveals that R0.50 has replaced pow_dd and pow_di by f77_pow_dd
    >> and f77_pow_di respectively.  It looks like the builtin subset of
    >> libf2c has vanished.  This is a problem, as we should not require
    >> people to have f2c in order to run the C version of the library --
    >> after all, if they had f2c they could run the FORTRAN version.
yep
    Kurt> You're right, see also one of my previous mails.  They now have
    Kurt> POW_DD and f77_pow_dd (where does this come from, anyway).  I
    Kurt> think that in the ``old days'' we were lucky that everything was
    Kurt> based on C, so FORTRAN was converted using f2c and compatibility
    Kurt> functions were provided by the distribution proper.  Of course,
    Kurt> in general one cannot expect that ALL functions needed after
    Kurt> using f2c would be in a compatibility library, unless it was
    Kurt> identical to libf2c ...

    Kurt> But clearly, pow_dd and pow_di should exist again ...

Even more: I think it's just these two which should 
	'officially' part of the R binary, i.e., their sourc should be in
	src/main/  or src/math/  rather than in appl  or somewhere.

I think there are several instances in the current  R source tree, where
the code could be improved by using  pow_d{d|i}(..).

-- Martin
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
Martin Maechler writes:
 > Even more: I think it's just these two which should 
 > 	'officially' part of the R binary, i.e., their sourc should be in
 > 	src/main/  or src/math/  rather than in appl  or somewhere.
 > 
 > I think there are several instances in the current  R source tree, where
 > the code could be improved by using  pow_d{d|i}(..).

I think that there are two problems here.

 1. Providing support for functionality in the R core (all C code).

 2. Supporting code in external libraries (mainly f77).

I think it might be useful to keep these problems separate.

We can certainly put in support for a wider range of "pow" functions
and any other math functions.  Putting these in the "math" library
seems natural.

One possible solution to the second problem would be to declare that R
will work with f2c generated code and anything compatible with it.
This is pretty extreme though.  On more exotic platforms it would be
nice to use custom blas etc.

Better dyn.load support is on the way (complements of GNU dld 4) and
this may well solve problem 2 above.
	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
On Tue, 5 Aug 1997, Ross Ihaka wrote:
I agree. I don't think it is necessarily a good idea for R to contain all
of libf2c that we might want to use.  My question was much simpler: 

Should we assume in creating libraries with C translations of FORTRAN that
ld -lf2c works, or should we explicitly include the C source for functions
that we call (as R does with pow_dd and pow_di)?


	-thomas


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-