From: Daniel J Sebald <daniel.sebald@ie...> - 2006-09-27 20:14:30
> On 9/27/06, Ethan Merritt <merritt@...> wrote:
>> On Wednesday 27 September 2006 10:21 am, Chris Monson wrote:
>> > On 9/27/06, Ethan Merritt <merritt@...> wrote:
>> > > On Wednesday 27 September 2006 09:43 am, Daniel J Sebald wrote:
>> > >
>> > > > I'd say this needs to be addressed before 4.2 release.
>> > >
>> > > Nah. This is just one more oddity that an OSX packager would
>> > > have to sort out when building a binary distribution. Once the
>> > > user is up and running there is no problem at all.
>> > Is the fink distribution the proper place for this issue, then?
>> I'm going to have to throw up my hands at this point.
>> I'm not a Mac person, and I don't know who/where to send such
>> a report. From the various reports on this thread it seems that
>> the problem is present only on some Macs, or only some versions
>> of OSX, or I don't know what-all variant installed libraries.
>> If somebody associated with fink, or Darwin, or some other
>> OSX developers resource can provide a definitive answer then
>> fine. But I fear if we were to blindly 'fix' the build process
>> to work on Chris's machine, we would risk breaking it on other
> Indeed. Fortunately, what I *really* needed was lgamma (I just didn't know
> about it), so I'm currently happy with the status quo. I would never ask
> anyone to fix something just for my machine.
Hey, you uncovered something that is definitely a problem. The confusion seems to have worked its way into the computer community.
There may be more to this. I see now that "signgam" is actually an external as part of the math library I'm guessing. So, if I understand this, calling gamma() (i.e., the "old gamma" which is actually ln gamma) will set the sign of the gamma function upon calling gamma(). How is an optimizing compiler to know that? Anyway, maybe just avoiding the use of "signgam" in any way is best.
We could make life simple as far as configuration and code by:
1) Testing for tgamma(), if present use that as gnuplot's gamma function. Several systems appear to have this now.
2) Fall back on the gnuplot version of gamma if tgamma() is not present.
3) Change the gnuplot code to not use the signgam/lgamma() construct. Handle the exceptions +- Inf, NaN etc in order to set the "undefined" variable.
As an alternative, one could retain the signgam/lgamma() construct, but do not use the function "gamma()" anywhere in the code, instead only use the function "lgamma()"... if it is present of course.