Re: using lgamma_r
Re: using lgamma_r
- Subject: Re: using lgamma_r
- From: Michael McLaughlin <email@hidden>
- Date: Tue, 04 Mar 2008 15:39:40 -0500
- Thread-topic: using lgamma_r
On 3/4/08 12:58 PM, "Jeremy Pereira" <email@hidden> wrote:
>
> On 28 Feb 2008, at 16:52, Michael McLaughlin wrote:
>
>> I have a multi-threaded CoreServices C++ tool project built for OS
>> 10.5. I
>> want/need to use lgamma_r in one of my functions. Therefore, as
>> stated in
>> math.h, I added the precompiler flag
>>
>> -D_REENTRANT
>>
>> to the Build options.
>>
>> The relevant code fragment, viz.,
>>
>> double pdf(double x, double lambda) {
>> int *signgam;
>> double logpdf = x*log(lambda) - lambda - lgamma_r(x + 1, signgam);
>> ...
>> }
>>
>> builds successfully with ppc architecture but *fails* when the i386
>> architecture is added. [I need the latter for a universal binary.]
>> The
>> build results confirm that the i386 compile is what fails.
>>
>> Math.h mentions lgamma_r in just one block and says nothing special
>> about
>> i386.
>
> On my system, math.h doesn't mention lgamma_r or, in fact, anything
> useful other than including an architecture specific version of
> math.h. If you look at the i386 version of math.h in /usr/include/
> architecture.i386, you'll notice that lgamma_r is not defined there
> which is probably where your error comes from.
FWIW, the MacOSX10.3.9 SDK (i386) math.h *does* include the REENTRANT
lgamma_r block. Anyone know where it went -- or why?
--
Mike McLaughlin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden