Skip to content

[C++] CRAN build fail on missing std::floating_point concept #49176

Closed

Description

@jonkeane

Describe the bug, including details regarding any error messages, version, and platform.

I suspect this is something specific to the MacOS version + clang that is being used. On this CRAN runner it is macOS 13.3 and Apple clang version 14.0.0 (AKA Apple Clang 1403.0.22.14.1).

Most of the code that is erroring looks like it came in #48459 so maybe @zanmato1984 might have an idea what's up here?

From the CRAN build logs:

[ 88%] Building CXX object src/arrow/CMakeFiles/arrow_compute_objlib.dir/compute/kernels/hash_aggregate.cc.o
 [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:281:38:  [0m [0;1;31merror:  [0m [1mno template named 'floating_point' in namespace 'std'; did you mean 'is_floating_point'? [0m
concept CFloatingPointConcept = std::floating_point<T> || std::same_as<T, util::Float16>;
 [0;1;32m                                ~~~~~^~~~~~~~~~~~~~
 [0m [0;32m                                     is_floating_point
 [0m [1m/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/type_traits:860:50:  [0m [0;1;30mnote:  [0m'is_floating_point' declared here [0m
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
 [0;1;32m                                                 ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:281:56:  [0m [0;1;31merror:  [0m [1mexpected '(' for function-style cast or type construction [0m
concept CFloatingPointConcept = std::floating_point<T> || std::same_as<T, util::Float16>;
 [0;1;32m                                ~~~~~~~~~~~~~~~~~~~~~~ ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:299:11:  [0m [0;1;31merror:  [0m [1munknown type name 'CFloatingPointConcept'; did you mean 'FloatingPointType'? [0m
template <CFloatingPointConcept CType>
 [0;1;32m          ^~~~~~~~~~~~~~~~~~~~~
 [0m [0;32m          FloatingPointType
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/type.h:336:20:  [0m [0;1;30mnote:  [0m'FloatingPointType' declared here [0m
class ARROW_EXPORT FloatingPointType : public NumberType {
 [0;1;32m                   ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:299:33:  [0m [0;1;31merror:  [0m [1mnon-type template parameter has non-literal type 'arrow::FloatingPointType' [0m
template <CFloatingPointConcept CType>
 [0;1;32m                                ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/type.h:336:20:  [0m [0;1;30mnote:  [0m'FloatingPointType' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors [0m
class ARROW_EXPORT FloatingPointType : public NumberType {
 [0;1;32m                   ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:300:20:  [0m [0;1;31merror:  [0m [1mtemplate argument for template type parameter must be a type [0m
struct AntiExtrema<CType> {
 [0;1;32m                   ^~~~~
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:287:20:  [0m [0;1;30mnote:  [0mtemplate parameter is declared here [0m
template <typename CType>
 [0;1;32m                   ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:317:11:  [0m [0;1;31merror:  [0m [1munknown type name 'CFloatingPointConcept'; did you mean 'FloatingPointType'? [0m
template <CFloatingPointConcept CType>
 [0;1;32m          ^~~~~~~~~~~~~~~~~~~~~
 [0m [0;32m          FloatingPointType
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/type.h:336:20:  [0m [0;1;30mnote:  [0m'FloatingPointType' declared here [0m
class ARROW_EXPORT FloatingPointType : public NumberType {
 [0;1;32m                   ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:317:33:  [0m [0;1;31merror:  [0m [1mnon-type template parameter has non-literal type 'arrow::FloatingPointType' [0m
template <CFloatingPointConcept CType>
 [0;1;32m                                ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/type.h:336:20:  [0m [0;1;30mnote:  [0m'FloatingPointType' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors [0m
class ARROW_EXPORT FloatingPointType : public NumberType {
 [0;1;32m                   ^
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:318:17:  [0m [0;1;31merror:  [0m [1mtemplate argument for template type parameter must be a type [0m
struct MinMaxOp<CType> {
 [0;1;32m                ^~~~~
 [0m [1m/Volumes/Builds/packages/big-sur-x86_64/results/4.5/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/compute/kernels/hash_aggregate.cc:311:20:  [0m [0;1;30mnote:  [0mtemplate parameter is declared here [0m
template <typename CType>
 [0;1;32m                   ^
 [0m8 errors generated.
make[2]: *** [src/arrow/CMakeFiles/arrow_compute_objlib.dir/compute/kernels/hash_aggregate.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Component(s)

C++

Activity

  1. changed the title [-][C++][/-] [+][C++] CRAN build fail on missing `std::floating_point` concept[/+] on Feb 7, 2026
  2. zanmato1984 commented on Feb 7, 2026

    @zanmato1984
    Contributor

    Thanks @jonkeane for reporting this.

    It seems the compiler is complaining about not being able to find std::floating_point which is a C++20 concept. I'm seeing similar complains in [1] which is also about AppleClang though for v13. Some pointers like [2] show that AppleClang has been a little behind on C++20 concepts, but it's not clear which exact part is missing. Unfortunately I don't have an older AppleClang (mine is 17.0.0) so I'm not able to further locate the issue.

    Is it possible to try a newer AppleClang for this particular CRAN build?

    [1] https://stackoverflow.com/questions/71818683/stdintegral-not-found-in-clang13-c20-error
    [2] https://en.cppreference.com/w/cpp/compiler_support/20

  3. jonkeane commented on Feb 7, 2026

    @jonkeane
    MemberAuthor

    Is it possible to try a newer AppleClang for this particular CRAN build?

    We cannot try a newer version of clang in this build because we do not control the infrastructure. This is the version of clang that is installed on CRAN's own runners.

    We might be able to make a crossbow build with this older version though.

  4. shashbha14 commented on Feb 8, 2026

    @shashbha14

    take

  5. added a commit that references this issue on Feb 8, 2026
    208a3ed
  6. Alvaro-Kothe commented on Feb 8, 2026

    @Alvaro-Kothe
    Contributor

    I managed to build libarrow with clang++-14 with an ubuntu-22.04 container. Unfortunately, it didn't reproduce the CRAN error.

    I don't think it's possible to directly reproduce the CRAN's error with GitHub actions, due to it not having a macOS 13 runner.

    In my opinion, the most realistic options due to this limitation are:

    1. Wait until they upgrade their macOS runners, since apparently macOS 13 already reached EOL. [1] [2]
    2. Go back to using C++-17 standard, since it's more feature complete across all compilers. [3]
    3. Get a hold of a mac with Xcode 14 and fix the compiler errors.
    4. Create patches based on CRAN logs.
  7. jonkeane commented on Feb 8, 2026

    @jonkeane
    MemberAuthor

    In my opinion, the most realistic options due to this limitation are:

    Wait until they upgrade their macOS runners, since apparently macOS 13 already reached EOL. [1] [2]

    This is a non-starter for CRAN. They often keep images like these around after EOL, and we have to build on the systems they provide or we will be removed from CRAN.

    Go back to using C++-17 standard, since it's more feature complete across all compilers. [3]

    I hope that we can avoid this, but we might need to in order to stay on CRAN until they upgrade their builders. I will admit that I didn't think that the macOS runners + Apple's somewhat bespoke clang was going to be the thing that holds us back on moving to C++20, or I would have raised it on the mailing list when we were discussing this! cc @pitrou

    Get a hold of a mac with Xcode 14 and fix the compiler errors.

    I'm going to try and replicate this locally. It's unfortunate because it won't be automatable, but I haven't found any CI runner (Github Actions or otherwise) that runs MacOS 13.

    Create patches based on CRAN logs.

    The logs are pretty clear what's going on, but without the automatable CI knowing we get it right is hard.

  8. jonkeane commented on Feb 8, 2026

    @jonkeane
    MemberAuthor

    I've got a local VM with MacOS 13, and I am able to build with old(er) clang, but I'm actually not seeing the error even there yet. I do notice that in the CRAN logs there's mention of the MacOSX11.sdk (/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/type_traits), so I might need to install an even older SDK in order to get that error.

  9. pitrou commented on Feb 9, 2026

    @pitrou
    Member

    I do notice that in the CRAN logs there's mention of the MacOSX11.sdk (/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/type_traits),

    Or is it possible to change the deployment target to something newer on the CRAN build?

  10. jonkeane commented on Feb 9, 2026

    @jonkeane
    MemberAuthor

    Or is it possible to change the deployment target to something newer on the CRAN build?

    As far as I'm aware, no. For example, https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Building-binary-packages-1 explicitly mention CRAN setting the deployment target to 11.0. I don't believe we can then override that even in our build scripts. Though it looks like there are plans with the next release of R to update some of these this is still a few months away and considered experimental. And, as far as I can tell will not apply to macos x86 builds regardless.

    I still haven't managed to replicate the error on my local VM, even after installing + confirming I'm using the older SDK, arrow is building just fine there. I suspect that there is some set of flags on the cran machines that is causing this, and will continue to dig to find out what those are.

  11. pitrou commented on Feb 9, 2026

    @pitrou
    Member

    Perhaps you can enable https://cmake.org/cmake/help/latest/variable/CMAKE_VERBOSE_MAKEFILE.html on the CRAN build to see which command-line flags precisely are passed to the compiler?

  12. jonkeane commented on Feb 11, 2026

    @jonkeane
    MemberAuthor

    I have finally replicated this in CI: #49216 (comment)

  13. added a commit that references this issue on Feb 16, 2026
  14. added this to the 24.0.0 milestone on Feb 16, 2026
  15. thisisnic commented on Feb 16, 2026

    @thisisnic
    Member

    Issue resolved by pull request 49221
    #49221

  16. added a commit that references this issue on Feb 18, 2026
  17. added a commit that references this issue on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions