usearch 2.9.1 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +50 -52
  2. package/javascript/{types → dist/cjs}/usearch.d.ts +90 -115
  3. package/javascript/dist/cjs/usearch.js +531 -0
  4. package/javascript/dist/esm/usearch.d.ts +212 -0
  5. package/javascript/{usearch.js → dist/esm/usearch.js} +202 -153
  6. package/package.json +25 -23
  7. package/prebuilds/darwin-arm64+x64/usearch.node +0 -0
  8. package/prebuilds/linux-arm64/usearch.node +0 -0
  9. package/prebuilds/linux-x64/usearch.node +0 -0
  10. package/prebuilds/win32-ia32/usearch.node +0 -0
  11. package/prebuilds/win32-x64/usearch.node +0 -0
  12. package/.clang-format +0 -10
  13. package/.clang-tidy +0 -60
  14. package/.cmake-format.py +0 -19
  15. package/.dockerignore +0 -93
  16. package/.gitattributes +0 -9
  17. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -90
  18. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  19. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -64
  20. package/.github/workflows/Dockerfile.libs +0 -36
  21. package/.github/workflows/prerelease.yml +0 -331
  22. package/.github/workflows/release.yml +0 -722
  23. package/.github/workflows/update_version.sh +0 -15
  24. package/.gitmodules +0 -9
  25. package/.releaserc +0 -90
  26. package/CITATION.cff +0 -11
  27. package/CMakeLists.txt +0 -324
  28. package/CODE_OF_CONDUCT.md +0 -128
  29. package/CONTRIBUTING.md +0 -353
  30. package/Cargo.toml +0 -19
  31. package/Dockerfile +0 -16
  32. package/VERSION +0 -1
  33. package/assets/unum.png +0 -0
  34. package/assets/usearch-approaches-transparent.png +0 -0
  35. package/assets/usearch-approaches-white.png +0 -0
  36. package/assets/usearch-neighbor-types.png +0 -0
  37. package/binding.gyp +0 -87
  38. package/build.gradle +0 -204
  39. package/build.rs +0 -18
  40. package/c/CMakeLists.txt +0 -25
  41. package/c/README.md +0 -34
  42. package/c/lib.cpp +0 -358
  43. package/c/test.c +0 -374
  44. package/c/usearch.h +0 -311
  45. package/cmake/clipp.cmake +0 -7
  46. package/cmake/config.cmake.in +0 -15
  47. package/cmake/emscripten.cmake +0 -8
  48. package/cmake/jemalloc.cmake +0 -62
  49. package/cmake/pkg-config.pc.in +0 -4
  50. package/cmake/usearchConfigVersion.cmake.in +0 -20
  51. package/conanfile.py +0 -26
  52. package/cpp/CMakeLists.txt +0 -14
  53. package/cpp/README.md +0 -161
  54. package/cpp/bench.cpp +0 -618
  55. package/cpp/test.cpp +0 -323
  56. package/fp16/CMakeLists.txt +0 -176
  57. package/fp16/LICENSE +0 -11
  58. package/fp16/README.md +0 -20
  59. package/fp16/bench/alt-element.cc +0 -89
  60. package/fp16/bench/from-alt-array.cc +0 -175
  61. package/fp16/bench/from-ieee-array.cc +0 -399
  62. package/fp16/bench/ieee-element.cc +0 -272
  63. package/fp16/bench/to-alt-array.cc +0 -91
  64. package/fp16/bench/to-ieee-array.cc +0 -303
  65. package/fp16/cmake/DownloadGoogleBenchmark.cmake +0 -15
  66. package/fp16/cmake/DownloadGoogleTest.cmake +0 -15
  67. package/fp16/cmake/DownloadPSimd.cmake +0 -15
  68. package/fp16/configure.py +0 -65
  69. package/fp16/confu.yaml +0 -8
  70. package/fp16/include/fp16/__init__.py +0 -0
  71. package/fp16/include/fp16/avx.py +0 -50
  72. package/fp16/include/fp16/avx2.py +0 -53
  73. package/fp16/include/fp16/bitcasts.h +0 -92
  74. package/fp16/include/fp16/fp16.h +0 -451
  75. package/fp16/include/fp16/psimd.h +0 -131
  76. package/fp16/include/fp16.h +0 -11
  77. package/fp16/jni/Android.mk +0 -6
  78. package/fp16/jni/Application.mk +0 -4
  79. package/fp16/test/alt-from-fp32-value.cc +0 -498
  80. package/fp16/test/alt-to-fp32-bits.cc +0 -263
  81. package/fp16/test/alt-to-fp32-psimd.cc +0 -145
  82. package/fp16/test/alt-to-fp32-value.cc +0 -348
  83. package/fp16/test/alt-to-fp32x2-psimd.cc +0 -245
  84. package/fp16/test/bitcasts.cc +0 -56
  85. package/fp16/test/ieee-from-fp32-value.cc +0 -523
  86. package/fp16/test/ieee-to-fp32-bits.cc +0 -333
  87. package/fp16/test/ieee-to-fp32-psimd.cc +0 -312
  88. package/fp16/test/ieee-to-fp32-value.cc +0 -420
  89. package/fp16/test/ieee-to-fp32x2-psimd.cc +0 -541
  90. package/fp16/test/peachpy/alt-xmm-to-fp32-xmm-avx.cc +0 -96
  91. package/fp16/test/peachpy/alt-xmm-to-fp32-ymm-avx2.cc +0 -96
  92. package/fp16/test/peachpy/stubs.py +0 -38
  93. package/fp16/test/tables.cc +0 -530
  94. package/fp16/test/tables.h +0 -13
  95. package/fp16/third-party/THHalf.h +0 -92
  96. package/fp16/third-party/eigen-half.h +0 -170
  97. package/fp16/third-party/float16-compressor.h +0 -80
  98. package/fp16/third-party/half.hpp +0 -2916
  99. package/fp16/third-party/npy-halffloat.h +0 -328
  100. package/include/usearch/index.hpp +0 -3836
  101. package/include/usearch/index_dense.hpp +0 -2004
  102. package/include/usearch/index_plugins.hpp +0 -2203
  103. package/javascript/lib.cpp +0 -341
  104. package/javascript/types/usearch.d.ts.map +0 -1
  105. package/javascript/usearch.test.js +0 -74
  106. package/package-ci.json +0 -10
  107. package/pyproject.toml +0 -51
  108. package/setup.py +0 -201
  109. package/simsimd/.releaserc +0 -86
  110. package/simsimd/Cargo.lock +0 -708
  111. package/simsimd/Cargo.toml +0 -36
  112. package/simsimd/LICENSE +0 -201
  113. package/simsimd/README.md +0 -275
  114. package/simsimd/binding.gyp +0 -36
  115. package/simsimd/build.rs +0 -20
  116. package/simsimd/include/simsimd/binary.h +0 -201
  117. package/simsimd/include/simsimd/probability.h +0 -548
  118. package/simsimd/include/simsimd/simsimd.h +0 -456
  119. package/simsimd/include/simsimd/spatial.h +0 -1175
  120. package/simsimd/include/simsimd/types.h +0 -207
  121. package/simsimd/javascript/bench.js +0 -127
  122. package/simsimd/javascript/fallback.ts +0 -193
  123. package/simsimd/javascript/lib.c +0 -102
  124. package/simsimd/javascript/node-gyp-build.d.ts +0 -1
  125. package/simsimd/javascript/simsimd.ts +0 -124
  126. package/simsimd/javascript/test.mjs +0 -153
  127. package/simsimd/javascript/tsconfig-base.json +0 -25
  128. package/simsimd/javascript/tsconfig-cjs.json +0 -8
  129. package/simsimd/javascript/tsconfig-esm.json +0 -8
  130. package/simsimd/package-lock.json +0 -1688
  131. package/simsimd/package.json +0 -61
  132. package/simsimd/rust/benches/cosine.rs +0 -27
  133. package/simsimd/rust/benches/native.rs +0 -27
  134. package/simsimd/rust/benches/sqeuclidean.rs +0 -27
  135. package/simsimd/rust/lib.c +0 -68
  136. package/simsimd/rust/lib.rs +0 -232
  137. package/sqlite/README.md +0 -178
  138. package/sqlite/lib.cpp +0 -325
  139. package/stringzilla/CONTRIBUTING.md +0 -429
  140. package/stringzilla/Cargo.lock +0 -25
  141. package/stringzilla/Cargo.toml +0 -26
  142. package/stringzilla/LICENSE +0 -201
  143. package/stringzilla/README.md +0 -1281
  144. package/stringzilla/VERSION +0 -1
  145. package/stringzilla/assets/cover-strinzilla.jpeg +0 -0
  146. package/stringzilla/assets/meme-stringzilla-v2.jpeg +0 -0
  147. package/stringzilla/assets/meme-stringzilla-v3.jpeg +0 -0
  148. package/stringzilla/binding.gyp +0 -16
  149. package/stringzilla/build.rs +0 -14
  150. package/stringzilla/c/lib.c +0 -304
  151. package/stringzilla/cli/README.md +0 -48
  152. package/stringzilla/cli/split.py +0 -72
  153. package/stringzilla/cli/wc.py +0 -37
  154. package/stringzilla/include/stringzilla/experimental.h +0 -724
  155. package/stringzilla/include/stringzilla/module.modulemap +0 -9
  156. package/stringzilla/include/stringzilla/stringzilla.h +0 -5240
  157. package/stringzilla/include/stringzilla/stringzilla.hpp +0 -3830
  158. package/stringzilla/javascript/lib.c +0 -125
  159. package/stringzilla/javascript/stringzilla.js +0 -22
  160. package/stringzilla/package-ci.json +0 -10
  161. package/stringzilla/package.json +0 -32
  162. package/stringzilla/rust/lib.rs +0 -362
  163. package/stringzilla/swift/StringProtocol+StringZilla.swift +0 -280
  164. package/stringzilla/swift/Test.swift +0 -60
  165. package/tsconfig.json +0 -21
  166. package/wasmer.toml +0 -12
  167. package/winlibinstaller.bat +0 -42
  168. /package/{simsimd/javascript/dist-package-cjs.json → javascript/dist/cjs/package.json} +0 -0
  169. /package/{simsimd/javascript/dist-package-esm.json → javascript/dist/esm/package.json} +0 -0
@@ -1,15 +0,0 @@
1
- #!/bin/sh
2
-
3
- echo $1 > VERSION &&
4
- sed -i "s/\"version\": \".*\"/\"version\": \"$1\"/" package.json &&
5
- sed -i "s/^version: .*/version: $1/" CITATION.cff &&
6
- sed -i "s/version = \".*\"/version = \"$1\"/" Cargo.toml &&
7
- sed -i "s/version = '.*'/version = '$1'/" conanfile.py &&
8
- sed -i "s/^\(#define USEARCH_VERSION_MAJOR \).*/\1$(echo "$1" | cut -d. -f1)/" ./include/usearch/index.hpp &&
9
- sed -i "s/^\(#define USEARCH_VERSION_MINOR \).*/\1$(echo "$1" | cut -d. -f2)/" ./include/usearch/index.hpp &&
10
- sed -i "s/^\(#define USEARCH_VERSION_PATCH \).*/\1$(echo "$1" | cut -d. -f3)/" ./include/usearch/index.hpp &&
11
- sed -i "s/<version>[0-9]\+\.[0-9]\+\.[0-9]\+/<version>$1/" README.md &&
12
- sed -i "s/version = {[0-9]\+\.[0-9]\+\.[0-9]\+}/version = {$1}/" README.md &&
13
- sed -i "s/>[0-9]\+\.[0-9]\+\.[0-9]\+<\/Version>/>$1<\/Version>/" ./csharp/nuget/nuget-package.props &&
14
- sed -i "s/VERSION [0-9]\+\.[0-9]\+\.[0-9]\+/VERSION $1/" CMakeLists.txt &&
15
- sed -i "s/version=\".*\"/version=\"$1\"/" wasmer.toml
package/.gitmodules DELETED
@@ -1,9 +0,0 @@
1
- [submodule "simsimd"]
2
- path = simsimd
3
- url = https://github.com/ashvardanian/simsimd
4
- [submodule "fp16"]
5
- path = fp16
6
- url = https://github.com/maratyszcza/fp16
7
- [submodule "stringzilla"]
8
- path = stringzilla
9
- url = https://github.com/ashvardanian/stringzilla
package/.releaserc DELETED
@@ -1,90 +0,0 @@
1
- {
2
- "branches": [
3
- "main"
4
- ],
5
- "debug": true,
6
- "ci": true,
7
- "dryRun": false,
8
- "plugins": [
9
- [
10
- "@semantic-release/commit-analyzer",
11
- {
12
- "preset": "eslint",
13
- "releaseRules": [
14
- {
15
- "tag": "Break",
16
- "release": "major"
17
- },
18
- {
19
- "tag": "Add",
20
- "release": "minor"
21
- },
22
- {
23
- "tag": "Improve",
24
- "release": "patch"
25
- },
26
- {
27
- "tag": "Make",
28
- "release": "patch"
29
- },
30
- {
31
- "tag": "Refactor",
32
- "release": false
33
- }
34
- ]
35
- }
36
- ],
37
- [
38
- "@semantic-release/release-notes-generator",
39
- {
40
- "preset": "eslint",
41
- "releaseRules": [
42
- {
43
- "tag": "Break",
44
- "release": "major"
45
- },
46
- {
47
- "tag": "Add",
48
- "release": "minor"
49
- },
50
- {
51
- "tag": "Improve",
52
- "release": "patch"
53
- },
54
- {
55
- "tag": "Make",
56
- "release": "patch"
57
- },
58
- {
59
- "tag": "Refactor",
60
- "release": false
61
- }
62
- ]
63
- }
64
- ],
65
- "@semantic-release/github",
66
- [
67
- "@semantic-release/exec",
68
- {
69
- "prepareCmd": "bash .github/workflows/update_version.sh '${nextRelease.version}'"
70
- }
71
- ],
72
- [
73
- "@semantic-release/git",
74
- {
75
- "assets": [
76
- "VERSION",
77
- "conanfile.py",
78
- "package.json",
79
- "Cargo.toml",
80
- "wasmer.toml",
81
- "./include/usearch/index.hpp",
82
- "README.md",
83
- "./csharp/nuget/nuget-package.props",
84
- "CITATION.cff"
85
- ],
86
- "message": "Build: Released ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
87
- }
88
- ]
89
- ]
90
- }
package/CITATION.cff DELETED
@@ -1,11 +0,0 @@
1
- cff-version: 1.2.0
2
- message: "If you use this software, please cite it as below."
3
- authors:
4
- - family-names: "Vardanian"
5
- given-names: "Ash"
6
- orcid: "https://orcid.org/0000-0002-4882-1815"
7
- title: "USearch by Unum Cloud"
8
- version: 2.9.1
9
- doi: 10.5281/zenodo.7949416
10
- date-released: 2023-10-22
11
- url: "https://github.com/unum-cloud/usearch"
package/CMakeLists.txt DELETED
@@ -1,324 +0,0 @@
1
- # This CMake file is heavily inspired by following `usearch` CMake:
2
- # https://github.com/nlohmann/json/blob/develop/CMakeLists.txt
3
- cmake_minimum_required(VERSION 3.1)
4
- project(
5
- usearch
6
- VERSION 2.7.2
7
- LANGUAGES C CXX
8
- )
9
-
10
- # Determine if USearch is built as a subproject (using `add_subdirectory`) or if it is the main project
11
- set(USEARCH_IS_MAIN_PROJECT OFF)
12
- if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
13
- set(USEARCH_IS_MAIN_PROJECT ON)
14
- endif ()
15
-
16
- # Allow CMake 3.13+ to override options when using FetchContent / add_subdirectory
17
- if (POLICY CMP0077)
18
- cmake_policy(SET CMP0077 NEW)
19
- endif ()
20
-
21
- # Options
22
- option(USEARCH_INSTALL "Install CMake targets" OFF)
23
-
24
- option(USEARCH_USE_OPENMP "Use OpenMP for a thread pool" OFF)
25
- option(USEARCH_USE_SIMSIMD "Use SimSIMD hardware-accelerated metrics" OFF)
26
- option(USEARCH_USE_JEMALLOC "Use JeMalloc for faster memory allocations" OFF)
27
- option(USEARCH_USE_FP16LIB "Use software emulation for half-precision types" ON)
28
-
29
- option(USEARCH_BUILD_TEST_CPP "Compile a native unit test in C++" ${USEARCH_IS_MAIN_PROJECT})
30
- option(USEARCH_BUILD_BENCH_CPP "Compile a native benchmark in C++" ${USEARCH_IS_MAIN_PROJECT})
31
- option(USEARCH_BUILD_LIB_C "Compile a native library for the C 99 interface" OFF)
32
- option(USEARCH_BUILD_TEST_C "Compile a test for the C 99 interface" OFF)
33
- option(USEARCH_BUILD_WOLFRAM "Compile Wolfram Language bindings" OFF)
34
-
35
- # Includes
36
- set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
37
- include(ExternalProject)
38
-
39
- # Configuration
40
- include(GNUInstallDirs)
41
- set(USEARCH_TARGET_NAME ${PROJECT_NAME})
42
- set(USEARCH_CONFIG_INSTALL_DIR
43
- "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}"
44
- CACHE INTERNAL ""
45
- )
46
- set(USEARCH_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
47
- set(USEARCH_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
48
- set(USEARCH_CMAKE_CONFIG_TEMPLATE "cmake/config.cmake.in")
49
- set(USEARCH_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}")
50
- set(USEARCH_CMAKE_VERSION_CONFIG_FILE "${USEARCH_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
51
- set(USEARCH_CMAKE_PROJECT_CONFIG_FILE "${USEARCH_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake")
52
- set(USEARCH_CMAKE_PROJECT_TARGETS_FILE "${USEARCH_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Targets.cmake")
53
- set(USEARCH_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/pkgconfig")
54
-
55
- # Define our header-only library
56
- add_library(${USEARCH_TARGET_NAME} INTERFACE)
57
- add_library(${PROJECT_NAME}::${USEARCH_TARGET_NAME} ALIAS ${USEARCH_TARGET_NAME})
58
- set(USEARCH_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/include/")
59
- if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
60
- target_compile_features(${USEARCH_TARGET_NAME} INTERFACE cxx_range_for)
61
- else ()
62
- target_compile_features(${USEARCH_TARGET_NAME} INTERFACE cxx_std_11)
63
- endif ()
64
-
65
- # Core compilation settings affecting "index.hpp"
66
- target_compile_definitions(
67
- ${USEARCH_TARGET_NAME} INTERFACE $<$<NOT:$<BOOL:${USEARCH_USE_OPENMP}>>:USEARCH_USE_OPENMP=0>
68
- )
69
-
70
- # Supplementary compilation settings affecting "index_plugins.hpp"
71
- target_compile_definitions(
72
- ${USEARCH_TARGET_NAME} INTERFACE $<$<NOT:$<BOOL:${USEARCH_USE_FP16LIB}>>:USEARCH_USE_FP16LIB=1>
73
- )
74
-
75
- target_compile_definitions(
76
- ${USEARCH_TARGET_NAME} INTERFACE $<$<NOT:$<BOOL:${USEARCH_USE_SIMSIMD}>>:USEARCH_USE_SIMSIMD=0>
77
- )
78
-
79
- target_include_directories(
80
- ${USEARCH_TARGET_NAME} ${USEARCH_SYSTEM_INCLUDE} INTERFACE $<BUILD_INTERFACE:${USEARCH_INCLUDE_BUILD_DIR}>
81
- $<INSTALL_INTERFACE:include>
82
- )
83
-
84
- # Install a pkg-config file, so other tools can find this
85
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc")
86
-
87
- # Install a custom package version config file instead of write_basic_package_version_file to ensure that it's
88
- # architecture-independent https://github.com/nlohmann/json/issues/1697
89
- include(CMakePackageConfigHelpers)
90
- configure_file("cmake/usearchConfigVersion.cmake.in" ${USEARCH_CMAKE_VERSION_CONFIG_FILE} @ONLY)
91
- configure_file(${USEARCH_CMAKE_CONFIG_TEMPLATE} ${USEARCH_CMAKE_PROJECT_CONFIG_FILE} @ONLY)
92
-
93
- if (USEARCH_INSTALL)
94
- install(DIRECTORY ${USEARCH_INCLUDE_BUILD_DIR} DESTINATION ${USEARCH_INCLUDE_INSTALL_DIR})
95
- install(FILES ${USEARCH_CMAKE_PROJECT_CONFIG_FILE} ${USEARCH_CMAKE_VERSION_CONFIG_FILE}
96
- DESTINATION ${USEARCH_CONFIG_INSTALL_DIR}
97
- )
98
- export(
99
- TARGETS ${USEARCH_TARGET_NAME}
100
- NAMESPACE ${PROJECT_NAME}::
101
- FILE ${USEARCH_CMAKE_PROJECT_TARGETS_FILE}
102
- )
103
- install(
104
- TARGETS ${USEARCH_TARGET_NAME}
105
- EXPORT ${USEARCH_TARGETS_EXPORT_NAME}
106
- INCLUDES
107
- DESTINATION ${USEARCH_INCLUDE_INSTALL_DIR}
108
- )
109
- install(
110
- EXPORT ${USEARCH_TARGETS_EXPORT_NAME}
111
- NAMESPACE ${PROJECT_NAME}::
112
- DESTINATION ${USEARCH_CONFIG_INSTALL_DIR}
113
- )
114
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" DESTINATION ${USEARCH_PKGCONFIG_INSTALL_DIR})
115
- endif ()
116
-
117
- # Find required packages
118
- if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
119
- set(CMAKE_THREAD_LIBS_INIT "-lpthread")
120
- set(CMAKE_HAVE_THREADS_LIBRARY 1)
121
- set(CMAKE_USE_WIN32_THREADS_INIT 0)
122
- set(CMAKE_USE_PTHREADS_INIT 1)
123
- set(THREADS_PREFER_PTHREAD_FLAG ON)
124
- endif ()
125
- find_package(Threads REQUIRED)
126
-
127
- if (USEARCH_USE_OPENMP)
128
- find_package(OpenMP REQUIRED)
129
- endif ()
130
-
131
- if (USEARCH_USE_JEMALLOC)
132
- include(jemalloc)
133
- endif ()
134
-
135
- # Set default build type to Release
136
- if (NOT CMAKE_BUILD_TYPE)
137
- set(CMAKE_BUILD_TYPE RelWithDebInfo)
138
- endif ()
139
-
140
- # Include directories
141
- set(USEARCH_HEADER_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/fp16/include"
142
- "${CMAKE_CURRENT_SOURCE_DIR}/simsimd/include"
143
- )
144
-
145
- # Function to setup target
146
- function (setup_target TARGET_NAME)
147
- # Compiler-specific options List of all possible compiler IDs:
148
- # https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
149
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
150
- target_compile_options(
151
- ${TARGET_NAME}
152
- PRIVATE $<$<CONFIG:RELEASE>:-O3>
153
- $<$<CONFIG:RELWITHDEBINFO>:-O3
154
- -g>
155
- $<$<CONFIG:DEBUG>:-g
156
- -fsanitize=address
157
- -fsanitize=leak
158
- -fsanitize=alignment
159
- -fsanitize=undefined
160
- >
161
- -ffast-math
162
- -fPIC
163
- -Wall
164
- -Wextra
165
- -Wno-conversion
166
- -Wno-unknown-pragmas
167
- -march=native
168
- -fmax-errors=1
169
- -pedantic
170
- -fdiagnostics-color=always
171
- -ftime-report
172
- )
173
- target_link_options(
174
- ${TARGET_NAME}
175
- PRIVATE
176
- $<$<CONFIG:DEBUG>:-g
177
- -fsanitize=address
178
- -fsanitize=leak
179
- -fsanitize=alignment
180
- -fsanitize=undefined
181
- >
182
- -fPIC
183
- )
184
-
185
- if (USEARCH_USE_OPENMP)
186
- target_link_libraries(${TARGET_NAME} PRIVATE OpenMP::OpenMP_CXX)
187
- endif ()
188
-
189
- target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads)
190
-
191
- elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
192
- target_compile_options(
193
- ${TARGET_NAME}
194
- PRIVATE $<$<CONFIG:RELEASE>:-O3>
195
- $<$<CONFIG:RELWITHDEBINFO>:-O3
196
- -g>
197
- $<$<CONFIG:DEBUG>:-g
198
- -fsanitize=address
199
- -fsanitize=alignment
200
- -fsanitize=undefined
201
- >
202
- -ffast-math
203
- -fPIC
204
- -pedantic
205
- -Wfatal-errors
206
- # Don't complain if the for-loops were not vectorzied
207
- -Wpass-failed=transform-warning
208
- -fcolor-diagnostics
209
- -ftime-trace
210
- )
211
- target_link_options(
212
- ${TARGET_NAME}
213
- PRIVATE
214
- $<$<CONFIG:DEBUG>:-g
215
- -fsanitize=address
216
- -fsanitize=alignment
217
- -fsanitize=undefined
218
- >
219
- -fPIC
220
- )
221
-
222
- # Check if the compiler is AppleClang, and if not, add the leak sanitizer
223
- if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
224
- # It's likely AppleClang Adjust options as needed for AppleClang
225
- else ()
226
- # It's likely LLVM Clang
227
- target_compile_options(${TARGET_NAME} PRIVATE $<$<CONFIG:DEBUG>:-fsanitize=leak>)
228
- target_link_options(${TARGET_NAME} PRIVATE $<$<CONFIG:DEBUG>:-fsanitize=leak>)
229
- endif ()
230
-
231
- if (USEARCH_USE_OPENMP)
232
- target_link_libraries(${TARGET_NAME} PRIVATE OpenMP::OpenMP_CXX)
233
- endif ()
234
-
235
- if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
236
- target_link_libraries(
237
- ${TARGET_NAME} PRIVATE "-framework CoreFoundation" "-framework Security" Threads::Threads
238
- )
239
- else ()
240
- target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads)
241
- endif ()
242
-
243
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVIDIA" OR CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")
244
- target_compile_options(${TARGET_NAME} PRIVATE $<$<CONFIG:RELEASE>:-O3>)
245
- target_compile_definitions(${TARGET_NAME} PRIVATE --expt-relaxed-constexpr --extended-lambda)
246
- set_property(SOURCE bench.cpp PROPERTY LANGUAGE CUDA)
247
- set_target_properties(${TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
248
- set_target_properties(${TARGET_NAME} PROPERTIES CUDA_ARCHITECTURES "86")
249
-
250
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
251
- target_compile_options(${TARGET_NAME} PRIVATE -w -ferror-limit=1)
252
-
253
- elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
254
- target_compile_options(
255
- ${TARGET_NAME} PRIVATE $<$<CONFIG:DEBUG>:/DEBUG> $<$<CONFIG:RELEASE>:/O2> $<$<CONFIG:RELWITHDEBINFO>:/O2
256
- /DEBUG>
257
- )
258
- endif ()
259
-
260
- target_include_directories(${TARGET_NAME} PRIVATE ${USEARCH_HEADER_INCLUDES})
261
- set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17)
262
-
263
- # On Windows, when using multi-configuration CMake builds, the paths will be nested, resulting in
264
- # "build_debug\Debug" on Windows instead of "build_debug". That's why we override all the configs to use the same
265
- # output directory.
266
- set_target_properties(
267
- ${TARGET_NAME}
268
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
269
- ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
270
- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
271
- )
272
- set_target_properties(
273
- ${TARGET_NAME}
274
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}"
275
- ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}"
276
- LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}"
277
- )
278
- set_target_properties(
279
- ${TARGET_NAME}
280
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}"
281
- ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}"
282
- LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}"
283
- )
284
- set_target_properties(
285
- ${TARGET_NAME}
286
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}"
287
- ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}"
288
- LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}"
289
- )
290
-
291
- # On Linux and MacOS our primary shared libraries for C are called `libusearch_c.so` and `libusearch_c.dylib`, while
292
- # on Windows the "lib" prefix might be missing by default, so let's ensure it's always there
293
- get_target_property(TARGET_TYPE ${TARGET_NAME} TYPE)
294
- if (TARGET_TYPE STREQUAL "SHARED_LIBRARY" OR TARGET_TYPE STREQUAL "STATIC_LIBRARY")
295
- set_target_properties(${TARGET_NAME} PROPERTIES PREFIX "lib")
296
- endif ()
297
-
298
- # Core compilation settings affecting "index.hpp"
299
- target_compile_definitions(${TARGET_NAME} PRIVATE $<$<NOT:$<BOOL:${USEARCH_USE_OPENMP}>>:USEARCH_USE_OPENMP=0>)
300
-
301
- # Supplementary compilation settings affecting "index_plugins.hpp"
302
- target_compile_definitions(
303
- ${TARGET_NAME} PRIVATE $<$<NOT:$<BOOL:${USEARCH_USE_FP16LIB}>>:USEARCH_USE_FP16LIB=1>
304
- )
305
-
306
- target_compile_definitions(${TARGET_NAME} PRIVATE $<$<NOT:$<BOOL:${USEARCH_USE_SIMSIMD}>>:USEARCH_USE_SIMSIMD=0>)
307
-
308
- endfunction ()
309
-
310
- if (${USEARCH_BUILD_TEST_CPP} OR ${USEARCH_BUILD_BENCH_CPP})
311
- add_subdirectory(cpp)
312
- endif ()
313
-
314
- if (${USEARCH_BUILD_WOLFRAM})
315
- add_subdirectory(wolfram)
316
- endif ()
317
-
318
- if (${USEARCH_BUILD_WASM})
319
- add_subdirectory(wasm)
320
- endif ()
321
-
322
- if (${USEARCH_BUILD_LIB_C} OR ${USEARCH_BUILD_TEST_C})
323
- add_subdirectory(c)
324
- endif ()
@@ -1,128 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, religion, or sexual identity
10
- and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the
26
- overall community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or
31
- advances of any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email
35
- address, without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official e-mail address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- info@unum.cloud.
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series
86
- of actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or
93
- permanent ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within
113
- the community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.0, available at
119
- https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
-
121
- Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
- enforcement ladder](https://github.com/mozilla/diversity).
123
-
124
- [homepage]: https://www.contributor-covenant.org
125
-
126
- For answers to common questions about this code of conduct, see the FAQ at
127
- https://www.contributor-covenant.org/faq. Translations are available at
128
- https://www.contributor-covenant.org/translations.