Opened 5 years ago

Closed 5 years ago

#7492 closed Bugs (fixed)

add support of libc++

Reported by: vvavrychuk@… Owned by: John Maddock
Milestone: To Be Determined Component: math
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:


Without this change I get compilation error

In file included from helmholtz/base/kom/green_func/green_func_helmholtz.cpp:1:
In file included from helmholtz/base/kom/green_func/green_func_helmholtz.hpp:7:
In file included from helmholtz/base/kom/fund_sol/fund_sol_helmholtz.hpp:6:
In file included from base/base/kom/base/special_functions.hpp:9:
In file included from base/base/kom/base/special_functions_ooura.hpp:4:
In file included from third_party/boost/boost/math/special_functions/bessel.hpp:17:
In file included from third_party/boost/boost/math/special_functions/detail/bessel_jy.hpp:14:
In file included from third_party/boost/boost/math/special_functions/gamma.hpp:37:
In file included from third_party/boost/boost/math/special_functions/powm1.hpp:14:
third_party/boost/boost/math/special_functions/expm1.hpp:308:64: error: implicit conversion loses floating-point precision: 'double' to 'float' [-Werror,-Wconversion]
inline float expm1(float x, const policies::policy<>&){ return ::expm1(x); }
                                                        ~~~~~~ ^~~~~~~~~~
2 errors generated.

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by vvavrychuk@…

Patch is

From 69e657661b5d617b189667adf015346821c7297b Mon Sep 17 00:00:00 2001
From: Vasyl Vavrychuk <>
Date: Wed, 10 Oct 2012 20:57:50 +0300
Subject: [PATCH] Boost.Math: support libcxx

Fixed compilation with libc++.
 boost/math/tools/config.hpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/boost/math/tools/config.hpp b/boost/math/tools/config.hpp
index 907d693..3742ae0 100644
--- a/boost/math/tools/config.hpp
+++ b/boost/math/tools/config.hpp
@@ -99,6 +99,10 @@
 #  define BOOST_MATH_USE_C99

+#if defined(_LIBCPP_VERSION)
+#  define BOOST_MATH_USE_C99
 #if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \
   || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))

comment:2 Changed 5 years ago by John Maddock

I'm not sure that's quite the correct fix - can we guarantee that libc++ always implies the C99 math functions are available? I suspect it would be better to check the platform (what is the platform BTW)?

In the mean time I'll add a static_cast so you don't get the implicit-conversion warnings/errors.

comment:3 Changed 5 years ago by John Maddock

(In [81624]) Lots of small patches. Update and regenerate docs. Fixes #7183. Fixes #7290. Fixes #7291. Fixes #7649. Refs #7492.

comment:4 Changed 5 years ago by vvavrychuk@…

Yes, libc++ has always C99 math functions enabled.


comment:5 Changed 5 years ago by John Maddock

Resolution: fixed
Status: newclosed

(In [81625]) Enable use of C99 functions on libc++. Fixes #7492.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain John Maddock.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.