Build failed on calculate_constants.hpp
Closed this issue · 11 comments
Facing below build issue with boost-1.80.1. Do we need to include the missing header.
Check the below error log.
In file included from ./boost/math/constants/constants.hpp:341,
from ./boost/math/special_functions/gamma.hpp:24,
from ./boost/math/special_functions/detail/bessel_jy.hpp:14,
from ./boost/math/special_functions/bessel.hpp:20,
from ./boost/math/special_functions/airy.hpp:12,
from ./boost/math/special_functions.hpp:15,
from libs/math/build/../src/tr1/pch.hpp:9:
./boost/math/constants/calculate_constants.hpp: In static member function 'static T boost::math::constants::detail::constant_plastic<T>::compute()':
./boost/math/constants/calculate_constants.hpp:1014:15: error: 'std::cbrt' has not been declared
using std::cbrt;
^~~~
@dharanlinux Can you please test the linked patch to see if it solves your issue?
@mborland Sorry it is not fixing the issue. I am using the uClibc for cross-compiling the boost.
@mborland those headers will have been included anyway.
Two questions: are you building for C++11 or later? And does your implement std::cbrt or is it missing?
using the uClibc for cross-compiling
does your implement std::cbrt or is it missing?
Hi @dharanlinux sometimes older or incomplete versions of the C/C++ standard library do not include cbrt
within the standard namespace. We need to see if your compiler does or does not have std::cbrt
. As John mentioned, this came in C++11. But some ports of the C++ standard library actually missed this step and do not include the fuction declaration of std::cbrt
.
This might be the case for your query.
Cc: @mborland and @jzmaddock
Looking through the uClibc++ source there is no definition of std::cbrt
provided which would explain the issue.
Looking through the uClibc++ source there is no definition of
std::cbrt
This might be a larger problem for the OP. My understanding is that this port is based on an older standard like C++03 (although this is not, as far as I can see, officially stated in the docs mentioned above).
I'd like to know from @dharanlinux is an embedded system being targeted here? If so, which compiler/microcontroller is being targeted here? It sounds like you're on an embedded system?
Depending on the situation there might be some other options.
I am using the raspberry-pi3 board with uclibc. As you mentioned my uclibc source doesn't provide the std::cbrt.
@NAThompson : Looks like you added the plastic constant which is the problem here, is there any reason not to remove the using declarations here? The rationale, is that this code is only used when calculating the constants to extended precision so the std:: versions will never be used anyway as T will be a multiprecision UDT type?
@jzmaddock : You're exactly right; we can remove it.
@dharanlinux can you try #888 to see if it solves your issue?
@mborland Thanks for the followup and fix. Yes the shared patch fix the build issue.