Closed ashvardanian closed 1 month ago
I'm not seeing these warnings building usearch on a c7g instance. The only warning I see is unused-function:
In file included from /home/ubuntu/usearch/simsimd/include/simsimd/simsimd.h:106:
/home/ubuntu/usearch/simsimd/include/simsimd/probability.h:71:21: warning: ‘simsimd_kl_f16_haswell’ declared ‘static’ but never defined [-Wunused-function]
71 | SIMSIMD_PUBLIC void simsimd_kl_f16_haswell(simsimd_f16_t const* a, simsimd_f16_t const* b, simsimd_size_t n, simsimd_distance_t* divergence);
Which GCC version are you running? Can you also try building the Python bindings, @MarkReedZ?
Was this a compiler bug perhaps?
PR with the warning workaround removed: https://github.com/ashvardanian/SimSIMD/pull/164
I've removed the warning workaround for __ARM_ARCH
and I no longer see any warnings. If it was a bug on an older compiler and we want to keep the warning workaround we can alternatively just add #undef __ARM_ARCH
each time that we set __ARM_ARCH:
Alternative fix if we want to keep the warning workaround:
#if defined(SIMSIMD_DEFAULT_TARGET_ARM)
#undef __ARM_ARCH
#define __ARM_ARCH SIMSIMD_DEFAULT_TARGET_ARM
#undef SIMSIMD_DEFAULT_TARGET_ARM
#endif
I was able to reproduce and confirm both fixes with a new c7g instance and the following commands. Note I did not build usearch this time.
sudo apt-get update && sudo apt-get install cmake build-essential libjemalloc-dev g++-13 gcc-13
git clone https://github.com/ashvardanian/SimSIMD.git
cd SimSIMD/
git checkout main-dev
sudo apt install libopenblas-dev
cmake -D CMAKE_BUILD_TYPE=Release -D SIMSIMD_BUILD_TESTS=1 -D SIMSIMD_BUILD_BENCHMARKS=1 -D SIMSIMD_BUILD_BENCHMARKS_WITH_CBLAS=1 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -B bld
cmake --build bld --config Release
I'm happy to try different setups if you have a suggestion as to what to try. I just noticed you added this recently - do you recall the setup? https://github.com/ashvardanian/SimSIMD/commit/e975cc9e
e975cc9e include/simsimd/simsimd.h (Ash Vardanian 2024-08-26 18:06:17 +0000 107) #define SIMSIMD_DEFAULT_TARGET_ARM __ARM_ARCH
It could be Clang or Apple Clang or GCC 12/13. Can try again in a couple of days.
I'll play around Sunday. Adding the undefs has to be the answer then, but I'd like to see the original issue. Has to be a bug, but I don't see anyone else hitting anything like it. The gnu code looks fine to me - I can't see it throwing this warning on push/pop.
No warnings with my branch on Graviton3 with clang 18.1, gcc 12, or gcc 13. Will revisit this when I have more test environments setup.
git clone https://github.com/MarkReedZ/SimSIMD.git
cd SimSIMD/
git fetch && git checkout redefinition_fix
Let's close this for now and re-open if someone complains 😉
When compiling for Arm, pushing and popping attributes like we do causes warnings like: