velox: `std::signbit` cannot be found when building on Apple M1

When building (make debug) on Apple M1, I run into these errors:

/Library/Developer/CommandLineTools/usr/bin/make cmake BUILD_DIR=debug BUILD_TYPE=Debug
mkdir -p _build/debug && \
	cmake -B \
		"_build/debug" \
		-DTREAT_WARNINGS_AS_ERRORS=1 -DENABLE_ALL_WARNINGS=1 -DVELOX_BUILD_MINIMAL="OFF" -DVELOX_BUILD_TESTING="ON" -DCMAKE_BUILD_TYPE=Debug \
		-GNinja -DMAX_LINK_JOBS= -DMAX_HIGH_MEM_JOBS= \
		-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
		 \
		
-- Build type: Debug
-- Disabling Codegen
-- Found Bison keg installed by Homebrew at /opt/homebrew/opt/bison
-- Found Flex keg installed by Homebrew at /opt/homebrew/opt/flex
-- xsimd v9.0.1
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jimmylu/src/velox/_build/debug
/Library/Developer/CommandLineTools/usr/bin/make build BUILD_DIR=debug -j 10
cmake --build _build/debug -j 10
[1/909] Building CXX object third_party/googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o
[2/909] Building CXX object third_party/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
[3/909] Building CXX object third_party/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[4/909] Linking CXX static library lib/libgtestd.a
[5/909] Linking CXX static library lib/libgmockd.a
[6/909] Linking CXX static library lib/libgmock_maind.a
[7/909] Linking CXX static library lib/libgtest_maind.a
[8/909] Building CXX object velox/common/base/CMakeFiles/velox_common_base.dir/BitUtil.cpp.o
FAILED: velox/common/base/CMakeFiles/velox_common_base.dir/BitUtil.cpp.o 
ccache /Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -I/opt/homebrew/opt/icu4c/include -I/Users/jimmylu/src/velox/. -I/Users/jimmylu/src/velox/velox/external/xxhash -I/Users/jimmylu/src/velox/third_party/xsimd/include -isystem /opt/homebrew/include -isystem /Users/jimmylu/src/velox/velox -isystem /Users/jimmylu/src/velox/velox/external -isystem /Users/jimmylu/src/velox/velox/external/duckdb -isystem /Users/jimmylu/src/velox/velox/external/duckdb/tpch/dbgen/include -isystem /usr/local/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include -isystem /opt/homebrew/opt/openssl@1.1/include -mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden -fvisibility=hidden -fvisibility-inlines-hidden -D USE_VELOX_COMMON_BASE -D HAS_UNCAUGHT_EXCEPTIONS -Werror -Wall -Wextra -Wno-unused        -Wno-unused-parameter        -Wno-sign-compare        -Wno-ignored-qualifiers        -Wno-range-loop-analysis -Wno-mismatched-tags -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk -mmacosx-version-min=12.6 -fPIC -std=gnu++17 -MD -MT velox/common/base/CMakeFiles/velox_common_base.dir/BitUtil.cpp.o -MF velox/common/base/CMakeFiles/velox_common_base.dir/BitUtil.cpp.o.d -o velox/common/base/CMakeFiles/velox_common_base.dir/BitUtil.cpp.o -c /Users/jimmylu/src/velox/velox/common/base/BitUtil.cpp
In file included from /Users/jimmylu/src/velox/velox/common/base/BitUtil.cpp:18:
In file included from /Users/jimmylu/src/velox/./velox/common/base/Exceptions.h:22:
/usr/local/include/fmt/format.h:1772:12: error: expected unqualified-id
  if (std::signbit(value)) {  // value < 0 is false for NaN so use signbit.
           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/math.h:170:5: note: expanded from macro 'signbit'
    ( sizeof(x) == sizeof(float)  ? __inline_signbitf((float)(x))        \
    ^
% clang --version
Apple clang version 14.0.0 (clang-1400.0.29.201)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Looks like a configuration issue with MacOSX SDK, is there any expert on this can provide some clue how we can solve this?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

you are right, I deleted all SDK and developer tools locally, and reinstalled…it get passed now