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.26k stars 140 forks source link

Bug: compilation error on test.cpp #512

Open adolfogc opened 2 weeks ago

adolfogc commented 2 weeks ago

Describe the bug

1.251 FAILED: cpp/CMakeFiles/test_cpp.dir/test.cpp.o 
1.251 /usr/local/bin/clang++ -DUSEARCH_USE_FP16LIB=0 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -I/usearch/include -I/usearch/fp16/include -I/usearch/simsimd/include -I/usearch/cpp/../stringzilla/include --target=aarch64-amazon-linux -march=armv8.2-a+crypto -mtune=neoverse-n1 -mcpu=neoverse-n1+crypto -O3 -DNDEBUG -std=gnu++17 -O3 -ffast-math -fPIC -pedantic -Wfatal-errors -fcolor-diagnostics -Wno-vla -Wno-unused-function -Wno-cast-function-type -fopenmp=libomp -MD -MT cpp/CMakeFiles/test_cpp.dir/test.cpp.o -MF cpp/CMakeFiles/test_cpp.dir/test.cpp.o.d -o cpp/CMakeFiles/test_cpp.dir/test.cpp.o -c /usearch/cpp/test.cpp
1.251 In file included from /usearch/cpp/test.cpp:23:
1.251 /usearch/cpp/../stringzilla/include/stringzilla/stringzilla.hpp:1029:9: fatal error: cannot assign to non-static data member within const member function 'operator++'
1.251  1029 |         --ptr_;
1.251       |         ^ ~~~~
1.251 /usearch/cpp/../stringzilla/include/stringzilla/stringzilla.hpp:1027:27: note: member function 'ashvardanian::stringzilla::reversed_iterator_for::operator++' is declared const here
1.251  1027 |     reversed_iterator_for operator++(int) const noexcept {
1.251       |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.251 1 error generated.
1.251 ninja: build stopped: subcommand failed.

Steps to reproduce

RUN git clone --depth 1 --branch v2.15.3 https://github.com/unum-cloud/usearch.git
RUN cd usearch && git submodule update --init --recursive

RUN cd usearch && \
    mkdir build && \
    cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_EXE_LINKER_FLAGS="${LD_FLAGS}" \
        -DCMAKE_C_FLAGS="${C_FLAGS}" \
        -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" \
        -DUSEARCH_INSTALL=ON \
        -DUSEARCH_USE_OPENMP=ON \
        -DUSEARCH_USE_SIMSIMD=ON \
        -DUSEARCH_USE_FP16LIB=OFF \
        -USEARCH_BUILD_TEST_CPP=OFF \
        -DUSEARCH_BUILD_BENCH_CPP=OFF && \
    ninja -C build -j10 && \
    ninja -C build install

Expected behavior

Compiles without errors.

USearch version

2.15.3

Operating System

arm64v8/amazonlinux:2023

Hardware architecture

Arm

Which interface are you using?

C++ implementation

Contact Details

No response

Are you open to being tagged as a contributor?

Is there an existing issue for this?

Code of Conduct

adolfogc commented 2 weeks ago

Using Clang 19.1.2.

adolfogc commented 2 weeks ago

The issue resolves by checking out a newer version of Stringzilla (i.e. 0f762add5dc3da13dbe650fb46533777f0821f4a). Is there a reason for using 91d0a1a02faae90a41c60a30855d5935eb3eaef1 instead of a newer release?

ashvardanian commented 2 weeks ago

This is quite weird, will check! Thank you, @adolfogc!