usearch 2.7.6 → 2.8.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.
- package/.dockerignore +93 -0
- package/.github/workflows/Dockerfile.libs +6 -2
- package/.github/workflows/prerelease.yml +242 -245
- package/.github/workflows/release.yml +390 -356
- package/.gitignore +1 -0
- package/.vscode/settings.json +3 -1
- package/CITATION.cff +1 -1
- package/CMakeLists.txt +35 -5
- package/Cargo.toml +1 -1
- package/README.md +1 -1
- package/build.gradle +6 -0
- package/c/README.md +3 -3
- package/c/lib.cpp +75 -11
- package/c/usearch.h +22 -1
- package/conanfile.py +1 -1
- package/cpp/README.md +2 -1
- package/cpp/bench.cpp +4 -1
- package/cpp/test.cpp +12 -12
- package/csharp/nuget/nuget-package.props +1 -1
- package/docs/compilation.md +5 -13
- package/golang/lib.go +4 -1
- package/include/usearch/index.hpp +31 -30
- package/include/usearch/index_dense.hpp +49 -48
- package/include/usearch/index_plugins.hpp +91 -24
- package/java/cloud/unum/usearch/Index.java +118 -26
- package/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp +8 -8
- package/javascript/usearch.js +1 -0
- package/objc/USearchObjective.mm +4 -1
- package/objc/include/USearchObjective.h +1 -0
- package/package.json +1 -1
- package/python/lib.cpp +6 -6
- package/python/scripts/bench.ipynb +24 -2
- package/python/usearch/index.py +8 -3
- package/rust/lib.cpp +14 -12
- package/rust/lib.hpp +13 -13
- package/rust/lib.rs +46 -0
- package/setup.py +15 -3
- package/simsimd/.github/workflows/prerelease.yml +7 -8
- package/simsimd/.github/workflows/release.yml +18 -20
- package/simsimd/README.md +13 -8
- package/simsimd/binding.gyp +1 -1
- package/simsimd/cpp/bench.cxx +17 -3
- package/simsimd/include/simsimd/binary.h +1 -3
- package/simsimd/include/simsimd/probability.h +234 -361
- package/simsimd/include/simsimd/simsimd.h +95 -65
- package/simsimd/include/simsimd/spatial.h +0 -3
- package/simsimd/include/simsimd/types.h +12 -7
- package/simsimd/javascript/test.js +23 -5
- package/simsimd/package.json +2 -2
- package/wasmer.toml +1 -1
- package/wolfram/lib.cpp +1 -1
- package/csharp/eng/build_lib.sh +0 -65
- package/csharp/eng/clean.sh +0 -12
package/.dockerignore
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Ignore all files without an extension
|
|
2
|
+
*
|
|
3
|
+
!/**/
|
|
4
|
+
!*.*
|
|
5
|
+
|
|
6
|
+
# Temporary files
|
|
7
|
+
.DS_Store
|
|
8
|
+
*.fbin
|
|
9
|
+
*.ibin
|
|
10
|
+
datasets
|
|
11
|
+
bin
|
|
12
|
+
*.usearch
|
|
13
|
+
.cache
|
|
14
|
+
|
|
15
|
+
# C++ builds
|
|
16
|
+
build
|
|
17
|
+
build_release
|
|
18
|
+
build_debug
|
|
19
|
+
_deps
|
|
20
|
+
CMakeCache.txt
|
|
21
|
+
CMakeFiles
|
|
22
|
+
cmake_install.cmake
|
|
23
|
+
|
|
24
|
+
# Profiling with GProf and `perf` on Linux
|
|
25
|
+
gmon.out
|
|
26
|
+
perf.data
|
|
27
|
+
|
|
28
|
+
# Python wrappers
|
|
29
|
+
__pycache__
|
|
30
|
+
*.egg-info
|
|
31
|
+
dist/
|
|
32
|
+
wheelhouse/
|
|
33
|
+
|
|
34
|
+
# Python Environments
|
|
35
|
+
venv/
|
|
36
|
+
|
|
37
|
+
# JS wrappers
|
|
38
|
+
package-lock.json
|
|
39
|
+
node_modules/
|
|
40
|
+
|
|
41
|
+
# Rust builds
|
|
42
|
+
Cargo.lock
|
|
43
|
+
target/
|
|
44
|
+
|
|
45
|
+
# Java bindings
|
|
46
|
+
.gradle
|
|
47
|
+
*.class
|
|
48
|
+
|
|
49
|
+
# ObjC and Swift
|
|
50
|
+
.build
|
|
51
|
+
.swiftpm
|
|
52
|
+
|
|
53
|
+
# C# builds
|
|
54
|
+
csharp/**/[Bb]in/
|
|
55
|
+
csharp/**/[Oo]bj/
|
|
56
|
+
csharp/lib
|
|
57
|
+
csharp/packages
|
|
58
|
+
|
|
59
|
+
# Prerequisites
|
|
60
|
+
*.d
|
|
61
|
+
|
|
62
|
+
# Compiled Object files
|
|
63
|
+
*.slo
|
|
64
|
+
*.lo
|
|
65
|
+
*.o
|
|
66
|
+
*.obj
|
|
67
|
+
|
|
68
|
+
# Precompiled Headers
|
|
69
|
+
*.gch
|
|
70
|
+
*.pch
|
|
71
|
+
|
|
72
|
+
# Compiled Dynamic libraries
|
|
73
|
+
*.so
|
|
74
|
+
*.dylib
|
|
75
|
+
*.dll
|
|
76
|
+
|
|
77
|
+
# Fortran module files
|
|
78
|
+
*.mod
|
|
79
|
+
*.smod
|
|
80
|
+
|
|
81
|
+
# Allow golang go.mod
|
|
82
|
+
!go.mod
|
|
83
|
+
|
|
84
|
+
# Compiled Static libraries
|
|
85
|
+
*.lai
|
|
86
|
+
*.la
|
|
87
|
+
*.a
|
|
88
|
+
*.lib
|
|
89
|
+
|
|
90
|
+
# Executables
|
|
91
|
+
*.exe
|
|
92
|
+
*.out
|
|
93
|
+
*.app
|
|
@@ -11,9 +11,13 @@ RUN apt-get update && \
|
|
|
11
11
|
apt-get clean && \
|
|
12
12
|
rm -rf /var/lib/apt/lists/*
|
|
13
13
|
|
|
14
|
+
ENV CC=gcc-12
|
|
15
|
+
ENV CXX=g++-12
|
|
16
|
+
|
|
14
17
|
COPY . .
|
|
15
18
|
|
|
16
|
-
RUN
|
|
19
|
+
RUN cmake -DCMAKE_BUILD_TYPE=Release -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_BUILD_TEST_CPP=0 -DUSEARCH_BUILD_BENCH_CPP=0 -B ./build_release
|
|
20
|
+
RUN cmake --build ./build_release --config Release
|
|
17
21
|
|
|
18
22
|
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
|
19
23
|
export arch="amd"; \
|
|
@@ -26,7 +30,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
|
|
26
30
|
mkdir -p usearch_linux_"$arch"_"$version"/usr/local/lib && \
|
|
27
31
|
mkdir usearch_linux_"$arch"_"$version"/usr/local/include && \
|
|
28
32
|
cp c/usearch.h usearch_linux_"$arch"_"$version"/usr/local/include/ && \
|
|
29
|
-
cp
|
|
33
|
+
cp build_release/libusearch_c.so usearch_linux_"$arch"_"$version"/usr/local/lib/ && \
|
|
30
34
|
echo "Package: usearch\nVersion: $version\nMaintainer: Ash Vardanian\nArchitecture: "$arch"\nDescription: Faster & Smaller Single-File Search Engine for Vectors & Texts" > usearch_linux_"$arch"_"$version"/DEBIAN/control && \
|
|
31
35
|
dpkg-deb --build usearch_linux_"$arch"_"$version" && \
|
|
32
36
|
sshpass -p "$user_pass" scp -o StrictHostKeyChecking=no usearch_linux_"$arch"_"$version".deb "$user_name"@"$docker_ip":/home/$user_name/work/usearch/usearch/
|
|
@@ -7,302 +7,299 @@ on:
|
|
|
7
7
|
branches: ["main-dev"]
|
|
8
8
|
|
|
9
9
|
env:
|
|
10
|
-
BUILD_TYPE: Release
|
|
11
10
|
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
|
|
12
11
|
PYTHONUTF8: 1
|
|
12
|
+
PYTHON_VERSION: 3.11
|
|
13
|
+
DOTNET_VERSION: 7.0.x
|
|
13
14
|
|
|
14
15
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
15
16
|
permissions:
|
|
16
17
|
contents: read
|
|
17
18
|
|
|
18
19
|
jobs:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
test_ubuntu_gcc:
|
|
21
|
+
name: Ubuntu (GCC 12)
|
|
22
|
+
runs-on: ubuntu-22.04
|
|
23
|
+
env:
|
|
24
|
+
CC: gcc-12
|
|
25
|
+
CXX: g++-12
|
|
26
|
+
|
|
24
27
|
steps:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- name: Install Dependencies
|
|
31
|
-
run: sudo apt update && sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev g++-12
|
|
32
|
-
|
|
33
|
-
- name: Build
|
|
34
|
-
run: |
|
|
35
|
-
export CC=gcc-12
|
|
36
|
-
export CXX=g++-12
|
|
37
|
-
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
|
|
38
|
-
cmake --build build --config Debug
|
|
39
|
-
|
|
40
|
-
- name: Run C++ tests
|
|
41
|
-
run: ./build/test_cpp
|
|
42
|
-
- name: Run C tests
|
|
43
|
-
run: ./build/test_c
|
|
28
|
+
- uses: actions/checkout@v3
|
|
29
|
+
with:
|
|
30
|
+
ref: main-dev
|
|
31
|
+
- run: git submodule update --init --recursive
|
|
44
32
|
|
|
33
|
+
# C/C++
|
|
34
|
+
- name: Build C/C++
|
|
35
|
+
run: |
|
|
36
|
+
sudo apt update
|
|
37
|
+
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
|
|
38
|
+
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
|
|
39
|
+
cmake --build build_artifacts --config RelWithDebInfo
|
|
40
|
+
- name: Test C++
|
|
41
|
+
run: ./build_artifacts/test_cpp
|
|
42
|
+
- name: Test C
|
|
43
|
+
run: ./build_artifacts/test_c
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- name: Build
|
|
60
|
-
run: |
|
|
61
|
-
export CC=clang-15
|
|
62
|
-
export CXX=clang++-15
|
|
63
|
-
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
|
|
64
|
-
cmake --build build --config Debug
|
|
65
|
-
|
|
66
|
-
- name: Run C++ tests
|
|
67
|
-
run: ./build/test_cpp
|
|
68
|
-
- name: Run C tests
|
|
69
|
-
run: ./build/test_c
|
|
45
|
+
# Python
|
|
46
|
+
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
|
47
|
+
uses: actions/setup-python@v4
|
|
48
|
+
with:
|
|
49
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
50
|
+
- name: Build Python
|
|
51
|
+
run: |
|
|
52
|
+
python -m pip install --upgrade pip
|
|
53
|
+
pip install pytest numpy
|
|
54
|
+
python -m pip install .
|
|
55
|
+
- name: Test Python
|
|
56
|
+
run: pytest python/scripts/ -s -x
|
|
70
57
|
|
|
58
|
+
# JavaScript
|
|
59
|
+
- name: Set up Node.js
|
|
60
|
+
uses: actions/setup-node@v3
|
|
61
|
+
with:
|
|
62
|
+
node-version: 18
|
|
63
|
+
- name: Build JavaScript
|
|
64
|
+
run: npm install
|
|
65
|
+
- name: Test JavaScript
|
|
66
|
+
run: npm ci && npm test
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
ref: main-dev
|
|
79
|
-
- run: git submodule update --init --recursive
|
|
80
|
-
|
|
81
|
-
- name: Install Dependencies
|
|
82
|
-
run: |
|
|
83
|
-
brew update
|
|
84
|
-
brew install cmake
|
|
85
|
-
|
|
86
|
-
- name: Build
|
|
87
|
-
run: |
|
|
88
|
-
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1
|
|
89
|
-
cmake --build build --config Debug
|
|
90
|
-
- name: Run C++ tests
|
|
91
|
-
run: ./build/test_cpp
|
|
92
|
-
- name: Run C tests
|
|
93
|
-
run: ./build/test_c
|
|
68
|
+
# Rust
|
|
69
|
+
- name: Test Rust
|
|
70
|
+
uses: actions-rs/toolchain@v1
|
|
71
|
+
with:
|
|
72
|
+
toolchain: stable
|
|
73
|
+
override: true
|
|
94
74
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
75
|
+
# Java
|
|
76
|
+
- name: Setup Java
|
|
77
|
+
uses: actions/setup-java@v3
|
|
78
|
+
with:
|
|
79
|
+
java-version: "11"
|
|
80
|
+
distribution: "adopt"
|
|
81
|
+
- name: Setup Gradle
|
|
82
|
+
uses: gradle/gradle-build-action@v2.4.2
|
|
83
|
+
- name: Test Java
|
|
84
|
+
run: gradle clean build
|
|
85
|
+
|
|
86
|
+
# C#
|
|
87
|
+
- name: Setup .NET ${{ env.DOTNET_VERSION }}
|
|
88
|
+
uses: actions/setup-dotnet@v3
|
|
89
|
+
with:
|
|
90
|
+
dotnet-version: ${{ env.DOTNET_VERSION }}
|
|
91
|
+
- name: Test .NET
|
|
92
|
+
run: |
|
|
93
|
+
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
|
|
94
|
+
cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
|
|
95
|
+
dotnet test -c Release
|
|
96
|
+
shell: bash
|
|
97
|
+
working-directory: ${{ github.workspace }}/csharp
|
|
98
|
+
|
|
99
|
+
# GoLang
|
|
100
|
+
# With `LD_DEBUG=all` we detect the addresses of the libraries that are loaded
|
|
101
|
+
- name: Test GoLang
|
|
102
|
+
run: |
|
|
103
|
+
sudo cp ${{ github.workspace }}/build_artifacts/libusearch_c.so /usr/lib/libusearch_c.so
|
|
104
|
+
sudo cp ${{ github.workspace }}/c/usearch.h /usr/include/usearch.h
|
|
105
|
+
LD_DEBUG=all go test -v
|
|
106
|
+
working-directory: ${{ github.workspace }}/golang/
|
|
107
|
+
|
|
108
|
+
test_ubuntu_clang:
|
|
109
|
+
name: Ubuntu (Clang 16)
|
|
110
|
+
runs-on: ubuntu-22.04
|
|
111
|
+
env:
|
|
112
|
+
CC: clang-16
|
|
113
|
+
CXX: clang++-16
|
|
124
114
|
|
|
125
115
|
steps:
|
|
126
116
|
- uses: actions/checkout@v3
|
|
117
|
+
with:
|
|
118
|
+
ref: main-dev
|
|
127
119
|
- run: git submodule update --init --recursive
|
|
128
|
-
|
|
120
|
+
|
|
121
|
+
# C/C++
|
|
122
|
+
# Clang 16 isn't available from default repos on Ubuntu 22.04, so we have to install it manually
|
|
123
|
+
- name: Build C/C++
|
|
124
|
+
run: |
|
|
125
|
+
sudo apt update
|
|
126
|
+
sudo apt install -y cmake build-essential libjemalloc-dev
|
|
127
|
+
wget https://apt.llvm.org/llvm.sh
|
|
128
|
+
chmod +x llvm.sh
|
|
129
|
+
sudo ./llvm.sh 16
|
|
130
|
+
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DDUSEARCH_USE_OPENMP=0 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
|
|
131
|
+
cmake --build build_artifacts --config RelWithDebInfo
|
|
132
|
+
- name: Test C++
|
|
133
|
+
run: ./build_artifacts/test_cpp
|
|
134
|
+
- name: Test C
|
|
135
|
+
run: ./build_artifacts/test_c
|
|
136
|
+
|
|
137
|
+
# Python
|
|
138
|
+
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
|
129
139
|
uses: actions/setup-python@v4
|
|
130
140
|
with:
|
|
131
|
-
python-version: ${{
|
|
132
|
-
- name:
|
|
141
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
142
|
+
- name: Build Python
|
|
133
143
|
run: |
|
|
134
144
|
python -m pip install --upgrade pip
|
|
135
145
|
pip install pytest numpy
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
- name: Test with PyTest
|
|
146
|
+
python -m pip install .
|
|
147
|
+
- name: Test Python
|
|
139
148
|
run: pytest python/scripts/ -s -x
|
|
140
149
|
|
|
150
|
+
# JavaScript
|
|
151
|
+
- name: Set up Node.js
|
|
152
|
+
uses: actions/setup-node@v3
|
|
153
|
+
with:
|
|
154
|
+
node-version: 18
|
|
155
|
+
- name: Build and test JavaScript
|
|
156
|
+
run: |
|
|
157
|
+
npm install
|
|
158
|
+
npm ci
|
|
159
|
+
npm test
|
|
160
|
+
|
|
161
|
+
# C#
|
|
162
|
+
- name: Setup .NET ${{ env.DOTNET_VERSION }}
|
|
163
|
+
uses: actions/setup-dotnet@v3
|
|
164
|
+
with:
|
|
165
|
+
dotnet-version: ${{ env.DOTNET_VERSION }}
|
|
166
|
+
- name: Test .NET
|
|
167
|
+
run: |
|
|
168
|
+
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
|
|
169
|
+
cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
|
|
170
|
+
dotnet test -c Release
|
|
171
|
+
shell: bash
|
|
172
|
+
working-directory: ${{ github.workspace }}/csharp
|
|
141
173
|
|
|
142
|
-
|
|
143
|
-
name:
|
|
144
|
-
runs-on:
|
|
145
|
-
strategy:
|
|
146
|
-
fail-fast: false
|
|
147
|
-
matrix:
|
|
148
|
-
os: [ubuntu-22.04]
|
|
149
|
-
python-version: ["3.7"]
|
|
174
|
+
test_macos:
|
|
175
|
+
name: MacOS
|
|
176
|
+
runs-on: macos-12
|
|
150
177
|
|
|
151
178
|
steps:
|
|
152
179
|
- uses: actions/checkout@v3
|
|
180
|
+
with:
|
|
181
|
+
ref: main-dev
|
|
153
182
|
- run: git submodule update --init --recursive
|
|
154
|
-
|
|
155
|
-
|
|
183
|
+
|
|
184
|
+
# C/C++
|
|
185
|
+
- name: Build C/C++
|
|
186
|
+
run: |
|
|
187
|
+
brew update
|
|
188
|
+
brew install cmake
|
|
189
|
+
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1
|
|
190
|
+
cmake --build build_artifacts --config RelWithDebInfo
|
|
191
|
+
- name: Test C++
|
|
192
|
+
run: ./build_artifacts/test_cpp
|
|
193
|
+
- name: Test C
|
|
194
|
+
run: ./build_artifacts/test_c
|
|
195
|
+
|
|
196
|
+
# Python
|
|
197
|
+
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
|
156
198
|
uses: actions/setup-python@v4
|
|
157
199
|
with:
|
|
158
|
-
python-version: ${{
|
|
159
|
-
|
|
160
|
-
- name: Install dependencies
|
|
200
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
201
|
+
- name: Build Python
|
|
161
202
|
run: |
|
|
162
203
|
python -m pip install --upgrade pip
|
|
163
204
|
pip install pytest numpy
|
|
164
|
-
|
|
165
|
-
- name:
|
|
166
|
-
run: python -m pip install .
|
|
167
|
-
- name: Test with PyTest
|
|
205
|
+
python -m pip install .
|
|
206
|
+
- name: Test Python
|
|
168
207
|
run: pytest python/scripts/ -s -x
|
|
169
208
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
runs-on: ubuntu-latest
|
|
174
|
-
steps:
|
|
175
|
-
- uses: actions/checkout@v3
|
|
176
|
-
- run: git submodule update --init --recursive
|
|
177
|
-
- uses: actions/setup-node@v3
|
|
209
|
+
# JavaScript
|
|
210
|
+
- name: Set up Node.js
|
|
211
|
+
uses: actions/setup-node@v3
|
|
178
212
|
with:
|
|
179
213
|
node-version: 18
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
-
|
|
214
|
+
- name: Build JavaScript
|
|
215
|
+
run: npm install
|
|
216
|
+
- name: Test JavaScript
|
|
217
|
+
run: npm ci && npm test
|
|
183
218
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- run: git submodule update --init --recursive
|
|
190
|
-
- uses: actions-rs/toolchain@v1
|
|
191
|
-
with:
|
|
192
|
-
toolchain: stable
|
|
193
|
-
override: true
|
|
219
|
+
# ObjC/Swift
|
|
220
|
+
- name: Build ObjC/Swift
|
|
221
|
+
run: swift build
|
|
222
|
+
- name: Test ObjC/Swift
|
|
223
|
+
run: swift test
|
|
194
224
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
- name: Execute Gradle build
|
|
208
|
-
run: gradle clean build
|
|
209
|
-
|
|
210
|
-
test_swift:
|
|
211
|
-
name: Test ObjC & Swift
|
|
212
|
-
runs-on: macos-latest
|
|
213
|
-
steps:
|
|
214
|
-
- uses: actions/checkout@v3
|
|
215
|
-
- run: git submodule update --init --recursive
|
|
216
|
-
- name: Build
|
|
217
|
-
run: swift build
|
|
218
|
-
- name: Run tests
|
|
219
|
-
run: swift test
|
|
225
|
+
# C#
|
|
226
|
+
- name: Setup .NET ${{ env.DOTNET_VERSION }}
|
|
227
|
+
uses: actions/setup-dotnet@v3
|
|
228
|
+
with:
|
|
229
|
+
dotnet-version: ${{ env.DOTNET_VERSION }}
|
|
230
|
+
- name: Test .NET
|
|
231
|
+
run: |
|
|
232
|
+
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
|
|
233
|
+
cp "${{ github.workspace }}/build_artifacts/libusearch_c.dylib" "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
|
|
234
|
+
dotnet test -c Release
|
|
235
|
+
shell: bash
|
|
236
|
+
working-directory: ${{ github.workspace }}/csharp
|
|
220
237
|
|
|
221
|
-
|
|
222
|
-
name:
|
|
223
|
-
runs-on:
|
|
224
|
-
strategy:
|
|
225
|
-
fail-fast: false
|
|
226
|
-
matrix:
|
|
227
|
-
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
228
|
-
dotnet-version: ['7.0.x']
|
|
238
|
+
test_windows:
|
|
239
|
+
name: Windows
|
|
240
|
+
runs-on: windows-2022
|
|
229
241
|
steps:
|
|
230
242
|
- uses: actions/checkout@v3
|
|
231
|
-
- run: git submodule update --init --recursive
|
|
232
|
-
- name: Setup .NET ${{ matrix.dotnet-version }}
|
|
233
|
-
uses: actions/setup-dotnet@v3
|
|
234
243
|
with:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
- name: Ubuntu/macOS build native lib
|
|
238
|
-
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
|
|
239
|
-
run: ./build_lib.sh
|
|
240
|
-
shell: bash
|
|
241
|
-
working-directory: ${{ github.workspace }}/csharp/eng/
|
|
244
|
+
ref: main-dev
|
|
245
|
+
- run: git submodule update --init --recursive
|
|
242
246
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
- name: Windows MSVC build
|
|
246
|
-
if: matrix.os == 'windows-latest'
|
|
247
|
+
# C/C++
|
|
248
|
+
- name: Build C/C++
|
|
247
249
|
run: |
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
choco install cmake
|
|
251
|
+
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1
|
|
252
|
+
cmake --build build_artifacts --config RelWithDebInfo
|
|
253
|
+
- name: Test C++
|
|
254
|
+
run: .\build_artifacts\test_cpp.exe
|
|
255
|
+
- name: Test C
|
|
256
|
+
run: .\build_artifacts\test_c.exe
|
|
253
257
|
|
|
254
|
-
|
|
255
|
-
|
|
258
|
+
# Python
|
|
259
|
+
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
|
260
|
+
uses: actions/setup-python@v4
|
|
261
|
+
with:
|
|
262
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
263
|
+
- name: Build Python
|
|
256
264
|
run: |
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
run: dotnet test -c Release
|
|
263
|
-
shell: bash
|
|
264
|
-
working-directory: ${{ github.workspace }}/csharp/
|
|
265
|
-
|
|
266
|
-
test_golang:
|
|
267
|
-
name: Test Golang
|
|
268
|
-
runs-on: ubuntu-latest
|
|
269
|
-
steps:
|
|
270
|
-
- uses: actions/checkout@v3
|
|
271
|
-
with:
|
|
272
|
-
persist-credentials: false
|
|
273
|
-
ref: 'main-dev'
|
|
274
|
-
- run: git submodule update --init --recursive
|
|
265
|
+
python -m pip install --upgrade pip
|
|
266
|
+
pip install pytest numpy
|
|
267
|
+
python -m pip install .
|
|
268
|
+
- name: Test Python
|
|
269
|
+
run: pytest python/scripts/ -s -x
|
|
275
270
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
run: |
|
|
286
|
-
cd golang/
|
|
287
|
-
make USEARCH_USE_OPENMP=0 USEARCH_USE_NATIVE_F16=0 USEARCH_USE_SIMSIMD=1 -C ../c libusearch_c.so
|
|
288
|
-
sudo cp ../c/libusearch_c.so /usr/local/lib/libusearch_c.a
|
|
289
|
-
sudo cp ../c/usearch.h /usr/local/include/usearch.h
|
|
271
|
+
# JavaScript
|
|
272
|
+
- name: Set up Node.js
|
|
273
|
+
uses: actions/setup-node@v3
|
|
274
|
+
with:
|
|
275
|
+
node-version: 18
|
|
276
|
+
- name: Build JavaScript
|
|
277
|
+
run: npm install
|
|
278
|
+
- name: Test JavaScript
|
|
279
|
+
run: npm ci && npm test
|
|
290
280
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
281
|
+
# C#
|
|
282
|
+
- name: Setup .NET ${{ env.DOTNET_VERSION }}
|
|
283
|
+
uses: actions/setup-dotnet@v3
|
|
284
|
+
with:
|
|
285
|
+
dotnet-version: ${{ env.DOTNET_VERSION }}
|
|
286
|
+
- name: Test .NET
|
|
287
|
+
run: |
|
|
288
|
+
mkdir -p "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
|
|
289
|
+
cp "${{ github.workspace }}\build_artifacts\libusearch_c.dll" "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
|
|
290
|
+
dotnet test -c Release
|
|
291
|
+
shell: bash
|
|
292
|
+
working-directory: ${{ github.workspace }}/csharp
|
|
296
293
|
|
|
297
294
|
build_docker:
|
|
298
|
-
name:
|
|
299
|
-
runs-on: ubuntu-
|
|
295
|
+
name: Docker
|
|
296
|
+
runs-on: ubuntu-22.04
|
|
300
297
|
steps:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
298
|
+
- uses: actions/checkout@v3
|
|
299
|
+
- run: git submodule update --init --recursive
|
|
300
|
+
- name: Build
|
|
301
|
+
uses: docker/build-push-action@v4
|
|
302
|
+
with:
|
|
303
|
+
context: .
|
|
304
|
+
load: true
|
|
305
|
+
push: false
|