ashvardanian / StringZilla

Up to 10x faster strings for C, C++, Python, Rust, and Swift, leveraging SWAR and SIMD on Arm Neon and x86 AVX2 & AVX-512-capable chips to accelerate search, sort, edit distances, alignment scores, etc šŸ¦–
https://ashvardanian.com/posts/stringzilla/
Apache License 2.0
1.92k stars 64 forks source link

Doesn't build under FreeBSD 14-STABLE #144

Closed iron-udjin closed 3 months ago

iron-udjin commented 3 months ago
$ cmake ../
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- C Compiler ID: Clang
-- C Compiler Version: 17.0.6
-- C Compiler: /usr/bin/cc
-- C++ Compiler ID: Clang
-- C++ Compiler Version: 17.0.6
-- C++ Compiler: /usr/bin/c++
-- Build type: 
-- Pointer size: 64-bit
-- Setting build type to 'Release' as none was specified.
-- Performing Test supports_march_native
-- Performing Test supports_march_native - Success
-- Configuring done (1.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/iron/apps/StringZilla/build
$ make
[  3%] Building CXX object CMakeFiles/stringzilla_bench_search.dir/scripts/bench_search.cpp.o
In file included from /home/iron/apps/StringZilla/scripts/bench_search.cpp:13:
In file included from /home/iron/apps/StringZilla/scripts/bench.hpp:18:
/home/iron/apps/StringZilla/include/stringzilla/stringzilla.hpp:1112:30: fatal error: 'char_traits<const char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Wdeprecated-declarations]
 1112 |     using traits_type = std::char_traits<char_type_>;
      |                              ^
/home/iron/apps/StringZilla/include/stringzilla/stringzilla.hpp:1921:27: note: in instantiation of template class 'ashvardanian::stringzilla::basic_string_slice<const char>' requested here
 1921 |     void init(string_view other) noexcept(false) {
      |                           ^
/usr/include/c++/v1/__string/char_traits.h:79:8: note: 'char_traits<const char>' has been explicitly marked deprecated here
   79 | struct _LIBCPP_DEPRECATED_("char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it.")
      |        ^
/usr/include/c++/v1/__config:957:53: note: expanded from macro '_LIBCPP_DEPRECATED_'
  957 | #      define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
      |                                                     ^
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/iron/apps/StringZilla/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/iron/apps/StringZilla/build
*** Error code 1

Stop.
make: stopped in /usr/home/iron/apps/StringZilla/build

Do you need any other info?

iron-udjin commented 3 months ago

I could build it use:

$ env CXXFLAGS="-Wno-deprecated" cmake ../
ashvardanian commented 3 months ago

Thanks, @iron-udjin!

Apparently, the const part of char_type_ must be stripped off. Should be very easy to patch. Feel free to submit a PR, otherwise I can just patch it myself in a few hours šŸ¤—

iron-udjin commented 3 months ago

otherwise I can just patch it myself in a few hours

It would be better that you get patched it yourself. Afterwards, please let me know. I'll test it on 14-STABLE and other FreeBSD versions to make sure everything works fine.

Thank you!

ashvardanian commented 3 months ago

@iron-udjin can you check the main-dev branch? I am considering a few more patches before I merge this one šŸ¤—

iron-udjin commented 3 months ago

can you check the main-dev branch

Works fine on 14.0-STABLE and 13.3-STABLE. We can close this issue. Thank you for your work.

ashvardanian commented 3 months ago

:tada: This issue has been resolved in version 3.8.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: