Boost logo

Boost :

Subject: Re: [boost] [math] Comeau can't match math::tools::fmod_workaround
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2009-11-28 16:07:02

John Maddock wrote:
>> It may look like Comeau/libcomo issue, as long double fabs(long double)
>> should be well defined so the simple template test above is supposed to
>> work. Am I correct?
> Nod, I think so.
> It's easy enough to disable long double support in Boost.Math, it's just
> a case of working out what macros the std lib sets when it's not
> available so we can hook into that. Is __NO_LONG_DOUBLE_MATH defined
> after including math.h by any chance?

No, this macro is not defined.

I contacted with Comeau team and, as they are always helpful, I've
received a quick fix for this issue. It is possible to compile using
Comeau with gcc/g++ compatibility mode [1] enabled.


In this mode g++ built-in functions are available, so it is possible to
define missing fabs for Linux-specific configuration in which toolset
includes Comeau frontend + GNU C++ compiler + GLIBC:

#if defined(__linux__) && defined(__COMO__) \
 && defined(__GNUG__) && defined(__GLIBC__)
namespace std {
    inline long double fabs(long double value)
       { return __builtin_fabsl(value); }

I've confirmed using the simple test program that this option works.

The only issue with the compatibility mode is that:
- it does not allow strict mode compilation using Comeau, though I don't
believe it's possible to use strict mode with Boost as even relaxed mode
is still not working for me
- it requires --g++ option, perhaps bjam could specify it for user

Best regards,

Mateusz Loskot,
Charter Member of OSGeo,

Boost list run by bdawes at, gregod at, cpdaniel at, john at