Repository navigation
[C++] CRAN build fail on missing std::floating_point concept #49176
Copy link
Copy link
Closed
Labels
Milestone
Description
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++
Reactions are currently unavailable
Activity
[-][C++][/-][+][C++] CRAN build fail on missing `std::floating_point` concept[/+]zanmato1984 commentedon Feb 7, 2026
Thanks @jonkeane for reporting this.
It seems the compiler is complaining about not being able to find
std::floating_pointwhich 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
jonkeane commentedon Feb 7, 2026
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.
shashbha14 commentedon Feb 8, 2026
take
Fix: Replace std::floating_point concept with std::is_floating_point_…
Alvaro-Kothe commentedon Feb 8, 2026
I managed to build libarrow with
clang++-14with anubuntu-22.04container. 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:
jonkeane commentedon Feb 8, 2026
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.
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
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.
The logs are pretty clear what's going on, but without the automatable CI knowing we get it right is hard.
jonkeane commentedon Feb 8, 2026
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.pitrou commentedon Feb 9, 2026
Or is it possible to change the deployment target to something newer on the CRAN build?
jonkeane commentedon Feb 9, 2026
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.
pitrou commentedon Feb 9, 2026
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?
jonkeane commentedon Feb 11, 2026
I have finally replicated this in CI: #49216 (comment)
GH-49176: [C++] CRAN build fail on missing std::floating_point concept (
thisisnic commentedon Feb 16, 2026
Issue resolved by pull request 49221
#49221
apacheGH-49176: [C++] CRAN build fail on missing std::floating_point …
apacheGH-49176: [C++] CRAN build fail on missing std::floating_point …