Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: [C Question] Determine if gcc provides erfl() function

by syphilis (Canon)
on May 29, 2015 at 02:17 UTC ( #1128218=note: print w/ replies, xml ) Need Help??


in reply to Re: [C Question] Determine if gcc provides erfl() function
in thread [C Question] Determine if gcc provides erfl() function

feature_test_macros is where it's at

I take it this means that erfl() is available if either:
a) the "-std=c99" flag is set; or
b) "_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L" is true.

And, if neither of those 2 conditions is met, then erfl() is unavailable.

Is that the correct way to read it ?

Update: If I #define _BSD_SOURCE at the beginning of LongDouble.xs, does this necessarily mean that erfl() is made available on these problem BSD systems ?

Cheers,
Rob


Comment on Re^2: [C Question] Determine if gcc provides erfl() function
Re^3: [C Question] Determine if gcc provides erfl() function
by Anonymous Monk on May 29, 2015 at 04:21 UTC

    Negative.

    On Linux/glibc, normally the _BSD_SOURCE, _SVID_SOURCE, _POSIX_SOURCE are on by default. See /usr/include/features.h. On ~BSD, some long double variants may be missing, or implemented as wrappers to a standard double function (with precision loss). Google around (for manpages and discussions). E.g. erfl() appears on FreeBSD 10.1 manpages, but not on 10.0. And no powl(). The sinhl/coshl/tanhl may be wrappers.

    I started up a decade-old FreeBSD 6.0 install; looking in libm.a (and libc.a), there is no erfl. The gcc-3.4.4 recognizes __builtin_erfl(), but this just defers to system erfl, and it fails to link.

    So, you're out of luck. Furthermore, (some) tests for availability ought to verify the precision, too.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1128218]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-05-29 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (576 votes), past polls