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
package/CONTRIBUTING.md DELETED
@@ -1,353 +0,0 @@
1
- # Contribution Guide
2
-
3
- Thank you for coming here!
4
- It's always nice to have third-party contributors 🤗
5
-
6
- ---
7
-
8
- To keep the quality of the code high, we have a set of guidelines common to [all Unum projects](https://github.com/unum-cloud).
9
-
10
- - [What's the procedure?](https://github.com/unum-cloud/awesome/blob/main/Workflow.md#organizing-software-development)
11
- - [How to organize branches?](https://github.com/unum-cloud/awesome/blob/main/Workflow.md#branches)
12
- - [How to style commits?](https://github.com/unum-cloud/awesome/blob/main/Workflow.md#commits)
13
-
14
- ## Before you start
15
-
16
- Before building the first time, please pull `git` submodules.
17
- That's how we bring in SimSIMD and other optional dependencies to test all of the available functionality.
18
-
19
- ```sh
20
- git submodule update --init --recursive
21
- ```
22
-
23
- ## C++ 11 and C 99
24
-
25
- Our primary C++ implementation uses CMake for builds.
26
- If this is your first experience with CMake, use the following commands to get started:
27
-
28
- ```sh
29
- sudo apt-get update && sudo apt-get install cmake build-essential libjemalloc-dev g++-12 gcc-12 # Ubuntu
30
- brew install libomp llvm # MacOS
31
- ```
32
-
33
- Using modern syntax, this is how you build and run the test suite:
34
-
35
- ```sh
36
- cmake -DUSEARCH_BUILD_TEST_CPP=1 -B ./build_debug
37
- cmake --build ./build_debug --config Debug
38
- ./build_debug/test_cpp
39
- ```
40
-
41
- The CMakeLists.txt file has a number of options you can pass:
42
-
43
- - What to build:
44
- - `USEARCH_BUILD_TEST_CPP` - build the C++ test suite
45
- - `USEARCH_BUILD_BENCH_CPP` - build the C++ benchmark suite
46
- - `USEARCH_BUILD_LIB_C` - build the C library
47
- - `USEARCH_BUILD_TEST_C` - build the C test suite
48
- - Which dependencies to use:
49
- - `USEARCH_USE_OPENMP` - use OpenMP for parallelism
50
- - `USEARCH_USE_SIMSIMD` - use SimSIMD for vectorization
51
- - `USEARCH_USE_JEMALLOC` - use Jemalloc for memory management
52
- - `USEARCH_USE_FP16LIB` - use software emulation for half-precision floating point
53
-
54
- Putting all of this together on Ubuntu and compiling the "release" version using the GCC 12 compiler:
55
-
56
- ```sh
57
- cmake \
58
- -DCMAKE_BUILD_TYPE=Release \
59
- -DCMAKE_C_COMPILER=gcc-12 \
60
- -DCMAKE_CXX_COMPILER=g++-12 \
61
- -DUSEARCH_USE_FP16LIB=1 \
62
- -DUSEARCH_USE_OPENMP=1 \
63
- -DUSEARCH_USE_SIMSIMD=1 \
64
- -DUSEARCH_USE_JEMALLOC=1 \
65
- -DUSEARCH_BUILD_TEST_CPP=1 \
66
- -DUSEARCH_BUILD_BENCH_CPP=1 \
67
- -DUSEARCH_BUILD_LIB_C=1 \
68
- -DUSEARCH_BUILD_TEST_C=1 \
69
- -B ./build_release
70
-
71
- cmake --build ./build_release --config Release
72
- ./build_release/test_cpp
73
- ./build_release/test_c
74
- ```
75
-
76
- Similarly, to use the most recent Clang compiler version from HomeBrew on MacOS:
77
-
78
- ```sh
79
- cmake \
80
- -DCMAKE_BUILD_TYPE=Release \
81
- -DCMAKE_C_COMPILER="/opt/homebrew/opt/llvm/bin/clang" \
82
- -DCMAKE_CXX_COMPILER="/opt/homebrew/opt/llvm/bin/clang++" \
83
- -DUSEARCH_USE_FP16LIB=1 \
84
- -DUSEARCH_USE_OPENMP=1 \
85
- -DUSEARCH_USE_SIMSIMD=1 \
86
- -DUSEARCH_USE_JEMALLOC=1 \
87
- -DUSEARCH_BUILD_TEST_CPP=1 \
88
- -DUSEARCH_BUILD_BENCH_CPP=1 \
89
- -DUSEARCH_BUILD_LIB_C=1 \
90
- -DUSEARCH_BUILD_TEST_C=1 \
91
- -B ./build_release
92
-
93
- cmake --build ./build_release --config Release
94
- ./build_release/test_cpp
95
- ./build_release/test_c
96
- ```
97
-
98
- Linting:
99
-
100
- ```sh
101
- cppcheck --enable=all --force --suppress=cstyleCast --suppress=unusedFunction \
102
- include/usearch/index.hpp \
103
- include/index_dense.hpp \
104
- include/index_plugins.hpp
105
- ```
106
-
107
- ## Python 3
108
-
109
- Python bindings are built using PyBind11 and are available on [PyPi](https://pypi.org/project/usearch/).
110
- The compilation settings are controlled by the `setup.py` and are independent from CMake used for C/C++ builds.
111
- Use PyTest to validate the build.
112
-
113
- - The `-s` option will disable capturing the logs.
114
- - The `-x` option will exit after first failure to simplify debugging.
115
-
116
- ```sh
117
- pip install -e . && pytest python/scripts/ -s -x
118
- ```
119
-
120
- Linting:
121
-
122
- ```sh
123
- pip install ruff
124
- ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 python
125
- ```
126
-
127
- Before merging your changes you may want to test your changes against the entire matrix of Python versions USearch supports.
128
- For that you need the `cibuildwheel`, which is tricky to use on MacOS and Windows, as it would target just the local environment.
129
- Still, if you have Docker running on any desktop OS, you can use it to build and test the Python bindings for all Python versions for Linux:
130
-
131
- ```sh
132
- pip install cibuildwheel
133
- cibuildwheel
134
- cibuildwheel --platform linux # works on any OS and builds all Linux backends
135
- cibuildwheel --platform linux --archs x86_64 # 64-bit x86, the most common on desktop and servers
136
- cibuildwheel --platform linux --archs aarch64 # 64-bit Arm for mobile devices, Apple M-series, and AWS Graviton
137
- cibuildwheel --platform linux --archs i686 # 32-bit Linux
138
- cibuildwheel --platform linux --archs s390x # emulating big-endian IBM Z
139
- cibuildwheel --platform macos # works only on MacOS
140
- cibuildwheel --platform windows # works only on Windows
141
- ```
142
-
143
- You may need root previligies for multi-architecture builds:
144
-
145
- ```sh
146
- sudo $(which cibuildwheel) --platform linux
147
- ```
148
-
149
- On Windows and MacOS, to avoid frequent path resolution issues, you may want to use:
150
-
151
- ```sh
152
- python -m cibuildwheel --platform windows
153
- ```
154
-
155
- ## JavaScript
156
-
157
- USearch provides NAPI bindings for NodeJS available on [NPM](https://www.npmjs.com/package/usearch).
158
- The compilation settings are controlled by the `binding.gyp` and are independent from CMake used for C/C++ builds.
159
-
160
- ```sh
161
- npm install
162
- node --test ./javascript/usearch.test.js
163
- npm publish
164
- ```
165
-
166
- To compile for AWS Lambda you'd need to recompile the binding.
167
- You can test the setup locally, overriding some of the compilation variables in Docker image:
168
-
169
- ```Dockerfile
170
- FROM public.ecr.aws/lambda/nodejs:18-x86_64
171
- RUN npm init -y
172
- RUN yum install tar git python3 cmake gcc-c++ -y && yum groupinstall "Development Tools" -y
173
-
174
- # Assuming AWS Linux 2 uses old compilers:
175
- ENV USEARCH_USE_FP16LIB 1
176
- ENV DUSEARCH_USE_SIMSIMD 1
177
- ENV SIMSIMD_TARGET_X86_AVX2 1
178
- ENV SIMSIMD_TARGET_X86_AVX512 0
179
- ENV SIMSIMD_TARGET_ARM_NEON 1
180
- ENV SIMSIMD_TARGET_ARM_SVE 0
181
-
182
- # For specific PR:
183
- # RUN npm install --build-from-source unum-cloud/usearch#pull/302/head
184
- # For specific version:
185
- # RUN npm install --build-from-source usearch@2.8.8
186
- RUN npm install --build-from-source usearch
187
- ```
188
-
189
- To compile to WebAssembly make sure you have `emscripten` installed and run the following script:
190
-
191
- ```sh
192
- emcmake cmake -B ./build -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -s TOTAL_MEMORY=64MB" && emmake make -C ./build
193
- node ./build/usearch.test.js
194
- ```
195
-
196
- If you don't yet have `emcmake` installed:
197
-
198
- ```sh
199
- git clone https://github.com/emscripten-core/emsdk.git && ./emsdk/emsdk install latest && ./emsdk/emsdk activate latest && source ./emsdk/emsdk_env.sh
200
- ```
201
-
202
- ## Rust
203
-
204
- USearch provides Rust bindings available on [Crates.io](https://crates.io/crates/usearch).
205
- The compilation settings are controlled by the `build.rs` and are independent from CMake used for C/C++ builds.
206
-
207
- ```sh
208
- cargo test -p usearch
209
- cargo publish
210
- ```
211
-
212
- ## Objective-C and Swift
213
-
214
- USearch provides both Objective-C and Swift bindings through the [Swift Package Manager](https://swiftpackageindex.com/unum-cloud/usearch).
215
- The compilation settings are controlled by the `Package.swift` and are independent from CMake used for C/C++ builds.
216
-
217
- ```sh
218
- swift build
219
- swift test -v
220
- ```
221
-
222
- ## GoLang
223
-
224
- USearch provides GoLang bindings, that depend on the C library that must be installed beforehand.
225
- So one should first compile the C library, link it with GoLang, and only then run tests.
226
-
227
- ```sh
228
- cmake -B ./build_release -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1
229
- cmake --build ./build_release --config Release -j
230
-
231
- mv ./c/libusearch_c.so ./golang/ # or .dylib to install the library on MacOS
232
- cp ./c/usearch.h ./golang/ # to make the header available to GoLang
233
-
234
- cd golang && go test -v ; cd ..
235
- ```
236
-
237
- ## Java
238
-
239
- USearch provides Java bindings available from the [GitHub Maven registry](https://github.com/unum-cloud/usearch/packages/1867475) and the [Sonatype Maven Central Repository](https://central.sonatype.com/artifact/cloud.unum/usearch).
240
- The compilation settings are controlled by the `build.gradle` and are independent from CMake used for C/C++ builds.
241
-
242
- To setup the Gradle environment:
243
-
244
- ```sh
245
- sudo apt get install zip unzip
246
- curl -s "https://get.sdkman.io" | bash
247
- sdk install java gradle
248
- ```
249
-
250
- Afterwards, in a new terminal:
251
-
252
- ```sh
253
- gradle clean build
254
- gradle test
255
- ```
256
-
257
- Alternatively, to run the `Index.main`:
258
-
259
- ```sh
260
- java -cp "$(pwd)/build/classes/java/main" -Djava.library.path="$(pwd)/build/libs/usearch/shared" java/cloud/unum/usearch/Index.java
261
- ```
262
-
263
- Or step by-step:
264
-
265
- ```sh
266
- cd java/cloud/unum/usearch
267
- javac -h . Index.java NativeUtils.java
268
-
269
- # Ensure JAVA_HOME system environment variable has been set
270
- # e.g. export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
271
-
272
- # Ubuntu:
273
- g++ -c -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I../../../../include cloud_unum_usearch_Index.cpp -o cloud_unum_usearch_Index.o
274
- g++ -shared -fPIC -o libusearch.so cloud_unum_usearch_Index.o -lc
275
-
276
- # Windows
277
- g++ -c -I%JAVA_HOME%\include -I%JAVA_HOME%\include\win32 cloud_unum_usearch_Index.cpp -I..\..\..\..\include -o cloud_unum_usearch_Index.o
278
- g++ -shared -o USearchJNI.dll cloud_unum_usearch_Index.o -Wl,--add-stdcall-alias
279
-
280
- # MacOS
281
- g++ -std=c++11 -c -fPIC \
282
- -I../../../../include \
283
- -I../../../../fp16/include \
284
- -I../../../../simsimd/include \
285
- -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin cloud_unum_usearch_Index.cpp -o cloud_unum_usearch_Index.o
286
- g++ -dynamiclib -o libusearch.dylib cloud_unum_usearch_Index.o -lc
287
-
288
- # Run linking to that directory
289
- cd ../../../..
290
- cp cloud/unum/usearch/libusearch.* .
291
- java -cp . -Djava.library.path="$(pwd)" cloud.unum.usearch.Index
292
- ```
293
-
294
- ## C#
295
-
296
- Setup the .NET environment:
297
-
298
- ```sh
299
- dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org
300
- ```
301
-
302
- USearch provides CSharp bindings, that depend on the C library that must be installed beforehand.
303
- So one should first compile the C library, link it with CSharp, and only then run tests.
304
-
305
- ```sh
306
- cmake -B ./build_artifacts -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1
307
- cmake --build ./build_artifacts --config Release -j
308
- ```
309
-
310
- Then, on Windows, copy the library to the CSharp project and run the tests:
311
-
312
- ```sh
313
- mkdir -p ".\csharp\lib\runtimes\win-x64\native"
314
- cp ".\build_artifacts\libusearch_c.dll" ".\csharp\lib\runtimes\win-x64\native"
315
- cd csharp
316
- dotnet test -c Debug --logger "console;verbosity=detailed"
317
- dotnet test -c Release
318
- ```
319
-
320
- ## Wolfram
321
-
322
- ```sh
323
- brew install --cask wolfram-engine
324
- ```
325
-
326
- ## Docker
327
-
328
- ```sh
329
- docker build -t unum/usearch . && docker run unum/usearch
330
- ```
331
-
332
- For multi-architecture builds and publications:
333
-
334
- ```sh
335
- version=$(cat VERSION)
336
- docker buildx create --use &&
337
- docker login &&
338
- docker buildx build \
339
- --platform "linux/amd64,linux/arm64" \
340
- --build-arg version=$version \
341
- --file Dockerfile \
342
- --tag unum/usearch:$version \
343
- --tag unum/usearch:latest \
344
- --push .
345
- ```
346
-
347
- ## Working on Sub-Modules
348
-
349
- Extending metrics in SimSIMD:
350
-
351
- ```sh
352
- git push --set-upstream https://github.com/ashvardanian/simsimd.git HEAD:main
353
- ```
package/Cargo.toml DELETED
@@ -1,19 +0,0 @@
1
- [package]
2
- name = "usearch"
3
- version = "2.9.1"
4
- authors = ["Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
- description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
- edition = "2021"
7
- license = "Apache-2.0"
8
- publish = true
9
- repository = "https://github.com/unum-cloud/usearch"
10
-
11
- [lib]
12
- name = "usearch"
13
- path = "rust/lib.rs"
14
-
15
- [dependencies]
16
- cxx = "1.0"
17
-
18
- [build-dependencies]
19
- cxx-build = "1.0"
package/Dockerfile DELETED
@@ -1,16 +0,0 @@
1
- # syntax=docker/dockerfile:1
2
-
3
- FROM ubuntu:23.04
4
- ENV DEBIAN_FRONTEND=noninteractive
5
-
6
- RUN apt-get update && \
7
- apt-get install -y --no-install-recommends python3.11 python3-pip && \
8
- apt-get clean && \
9
- rm -rf /var/lib/apt/lists/*
10
- RUN pip3 install --no-cache-dir --break-system-packages ucall usearch
11
-
12
- WORKDIR /usearch
13
- COPY python/usearch/server.py server.py
14
-
15
- ENTRYPOINT ["python3", "./server.py"]
16
- EXPOSE 8545
package/VERSION DELETED
@@ -1 +0,0 @@
1
- 2.9.1
package/assets/unum.png DELETED
Binary file
Binary file
Binary file
package/binding.gyp DELETED
@@ -1,87 +0,0 @@
1
- {
2
- "targets": [
3
- {
4
- "target_name": "usearch",
5
- "sources": ["javascript/lib.cpp"],
6
- "cflags": [
7
- "-fexceptions",
8
- "-Wno-unknown-pragmas",
9
- "-Wno-maybe-uninitialized",
10
- ],
11
- "cflags_cc": [
12
- "-fexceptions",
13
- "-Wno-unknown-pragmas",
14
- "-Wno-maybe-uninitialized",
15
- "-std=c++17",
16
- ],
17
- "include_dirs": [
18
- "<!@(node -p \"require('node-addon-api').include\")",
19
- "include",
20
- "fp16/include",
21
- "simsimd/include",
22
- ],
23
- "dependencies": ["<!(node -p \"require('node-addon-api').gyp\")"],
24
- "xcode_settings": {
25
- "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
26
- "CLANG_CXX_LIBRARY": "libc++",
27
- "MACOSX_DEPLOYMENT_TARGET": "10.15",
28
- },
29
- "msvs_settings": {
30
- "VCCLCompilerTool": {
31
- "ExceptionHandling": 1,
32
- "AdditionalOptions": ["-std:c++17"],
33
- }
34
- },
35
- "conditions": [
36
- [
37
- 'OS=="linux"',
38
- {
39
- "cflags_cc": [
40
- '<!(if [ "$USEARCH_USE_OPENMP" = "1" ]; then echo \'-fopenmp\'; fi)',
41
- ],
42
- "ldflags": [
43
- '<!(if [ "$USEARCH_USE_OPENMP" = "1" ]; then echo \'-lgomp\'; fi)'
44
- ],
45
- "defines": [
46
- "USEARCH_USE_OPENMP=<!(echo ${USEARCH_USE_OPENMP:-0})",
47
- "USEARCH_USE_SIMSIMD=<!(echo ${USEARCH_USE_SIMSIMD:-1})",
48
- "USEARCH_USE_FP16LIB=<!(echo ${USEARCH_USE_FP16LIB:-1})",
49
- "SIMSIMD_TARGET_X86_AVX512=<!(echo ${SIMSIMD_TARGET_X86_AVX512:-1})",
50
- "SIMSIMD_TARGET_ARM_SVE=<!(echo ${SIMSIMD_TARGET_ARM_SVE:-1})",
51
- "SIMSIMD_TARGET_X86_AVX2=<!(echo ${SIMSIMD_TARGET_X86_AVX2:-1})",
52
- "SIMSIMD_TARGET_ARM_NEON=<!(echo ${SIMSIMD_TARGET_ARM_NEON:-1})",
53
- ],
54
- },
55
- ],
56
- [
57
- 'OS=="mac"',
58
- {
59
- "defines": [
60
- "USEARCH_USE_OPENMP=<!(echo ${USEARCH_USE_OPENMP:-0})",
61
- "USEARCH_USE_SIMSIMD=<!(echo ${USEARCH_USE_SIMSIMD:-0})",
62
- "USEARCH_USE_FP16LIB=<!(echo ${USEARCH_USE_FP16LIB:-1})",
63
- "SIMSIMD_TARGET_X86_AVX512=<!(echo ${SIMSIMD_TARGET_X86_AVX512:-0})",
64
- "SIMSIMD_TARGET_ARM_SVE=<!(echo ${SIMSIMD_TARGET_ARM_SVE:-0})",
65
- "SIMSIMD_TARGET_X86_AVX2=<!(echo ${SIMSIMD_TARGET_X86_AVX2:-1})",
66
- "SIMSIMD_TARGET_ARM_NEON=<!(echo ${SIMSIMD_TARGET_ARM_NEON:-1})",
67
- ],
68
- },
69
- ],
70
- [
71
- 'OS=="win"',
72
- {
73
- "defines": [
74
- "USEARCH_USE_OPENMP=0",
75
- "USEARCH_USE_SIMSIMD=0",
76
- "USEARCH_USE_FP16LIB=1",
77
- "SIMSIMD_TARGET_X86_AVX512=0",
78
- "SIMSIMD_TARGET_ARM_SVE=0",
79
- "SIMSIMD_TARGET_X86_AVX2=0",
80
- "SIMSIMD_TARGET_ARM_NEON=0",
81
- ],
82
- },
83
- ],
84
- ],
85
- }
86
- ]
87
- }
package/build.gradle DELETED
@@ -1,204 +0,0 @@
1
- import org.gradle.internal.jvm.Jvm
2
-
3
- plugins {
4
- id 'java-library'
5
- id 'cpp'
6
- id 'maven-publish'
7
- id 'signing'
8
- }
9
-
10
- group "cloud.unum"
11
- version = file("VERSION").text.trim()
12
-
13
- sourceCompatibility = 1.8
14
- targetCompatibility = 1.8
15
-
16
- repositories {
17
- mavenCentral()
18
- }
19
-
20
- sourceSets {
21
- main {
22
- java {
23
- srcDir "java/"
24
- exclude "test/"
25
- }
26
- // Ensure native libraries are included in the main source set
27
- resources {
28
- srcDirs "$buildDir/libs"
29
- include "usearch/**"
30
- }
31
- }
32
- test {
33
- java {
34
- srcDir "java/test"
35
- }
36
- }
37
- }
38
-
39
- task sourcesJar(type: Jar, dependsOn: classes) {
40
- archiveClassifier.set('sources')
41
- from sourceSets.main.allSource
42
- }
43
-
44
- task javadocJar(type: Jar, dependsOn: javadoc) {
45
- archiveClassifier.set('javadoc')
46
- from javadoc.destinationDir
47
- }
48
-
49
- dependencies {
50
- testImplementation('junit:junit:4.13.2')
51
- }
52
-
53
- model {
54
-
55
- components {
56
- usearch(NativeLibrarySpec) {
57
- sources {
58
- cpp {
59
- source {
60
- srcDirs "java/cloud/unum/usearch"
61
- include "**/*.cpp"
62
- }
63
- exportedHeaders {
64
- srcDirs "include", "fp16/include", "simsimd/include", "${Jvm.current().javaHome}/include"
65
- }
66
- }
67
- }
68
- binaries.withType(StaticLibraryBinarySpec) {
69
- buildable = false
70
- }
71
- binaries.withType(SharedLibraryBinarySpec) {
72
- if (targetPlatform.operatingSystem.linux) {
73
- cppCompiler.args '-I', "${Jvm.current().javaHome}/include/linux"
74
- cppCompiler.args '-D_FILE_OFFSET_BITS=64'
75
- cppCompiler.args '-std=c++11'
76
- } else if (targetPlatform.operatingSystem.macOsX) {
77
- cppCompiler.args '-I', "${Jvm.current().javaHome}/include/darwin"
78
- cppCompiler.args '-D_FILE_OFFSET_BITS=64'
79
- cppCompiler.args '-std=c++11'
80
- } else if (targetPlatform.operatingSystem.windows){
81
- cppCompiler.args "-I${Jvm.current().javaHome}/include/win32"
82
- cppCompiler.args '/std:c++11'
83
- }
84
- }
85
- }
86
- }
87
-
88
- toolChains {
89
- gcc(Gcc) {
90
- target("linux_aarch64") {
91
- cppCompiler.withArguments { args ->
92
- args << "-march=armv8-a"
93
- }
94
- }
95
- }
96
- }
97
- }
98
-
99
- test {
100
- forkEvery 1
101
-
102
- dependsOn jar
103
-
104
- // Rearrange test classpath, add compiled JAR instead of main classes
105
- classpath = project.sourceSets.test.output + configurations.testRuntimeClasspath + files(jar.archiveFile)
106
-
107
- // Enable detailed test logging
108
- testLogging {
109
- // Ensure that we get output from all tests, not just failing ones
110
- showStandardStreams = true
111
- exceptionFormat = 'full' // Can be 'short', 'full', or 'summary'
112
-
113
- // More detailed test result logging
114
- events "passed", "skipped", "failed"
115
- }
116
- }
117
-
118
- jar {
119
- dependsOn("usearchSharedLibrary")
120
- from("$buildDir/libs/usearch/shared") {
121
- include "libusearch.so", "libusearch.dylib", "libusearch.dll"
122
- into "usearch"
123
- }
124
- from sourceSets.main.output
125
- }
126
-
127
- signing {
128
- def signingKey = findProperty("signingKey")
129
- def signingPassword = findProperty("signingPassword")
130
- useInMemoryPgpKeys(signingKey, signingPassword)
131
- sign publishing.publications
132
- }
133
-
134
- publishing {
135
- publications {
136
- library(MavenPublication) {
137
- from components.java
138
-
139
- artifact sourcesJar
140
- artifact javadocJar
141
-
142
- signing {
143
- sign publishing.publications.library
144
- }
145
-
146
- pom {
147
- name = "USearch"
148
- description = "Smaller & Faster Single-File Vector Search Engine from Unum"
149
- url = "https://github.com/unum-cloud/usearch"
150
-
151
- licenses {
152
- license {
153
- name = 'The Apache License, Version 2.0'
154
- url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
155
- }
156
- }
157
-
158
- scm {
159
- connection = 'scm:git:git://github.com/unum-cloud/usearch.git'
160
- developerConnection = 'scm:git:ssh://github.com/unum-cloud/usearch.git'
161
- url = 'https://github.com/unum-cloud/usearch'
162
- }
163
-
164
- developers {
165
- developer {
166
- id = 'ashvardanian'
167
- name = 'Ash Vardanian'
168
- email = 'ash.vardanian@unum.cloud'
169
- }
170
- }
171
- }
172
- }
173
- }
174
-
175
-
176
- // Publishing to GitHub is much easier ;)
177
- repositories {
178
- maven {
179
- name = "OSSRH"
180
- url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
181
- credentials {
182
- username = System.getenv("MAVEN_USERNAME")
183
- password = System.getenv("MAVEN_PASSWORD")
184
- }
185
- }
186
- }
187
-
188
- repositories {
189
- maven {
190
- name = "GitHubPackages"
191
- url = "https://maven.pkg.github.com/unum-cloud/usearch"
192
- credentials {
193
- username = System.getenv("GITHUB_ACTOR")
194
- password = System.getenv("GITHUB_TOKEN")
195
- }
196
- }
197
- }
198
- }
199
-
200
- // Ensure that the native library is built before the Java code
201
- compileJava.dependsOn tasks.withType(SharedLibraryBinarySpec)
202
- tasks.named("processResources").configure {
203
- dependsOn tasks.named("linkUsearchSharedLibrary")
204
- }