native-vector-store 0.1.0 → 0.2.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/README.md +10 -3
- package/binding.gyp +21 -10
- package/deps/simdjson.cpp +56403 -0
- package/deps/simdjson.h +123534 -0
- package/package.json +25 -6
- package/prebuilds/darwin-arm64/native-vector-store.node +0 -0
- package/prebuilds/darwin-x64/native-vector-store.node +0 -0
- package/prebuilds/linux-arm64/native-vector-store.node +0 -0
- package/prebuilds/linux-x64/native-vector-store.node +0 -0
- package/prebuilds/linux-x64-musl/napi-v9/native-vector-store.node +0 -0
- package/prebuilds/linux-x64-musl/native-vector-store.node +0 -0
- package/prebuilds/win32-x64/native-vector-store.node +0 -0
- package/src/Makefile +87 -0
- package/src/test_main.cpp +173 -0
- package/src/test_stress.cpp +394 -0
- package/src/vector_store.cpp +344 -0
- package/src/vector_store.h +21 -323
- package/native-vector-store-0.1.0.tgz +0 -0
- package/scripts/build-prebuilds.sh +0 -23
package/README.md
CHANGED
@@ -28,15 +28,22 @@ npm install native-vector-store
|
|
28
28
|
|
29
29
|
### Prerequisites
|
30
30
|
|
31
|
-
|
32
|
-
-
|
31
|
+
**Runtime Requirements:**
|
32
|
+
- OpenMP runtime library (for parallel processing)
|
33
|
+
- **Linux**: `sudo apt-get install libgomp1` (Ubuntu/Debian) or `dnf install libgomp` (Fedora)
|
34
|
+
- **Alpine**: `apk add libgomp`
|
35
|
+
- **macOS**: `brew install libomp`
|
36
|
+
- **Windows**: Included with Visual C++ runtime
|
37
|
+
|
38
|
+
Prebuilt binaries are included for:
|
39
|
+
- Linux (x64, arm64, musl/Alpine)
|
33
40
|
- macOS (x64, arm64/Apple Silicon)
|
34
41
|
- Windows (x64)
|
35
42
|
|
36
43
|
If building from source, you'll need:
|
37
44
|
- Node.js ≥14.0.0
|
38
45
|
- C++ compiler with OpenMP support
|
39
|
-
- simdjson library (
|
46
|
+
- simdjson library (vendored, no installation needed)
|
40
47
|
|
41
48
|
## Quick Start
|
42
49
|
|
package/binding.gyp
CHANGED
@@ -2,10 +2,11 @@
|
|
2
2
|
"targets": [
|
3
3
|
{
|
4
4
|
"target_name": "vector_store",
|
5
|
-
"sources": ["src/binding.cc", "src/vector_store_loader.cpp", "src/vector_store_loader_mmap.cpp", "src/vector_store_loader_adaptive.cpp"],
|
5
|
+
"sources": ["src/binding.cc", "src/vector_store.cpp", "src/vector_store_loader.cpp", "src/vector_store_loader_mmap.cpp", "src/vector_store_loader_adaptive.cpp", "deps/simdjson.cpp"],
|
6
6
|
"include_dirs": [
|
7
7
|
"<!@(node -p \"require('node-addon-api').include\")",
|
8
|
-
"src"
|
8
|
+
"src",
|
9
|
+
"deps"
|
9
10
|
],
|
10
11
|
"dependencies": ["<!(node -p \"require('node-addon-api').gyp\")"],
|
11
12
|
"cflags_cc": [
|
@@ -17,27 +18,37 @@
|
|
17
18
|
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
|
18
19
|
"conditions": [
|
19
20
|
["OS=='mac'", {
|
20
|
-
"include_dirs": [
|
21
|
+
"include_dirs": [
|
22
|
+
"/opt/homebrew/opt/libomp/include",
|
23
|
+
"/usr/local/opt/libomp/include"
|
24
|
+
],
|
21
25
|
"xcode_settings": {
|
22
26
|
"GCC_ENABLE_CPP_EXCEPTIONS": "NO",
|
23
27
|
"OTHER_CFLAGS": ["-Xpreprocessor", "-fopenmp"],
|
24
|
-
"OTHER_CPLUSPLUSFLAGS": ["-Xpreprocessor", "-fopenmp"],
|
25
|
-
"OTHER_LDFLAGS": ["-
|
28
|
+
"OTHER_CPLUSPLUSFLAGS": ["-Xpreprocessor", "-fopenmp", "-std=c++17"],
|
29
|
+
"OTHER_LDFLAGS": ["-lomp"],
|
30
|
+
"CLANG_CXX_LANGUAGE_STANDARD": "c++17"
|
26
31
|
},
|
27
|
-
"libraries": ["-
|
32
|
+
"libraries": ["-lomp"],
|
33
|
+
"library_dirs": [
|
34
|
+
"/opt/homebrew/opt/libomp/lib",
|
35
|
+
"/usr/local/opt/libomp/lib"
|
36
|
+
]
|
28
37
|
}],
|
29
38
|
["OS=='linux'", {
|
30
39
|
"cflags_cc": ["-fopenmp"],
|
31
|
-
"libraries": ["-lgomp"
|
40
|
+
"libraries": ["-lgomp"]
|
32
41
|
}],
|
33
42
|
["OS=='win'", {
|
34
43
|
"msvs_settings": {
|
35
44
|
"VCCLCompilerTool": {
|
36
45
|
"ExceptionHandling": 0,
|
37
|
-
"OpenMP": "true"
|
46
|
+
"OpenMP": "true",
|
47
|
+
"AdditionalOptions": [
|
48
|
+
"/openmp:experimental"
|
49
|
+
]
|
38
50
|
}
|
39
|
-
}
|
40
|
-
"libraries": ["simdjson.lib"]
|
51
|
+
}
|
41
52
|
}]
|
42
53
|
]
|
43
54
|
}
|