unum-cloud / usearch

Fast Open-Source Search & Clustering engine × for Vectors & 🔜 Strings × in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram 🔍
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.27k stars 142 forks source link

Bug: Build optimization warning #333

Open sroussey opened 10 months ago

sroussey commented 10 months ago

Describe the bug

It is a warning "loop not vectorized" which normally I would ignore, but since this lib is all about vectorizing for speed I think it is unexpected.

Steps to reproduce

npm install

Expected behavior

no warning. Instead I get this:

warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
  CXX(target) Release/obj.target/usearch/javascript/lib.o
In file included from ../javascript/lib.cpp:18:
In file included from ../include/usearch/index_dense.hpp:10:
../include/usearch/index_plugins.hpp:1208:9: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
        for (std::size_t i = 0; i != dim; ++i) {

USearch version

main

Operating System

MacOS 14.2.1 / Darwin 23.2.0 arm64 arm

Hardware architecture

Arm

Which interface are you using?

C++ implementation

Contact Details

No response

Is there an existing issue for this?

Code of Conduct

ashvardanian commented 10 months ago

Yes, that's a common warning. I think the CMakeLists.txt, setup.py and bindings.gyp should be updated to add the -Wpass-failed=transform-warning flag for warnings, as mentioned in your log. @sroussey does that help? Would you be able to open a PR? Thanks 🤗

sroussey commented 10 months ago

I added that to bindings.gyp and no change.

sroussey commented 10 months ago

It is already in CMakeLists.txt