Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix build on m1 macbook && re-enable clang-tidy checks #9500

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dbms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ target_link_libraries(tiflash_vector_search
tiflash_contrib::usearch
tiflash_contrib::simsimd

fmt
fmt
)

target_link_libraries (dbms
Expand Down
5 changes: 5 additions & 0 deletions dbms/src/VectorSearch/SimSIMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
#define SIMSIMD_DYNAMIC_DISPATCH 0

// Force enable all target features. We will do our own dynamic dispatch.
#if defined(__APPLE__)
#define SIMSIMD_TARGET_NEON 0
#define SIMSIMD_TARGET_SVE 0
#else
#define SIMSIMD_TARGET_NEON 1
#define SIMSIMD_TARGET_SVE 1
#endif
#define SIMSIMD_TARGET_HASWELL 1
#define SIMSIMD_TARGET_SKYLAKE 1
#define SIMSIMD_TARGET_ICE 1
Expand Down
7 changes: 7 additions & 0 deletions dbms/src/VectorSearch/USearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
#define SIMSIMD_NATIVE_BF16 0

// Force enable all target features.
#if defined(__APPLE__)
#define SIMSIMD_TARGET_NEON 0
#define SIMSIMD_TARGET_SVE 0
#else
#define SIMSIMD_TARGET_NEON 1
#define SIMSIMD_TARGET_SVE 1
#endif
#define SIMSIMD_TARGET_HASWELL 1
#define SIMSIMD_TARGET_SKYLAKE 1
#define SIMSIMD_TARGET_ICE 1
Expand All @@ -34,7 +39,9 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpass-failed"

#if !defined(__APPLE__)
#include <type_traits>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can not build without this include

FAILED: dbms/CMakeFiles/tiflash_vector_search.dir/src/VectorSearch/SIMDFeatures.cpp.o 
/usr/local/bin/ccache /usr/local/bin/clang++ -DFIU_ENABLE -DSERVERLESS_PROXY=0 -DTIFLASH_COMPILER_VPCLMULQDQ_SUPPORT=1 -DTIFLASH_ENABLE_AVX512_SUPPORT=1 -DTIFLASH_ENABLE_AVX_SUPPORT=1 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -I/home/jenkins/agent/workspace/tiflash-build-common/tiflash/dbms/src -isystem /home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/usearch/fp16/include -isystem /home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/usearch/include -isystem /home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/simsimd/include -isystem /home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/fmtlib-cmake/../fmtlib/include -Wthread-safety  -pipe -mssse3 -msse4.1 -msse4.2 -mpclmul -mpopcnt  -fno-omit-frame-pointer  -Wall -Wno-unused-command-line-argument  -Wnon-virtual-dtor  -stdlib=libc++ -Wextra -Werror  -O0 -fverbose-asm -fno-inline  -D_LIBCPP_DEBUG=0 -std=gnu++2b -MD -MT dbms/CMakeFiles/tiflash_vector_search.dir/src/VectorSearch/SIMDFeatures.cpp.o -MF dbms/CMakeFiles/tiflash_vector_search.dir/src/VectorSearch/SIMDFeatures.cpp.o.d -o dbms/CMakeFiles/tiflash_vector_search.dir/src/VectorSearch/SIMDFeatures.cpp.o -c /home/jenkins/agent/workspace/tiflash-build-common/tiflash/dbms/src/VectorSearch/SIMDFeatures.cpp
In file included from /home/jenkins/agent/workspace/tiflash-build-common/tiflash/dbms/src/VectorSearch/SIMDFeatures.cpp:16:
In file included from /home/jenkins/agent/workspace/tiflash-build-common/tiflash/dbms/src/VectorSearch/USearch.h:42:
/home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/usearch/include/usearch/index.hpp:362:54: error: 'scalar_at' does not refer to a value
  362 |         if (!std::is_trivially_default_constructible<scalar_at>::value)
      |                                                      ^
      /home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/usearch/include/usearch/index.hpp:355:20: note: declared here
  355 | template <typename scalar_at, typename allocator_at = std::allocator<scalar_at>> class buffer_gt {
      |                    ^
      /home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/usearch/include/usearch/index.hpp:362:19: error: no member named 'is_trivially_default_constructible' in namespace 'std'
  362 |         if (!std::is_trivially_default_constructible<scalar_at>::value)
      |              ~~~~~^
      /home/jenkins/agent/workspace/tiflash-build-common/tiflash/contrib/usearch/include/usearch/index.hpp:362:64: error: no member named 'value' in the global namespace; did you mean 'std::money_base::value'?
  362 |         if (!std::is_trivially_default_constructible<scalar_at>::value)
      |                                                                ^~
      /usr/local/bin/../include/c++/v1/locale:2573:43: note: 'std::money_base::value' declared here
 2573 |     enum part {none, space, symbol, sign, value};
      |          

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly I cannot build in MacOS if type_traits is not included as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix it in this PR: #9492

#endif
#include <usearch/index.hpp>
#include <usearch/index_dense.hpp>
#include <usearch/index_plugins.hpp>
Expand Down
1 change: 0 additions & 1 deletion release-centos7-llvm/scripts/run-clang-tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,4 @@ def main():


if __name__ == '__main__':
sys.exit(0)# temporary skip clang-tidy
main()