Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2526 closed Bugs (fixed)

More architectures that do not support long double math

Reported by: Steven Robbins <smr@…> Owned by: John Maddock
Milestone: Boost 1.38.0 Component: math
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:

Description

Hi,

The header math/tools/config.hpp defines BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS in a number of cases, some of which are the OS (cygwin, FreeBSD, NetBSD) and one is the CPU (hppa).

While building Boost for 14 CPU architectures of Debian, I needed to add ARM and MIPS to this list, both of which come in two flavours: little endian and big endian.

I'm not sure how to decide whether it is the CPU that prevents long doubles from working regardless of OS, or whether it is due to Linux on the CPU. So I took the simpler option and make the exception based on CPU alone.

Attachments (1)

math_tools_config.patch (489 bytes ) - added by Steven Robbins <smr@…> 14 years ago.

Download all attachments as: .zip

Change History (10)

by Steven Robbins <smr@…>, 14 years ago

Attachment: math_tools_config.patch added

comment:1 by Marshall Clow, 14 years ago

Component: Nonemath
Owner: set to John Maddock

comment:2 by John Maddock, 14 years ago

Status: newassigned

Thanks for the info Steven, just to clarify:

  • This is the Debian Linux distro that has the issues?
  • Have you run the tests to verify that long double support is broken on these combinations of glibc and processor - out of interest what's the issue - no true long double functions in glibc? If the latter I wonder if there is some way to detect that (either glibc or libstdc++ config macro?

Thanks, John.

in reply to:  2 comment:3 by smr@…, 14 years ago

Replying to johnmaddock:

This is the Debian Linux distro that has the issues?

Yes. The build failures were observed on the official package builds (I'm one of the maintainers of the Boost packages for Debian). The problem appeared in 1.36.0 but I didn't notice until a few weeks ago.

Have you run the tests to verify that long double support is broken on these combinations of glibc and processor - out of interest what's the issue - no true long double functions in glibc? If the latter I wonder if there is some way to detect that (either glibc or libstdc++ config macro?

What tests are you referring to?

My evidence is simply that the math library failed to compile on these architectures: the common symptom is that log1p1() isn't declared; e.g.

./boost/math/special_functions/log1p.hpp:342: error: '::log1pl' has not been declared

To be honest, I did not look any further. All the build logs are available (c.f. http://tinyurl.com/5fz9ok) and looking at those for 1.36.0-1, I can see that MIPSEL (failure) and i386 (success) both have identical versions of libc6-dev, g++, and libstdc++6-dev.

comment:4 by John Maddock, 14 years ago

OK, log1pl and expm1l are slightly different issues as they're part of C99 rather than C++03. Are you able to tell if _GLIBCXX_USE_C99 is defined on the problem platforms?

Thanks, John.

in reply to:  4 comment:5 by smr@…, 14 years ago

Replying to johnmaddock:

OK, log1pl and expm1l are slightly different issues as they're part of C99 rather than C++03. Are you able to tell if _GLIBCXX_USE_C99 is defined on the problem platforms?

I have checked 4 of the five problem architectures -- none of them define _GLIBCXX_USE_C99; I have no access to the fifth architecture (hppa). I also checked a random sampling of other ("successful") architectures in Debian (alpha, amd64, i386, powerpc, and sparc) and found they all defined the symbol as 1.

Hope that helps.

-Steve

comment:6 by John Maddock, 14 years ago

Resolution: fixed
Status: assignedclosed

Hopefully this changeset: https://svn.boost.org/trac/boost/changeset/50055/trunk/boost will now fix this.

I'm closing the issue for now, but please reopen if theres still a problem.

John.

comment:7 by smr@…, 14 years ago

There is a missing backslash on one line of the patch. Fix attached.

Index: boost/math/special_functions/fpclassify.hpp
===================================================================
--- boost/math/special_functions/fpclassify.hpp (revision 50082)
+++ boost/math/special_functions/fpclassify.hpp (working copy)
@@ -166,7 +166,7 @@
    return BOOST_FPCLASSIFY_PREFIX fpclassify(t);
 }
 #if !defined(__CYGWIN__) && !defined(__HP_aCC) && !defined(BOOST_INTEL) \
-   && !defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+   && !defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
    && !(defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))
 // The native fpclassify broken for long doubles with aCC
 // use portable one instead....

comment:8 by John Maddock, 14 years ago

Doh!

Fixed thanks.

John.

comment:9 by Alvaro, 14 years ago

<nelchael> "XML is like violence, if it doesn't solve the problem, just

use more."

  • nelchael hides

acquista viagra in italia fioricet rx quanto costa comprare cialis generico tramadol relieve pain

Note: See TracTickets for help on using tickets.