Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed on calculate_constants.hpp #885

Closed
dharanlinux opened this issue Nov 28, 2022 · 11 comments · Fixed by #888
Closed

Build failed on calculate_constants.hpp #885

dharanlinux opened this issue Nov 28, 2022 · 11 comments · Fixed by #888

Comments

@dharanlinux
Copy link

dharanlinux commented Nov 28, 2022

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;
               ^~~~
@mborland
Copy link
Member

@dharanlinux Can you please test the linked patch to see if it solves your issue?

@dharanlinux
Copy link
Author

@mborland Sorry it is not fixing the issue. I am using the uClibc for cross-compiling the boost.

@jzmaddock
Copy link
Collaborator

@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?

@ckormanyos
Copy link
Member

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

@mborland
Copy link
Member

Looking through the uClibc++ source there is no definition of std::cbrt provided which would explain the issue.

@ckormanyos
Copy link
Member

ckormanyos commented Nov 29, 2022

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.

@dharanlinux
Copy link
Author

I am using the raspberry-pi3 board with uclibc. As you mentioned my uclibc source doesn't provide the std::cbrt.

@jzmaddock
Copy link
Collaborator

@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?

@NAThompson
Copy link
Collaborator

@jzmaddock : You're exactly right; we can remove it.

@mborland
Copy link
Member

mborland commented Dec 3, 2022

@dharanlinux can you try #888 to see if it solves your issue?

@dharanlinux
Copy link
Author

@mborland Thanks for the followup and fix. Yes the shared patch fix the build issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants