usearch 2.4.0 → 2.5.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.
@@ -34,7 +34,7 @@ jobs:
34
34
  cmake -B ./build_release \
35
35
  -DCMAKE_CXX_COMPILER="g++-12" \
36
36
  -DCMAKE_BUILD_TYPE=Release \
37
- -DUSEARCH_BUILD_TEST=1 \
37
+ -DUSEARCH_BUILD_CTEST=1 \
38
38
  -DUSEARCH_USE_OPENMP=1 \
39
39
  -DUSEARCH_USE_SIMSIMD=1 \
40
40
  -DUSEARCH_USE_JEMALLOC=1 \
@@ -215,10 +215,96 @@ jobs:
215
215
  file: "golang/*.zip"
216
216
  update_latest_release: true
217
217
 
218
+
219
+ wasm_c_library:
220
+ name: WASM builds for C libraries on ${{ matrix.os }}
221
+ runs-on: ${{ matrix.os }}
222
+ needs: versioning
223
+ strategy:
224
+ matrix:
225
+ os: [ubuntu-22.04, macOS-11, windows-2022]
226
+ steps:
227
+ - uses: actions/checkout@v3
228
+ with:
229
+ persist-credentials: false
230
+ ref: 'main'
231
+ - run: git submodule update --init --recursive
232
+
233
+ - name: Get version
234
+ id: version
235
+ run: |
236
+ version=$(cat VERSION)
237
+ echo "version=$version" >> $GITHUB_OUTPUT
238
+ shell: bash
239
+
240
+ - name: Build library on Ubuntu
241
+ run: |
242
+ export WASI_VERSION=20
243
+ export WASI_VERSION_FULL=${WASI_VERSION}.0
244
+ wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
245
+ tar xf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
246
+ rm -rf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
247
+ export WASI_SDK_PATH=/home/runner/work/usearch/usearch/wasi-sdk-${WASI_VERSION_FULL}
248
+ archs=("x86_64" "arm64")
249
+ cd ./c
250
+ for arch in "${archs[@]}"
251
+ do
252
+ ../wasi-sdk-20.0/bin/clang++ --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot -o libusearch.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared --target=wasm32-wasi-threads -Wl,--no-entry -nostdlib -D_WASI_EMULATED_MMAN -march="$arch"
253
+ tar -czvf usearch_wasm_linux_"$arch"_${{ steps.version.outputs.version }}.tar.gz libusearch.so
254
+ mv usearch_wasm_linux_"$arch"_${{ steps.version.outputs.version }}.tar.gz ../ && rm -rf libusearch.so
255
+ done
256
+ if: matrix.os == 'ubuntu-22.04'
257
+
258
+ - name: Build library on MacOS
259
+ run: |
260
+ export WASI_VERSION=20
261
+ export WASI_VERSION_FULL=${WASI_VERSION}.0
262
+ wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
263
+ tar xf wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
264
+ rm -rf wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
265
+ export WASI_SDK_PATH=/Users/runner/work/usearch/usearch/wasi-sdk-${WASI_VERSION_FULL}
266
+ archs=("x86_64" "arm64")
267
+ cd ./c
268
+ for arch in "${archs[@]}"
269
+ do
270
+ ../wasi-sdk-20.0/bin/clang++ --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot -o libusearch.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared --target=wasm32-wasi-threads -Wl,--no-entry -nostdlib -D_WASI_EMULATED_MMAN -march="$arch"
271
+ zip -r usearch_wasm_macos_"$arch"_${{ steps.version.outputs.version }}.zip libusearch.so
272
+ mv usearch_wasm_macos_"$arch"_${{ steps.version.outputs.version }}.zip ../ && rm -rf libusearch.so
273
+ done
274
+ if: matrix.os == 'macOS-11'
275
+
276
+ - name: Build library on Windows
277
+ run: |
278
+ export WASI_VERSION=20
279
+ export WASI_VERSION_FULL=${WASI_VERSION}.0
280
+ curl -LOJ https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}.m-mingw.tar.gz
281
+ tar xf wasi-sdk-${WASI_VERSION_FULL}.m-mingw.tar.gz
282
+ rm -rf wasi-sdk-${WASI_VERSION_FULL}.m-mingw.tar.gz
283
+ export WASI_SDK_PATH=/d/a/usearch/usearch/wasi-sdk-${WASI_VERSION_FULL}+m
284
+ archs=("x64" "x86")
285
+ cd ./c
286
+ for arch in "${archs[@]}"
287
+ do
288
+ ../wasi-sdk-20.0+m/bin/clang++ --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot -o libusearch.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared --target=wasm32-wasi-threads -Wl,--no-entry -nostdlib -D_WASI_EMULATED_MMAN -march="$arch"
289
+ tar -cvf usearch_wasm_windows_"$arch"_${{ steps.version.outputs.version }}.tar.gz libusearch.so
290
+ mv usearch_wasm_windows_"$arch"_${{ steps.version.outputs.version }}.tar.gz ../ && rm -rf libusearch.so
291
+ done
292
+ shell: bash
293
+ if: matrix.os == 'windows-2022'
294
+
295
+ - name: Upload archive
296
+ uses: xresloader/upload-to-github-release@v1
297
+ env:
298
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
299
+ with:
300
+ file: "*.zip;*.tar.gz"
301
+ update_latest_release: true
302
+
303
+
218
304
  publish_checksums:
219
305
  name: Compute Assets Checksums
220
306
  runs-on: ubuntu-latest
221
- needs: [versioning, create_linux_deb_package, create_windows_dll_library, create_macos_library, deploy_docs_pages]
307
+ needs: [versioning, create_linux_deb_package, create_windows_dll_library, create_macos_library, deploy_docs_pages, wasm_c_library]
222
308
  steps:
223
309
  - name: Get last release ID
224
310
  id: last_release
@@ -266,6 +352,12 @@ jobs:
266
352
  * ${{ steps.hashes.outputs.asset_name_7 }} : `${{ steps.hashes.outputs.asset_hash_7 }}`
267
353
  * ${{ steps.hashes.outputs.asset_name_8 }} : `${{ steps.hashes.outputs.asset_hash_8 }}`
268
354
  * ${{ steps.hashes.outputs.asset_name_9 }} : `${{ steps.hashes.outputs.asset_hash_9 }}`
355
+ * ${{ steps.hashes.outputs.asset_name_10 }} : `${{ steps.hashes.outputs.asset_hash_10 }}`
356
+ * ${{ steps.hashes.outputs.asset_name_11 }} : `${{ steps.hashes.outputs.asset_hash_11 }}`
357
+ * ${{ steps.hashes.outputs.asset_name_12 }} : `${{ steps.hashes.outputs.asset_hash_12 }}`
358
+ * ${{ steps.hashes.outputs.asset_name_13 }} : `${{ steps.hashes.outputs.asset_hash_13 }}`
359
+ * ${{ steps.hashes.outputs.asset_name_14 }} : `${{ steps.hashes.outputs.asset_hash_14 }}`
360
+ * ${{ steps.hashes.outputs.asset_name_15 }} : `${{ steps.hashes.outputs.asset_hash_15 }}`
269
361
 
270
362
 
271
363
  build_wheels:
package/CITATION.cff CHANGED
@@ -5,7 +5,7 @@ authors:
5
5
  given-names: "Ash"
6
6
  orcid: "https://orcid.org/0000-0002-4882-1815"
7
7
  title: "USearch by Unum Cloud"
8
- version: 2.4.0
8
+ version: 2.5.0
9
9
  doi: 10.5281/zenodo.7949416
10
10
  date-released: 2022-06-12
11
11
  url: "https://github.com/unum-cloud/usearch"
package/CMakeLists.txt CHANGED
@@ -15,6 +15,7 @@ option(USEARCH_BUILD_TEST "Compile a native unit test in C++" ${USEARCH_IS_MAIN_
15
15
  option(USEARCH_BUILD_BENCHMARK "Compile a native benchmark in C++" ${USEARCH_IS_MAIN_PROJECT})
16
16
  option(USEARCH_BUILD_WOLFRAM "Compile Wolfram Language bindings" OFF)
17
17
  option(USEARCH_BUILD_CLIB "Compile a native library for the C 99 interface" OFF)
18
+ option(USEARCH_BUILD_CTEST "Compile a test for the C 99 interface" OFF)
18
19
 
19
20
  # Includes
20
21
  set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
@@ -128,7 +129,6 @@ if(USEARCH_INSTALL)
128
129
  endif()
129
130
 
130
131
  if(${USEARCH_BUILD_TEST} OR ${USEARCH_BUILD_BENCHMARK})
131
- add_subdirectory(c)
132
132
  add_subdirectory(cpp)
133
133
  endif()
134
134
 
@@ -140,6 +140,6 @@ if(${USEARCH_BUILD_WASM})
140
140
  add_subdirectory(wasm)
141
141
  endif()
142
142
 
143
- if (${USEARCH_BUILD_CLIB})
143
+ if (${USEARCH_BUILD_CLIB} OR ${USEARCH_BUILD_CTEST})
144
144
  add_subdirectory(c)
145
145
  endif()
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "2.4.0"
3
+ version = "2.5.0"
4
4
  authors = ["Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
5
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
6
  edition = "2021"
package/README.md CHANGED
@@ -99,7 +99,7 @@ index = Index(
99
99
 
100
100
  vector = np.array([0.2, 0.6, 0.4])
101
101
  index.add(42, vector)
102
- matches: Matches = index.search(vector, 10)
102
+ matches = index.search(vector, 10)
103
103
 
104
104
  assert len(index) == 1
105
105
  assert len(matches) == 1
@@ -392,7 +392,7 @@ doi = {10.5281/zenodo.7949416},
392
392
  author = {Vardanian, Ash},
393
393
  title = {{USearch by Unum Cloud}},
394
394
  url = {https://github.com/unum-cloud/usearch},
395
- version = {2.4.0},
395
+ version = {2.5.0},
396
396
  year = {2022},
397
397
  month = jun,
398
398
  }
package/c/CMakeLists.txt CHANGED
@@ -45,7 +45,7 @@ if (${USEARCH_LOOKUP_LABEL})
45
45
  target_compile_definitions(usearch_c PRIVATE USEARCH_LOOKUP_LABEL=1)
46
46
  endif()
47
47
 
48
- if(${USEARCH_BUILD_TEST})
48
+ if(${USEARCH_BUILD_CTEST})
49
49
  add_executable(test_c "${CMAKE_CURRENT_SOURCE_DIR}/test.c")
50
50
  target_link_libraries(test_c usearch_c)
51
51
  set_target_properties(test_c PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
package/c/README.md CHANGED
@@ -6,7 +6,7 @@ The simplest form to integrate is to copy the contents of `usearch/c/` into your
6
6
  To build the library `libusearch_c`, pass enable the `USEARCH_BUILD_CLIB` CMake option:
7
7
 
8
8
  ```bash
9
- cmake -DUSEARCH_BUILD_CLIB=1 -DUSEARCH_BUILD_STATIC=0 -DUSEARCH_BUILD_TEST=0 -DUSEARCH_BUILD_BENCHMARK=0 ..
9
+ cmake -DUSEARCH_BUILD_CLIB=1 -DUSEARCH_BUILD_CTEST=1 -DUSEARCH_BUILD_STATIC=0 -DUSEARCH_BUILD_TEST=0 -DUSEARCH_BUILD_BENCHMARK=0 ..
10
10
  ```
11
11
 
12
12
  You can choose between a static and dynamic library by setting `USEARCH_BUILD_STATIC`.
package/conanfile.py CHANGED
@@ -1,19 +1,26 @@
1
1
  from conans import ConanFile
2
2
 
3
3
 
4
+ required_conan_version = ">=1.53.0"
5
+
6
+
4
7
  class USearchConan(ConanFile):
5
8
 
6
- name = 'USearch'
7
- version = '2.4.0'
8
- license = 'Apache 2.0'
9
- url = 'https://github.com/unum-cloud/usearch'
10
- description = 'Smaller & Faster Single-File Vector Search Engine from Unum'
9
+ name = "usearch"
10
+ version = '2.5.0'
11
+ license = "Apache-2.0"
12
+ description = "Smaller & Faster Single-File Vector Search Engine from Unum"
13
+ homepage = "https://github.com/unum-cloud/usearch"
14
+ topics = ("search", "vector", "simd")
15
+ settings = "os", "arch", "compiler", "build_type"
16
+ url = "https://github.com/conan-io/conan-center-index"
17
+ package_type = "header-library"
11
18
 
12
19
  # No settings/options are necessary, this is header only
13
20
  # Potentially add unit-tests in the future:
14
21
  # https://docs.conan.io/1/howtos/header_only.html#with-unit-tests
15
- exports_sources = 'include/*'
22
+ exports_sources = "include/*"
16
23
  no_copy_source = True
17
24
 
18
25
  def package(self):
19
- self.copy('*.h')
26
+ self.copy("*.h")
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project>
3
3
  <PropertyGroup>
4
- <Version Condition="'$(Version)' == ''">2.4.0</Version>
4
+ <Version Condition="'$(Version)' == ''">2.5.0</Version>
5
5
 
6
6
  <Authors>Unum</Authors>
7
7
  <Company>Unum</Company>