WillAyd opened a new issue, #45325:
URL: https://github.com/apache/arrow/issues/45325
### Describe the bug, including details regarding any error messages,
version, and platform.
If you add `-DCMAKE_CXX_COMPILER=clang++` you get a rather confusing error
message about the threads library not being found:
```bash
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja -DARROW_COMPUTE=ON
-DARROW_BUILD_TESTS=ON -DCMAKE_CXX_COMPILER=clang++
CMake Error at
/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600
(_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.28/Modules/FindThreads.cmake:226
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake_modules/ThirdpartyToolchain.cmake:1050 (find_package)
CMakeLists.txt:546 (include)
```
If you look at the CMake configuration log, you will see that the error
actually doesn't have anything to do with thread support, but rather with the C
compiler (in my case gcc) being provided arguments that only work with clang:
```yaml
---
events:
kind: "try_compile-v1"
backtrace:
-
"/usr/share/cmake-3.28/Modules/Internal/CheckSourceCompiles.cmake:101
(try_compile)"
- "/usr/share/cmake-3.28/Modules/CheckCSourceCompiles.cmake:52
(cmake_check_source_compiles)"
- "/usr/share/cmake-3.28/Modules/FindThreads.cmake:97
(CHECK_C_SOURCE_COMPILES)"
- "/usr/share/cmake-3.28/Modules/FindThreads.cmake:163
(_threads_check_libc)"
- "cmake_modules/ThirdpartyToolchain.cmake:1050 (find_package)"
- "CMakeLists.txt:546 (include)"
checks:
- "Performing Test CMAKE_HAVE_LIBC_PTHREAD"
directories:
source:
"/home/willayd/clones/arrow/cpp/build/CMakeFiles/CMakeScratch/TryCompile-C4sSBS"
binary:
"/home/willayd/clones/arrow/cpp/build/CMakeFiles/CMakeScratch/TryCompile-C4sSBS"
cmakeVariables:
CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS: "/usr/bin/clang-scan-deps-18"
CMAKE_C_FLAGS: "-O0 -O0 -Qunused-arguments"
CMAKE_C_FLAGS_DEBUG: "-g -Werror -O0 -ggdb "
CMAKE_EXE_LINKER_FLAGS: ""
CMAKE_MODULE_PATH: "/home/willayd/clones/arrow/cpp/cmake_modules"
CMAKE_POSITION_INDEPENDENT_CODE: "ON"
buildResult:
variable: "CMAKE_HAVE_LIBC_PTHREAD"
cached: true
stdout: |
Change Dir:
'/home/willayd/clones/arrow/cpp/build/CMakeFiles/CMakeScratch/TryCompile-C4sSBS'
Run Build Command(s): /usr/bin/ninja -v cmTC_500bc
[1/2] /usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -O0 -O0
-Qunused-arguments -std=gnu11 -fPIE -o CMakeFiles/cmTC_500bc.dir/src.c.o -c
/home/willayd/clones/arrow/cpp/build/CMakeFiles/CMakeScratch/TryCompile-C4sSBS/src.c
FAILED: CMakeFiles/cmTC_500bc.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -O0 -O0 -Qunused-arguments
-std=gnu11 -fPIE -o CMakeFiles/cmTC_500bc.dir/src.c.o -c
/home/willayd/clones/arrow/cpp/build/CMakeFiles/CMakeScratch/TryCompile-C4sSBS/src.c
cc: error: unrecognized command-line option ‘-Qunused-arguments’
ninja: build stopped: subcommand failed.
exitCode: 1
```
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]