apache / apache/arrow

[C++] Can't build with `-DARROW_BUILD_BENCHMARKS=ON` on macOS platform.

Open
#48,305 0 comments 0 reactions 0 assignees View on GitHub
Component: C++ Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

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

## overview

Apache Arrow cpp can't build with `-DARROW_BUILD_BENCHMARKS=ON` on macOS platform.

## build error

```
In file included from /path/to/arrow/cpp/src/gandiva/tests/timed_evaluate.h:24:
/path/to/arrow/cpp/src/gandiva/tests/generate_data.h:39:19: error: implicit conversion loses integer precision: 'int64_t' (aka 'long long') to 'result_type' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
39 | Random() : gen_(::arrow::internal::GetRandomSeed()) {}
| ~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/gandiva/tests/generate_data.h:40:41: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'result_type' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
40 | explicit Random(uint64_t seed) : gen_(seed) {}
| ~~~~ ^~~~
2 errors generated.
```

## Environment

* OS: macOS 15.7.1
* clang: Apple clang version 17.0.0 (clang-1700.4.4.1)
* Source: 02ade2c216d85a1070f9934188e1b4537ca1be33

## Build step

```
git clone https://github.com/apache/arrow/
cd arrow/cpp
mkdir build
cd build
cmake .. --preset ninja-debug-maximal \
-DCMAKE_INSTALL_PREFIX=/tmp/local \
-DARROW_CUDA=OFF \
-DARROW_SKYHOOK=OFF \
-DARROW_BUILD_BENCHMARKS=ON
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
-DARROW_EXTRA_ERROR_CONTEXT=OFF
cmake --build .
```

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.