usearch icon indicating copy to clipboard operation
usearch copied to clipboard

Bug: Build optimization warning

Open sroussey opened this issue 2 years ago • 3 comments

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?

  • [X] I have searched the existing issues

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

sroussey avatar Jan 07 '24 18:01 sroussey

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 🤗

ashvardanian avatar Jan 09 '24 19:01 ashvardanian

I added that to bindings.gyp and no change.

sroussey avatar Jan 10 '24 18:01 sroussey

It is already in CMakeLists.txt

sroussey avatar Jan 10 '24 18:01 sroussey