clusterkit 0.2.6 → 0.3.1.pre.1
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.
- checksums.yaml +4 -4
- data/Cargo.lock +9 -17
- data/Rakefile +21 -7
- data/ext/clusterkit/Cargo.toml +1 -2
- data/ext/clusterkit/extconf.rb +11 -0
- data/lib/clusterkit/clusterkit.rb +10 -5
- data/lib/clusterkit/version.rb +1 -1
- data/lib/clusterkit.rb +14 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 912a056ca7672bd2817381a5ad88d0c1e30db9d6b12be545f36b42abc6d725eb
|
|
4
|
+
data.tar.gz: 12cc9f11080f4621f316fbf76a707df0808b50e18dff06117938de029db7c042
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9db521f6cc552ca876f9e90f76e1c3bc8399a1e3ba21d0460f5b3a4a8dde7007b433d259a4b76319b671f66f8937993e104a1876a4e04580838a46a793d7fc97
|
|
7
|
+
data.tar.gz: f0b05b6c11792f583040acd038969be71adc56685c6aa181845bfe16b0fdd94cf3596aa4812e162748f535570326f1b5450aab25a40a5ae26761cdf5052e87b6
|
data/Cargo.lock
CHANGED
|
@@ -247,16 +247,14 @@ dependencies = [
|
|
|
247
247
|
|
|
248
248
|
[[package]]
|
|
249
249
|
name = "bindgen"
|
|
250
|
-
version = "0.
|
|
250
|
+
version = "0.72.1"
|
|
251
251
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
252
|
-
checksum = "
|
|
252
|
+
checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
|
|
253
253
|
dependencies = [
|
|
254
254
|
"bitflags 2.9.2",
|
|
255
255
|
"cexpr",
|
|
256
256
|
"clang-sys",
|
|
257
257
|
"itertools",
|
|
258
|
-
"lazy_static",
|
|
259
|
-
"lazycell",
|
|
260
258
|
"proc-macro2",
|
|
261
259
|
"quote",
|
|
262
260
|
"regex",
|
|
@@ -1304,12 +1302,6 @@ version = "1.5.0"
|
|
|
1304
1302
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1305
1303
|
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
|
1306
1304
|
|
|
1307
|
-
[[package]]
|
|
1308
|
-
name = "lazycell"
|
|
1309
|
-
version = "1.3.0"
|
|
1310
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1311
|
-
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
|
1312
|
-
|
|
1313
1305
|
[[package]]
|
|
1314
1306
|
name = "libc"
|
|
1315
1307
|
version = "0.2.175"
|
|
@@ -1323,7 +1315,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
1323
1315
|
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
|
|
1324
1316
|
dependencies = [
|
|
1325
1317
|
"cfg-if",
|
|
1326
|
-
"windows-targets 0.
|
|
1318
|
+
"windows-targets 0.52.6",
|
|
1327
1319
|
]
|
|
1328
1320
|
|
|
1329
1321
|
[[package]]
|
|
@@ -1970,18 +1962,18 @@ dependencies = [
|
|
|
1970
1962
|
|
|
1971
1963
|
[[package]]
|
|
1972
1964
|
name = "rb-sys"
|
|
1973
|
-
version = "0.9.
|
|
1965
|
+
version = "0.9.128"
|
|
1974
1966
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1975
|
-
checksum = "
|
|
1967
|
+
checksum = "45ca28513560e56cfb79a62b1fce363c73af170a182024ce880c77ee9429920a"
|
|
1976
1968
|
dependencies = [
|
|
1977
1969
|
"rb-sys-build",
|
|
1978
1970
|
]
|
|
1979
1971
|
|
|
1980
1972
|
[[package]]
|
|
1981
1973
|
name = "rb-sys-build"
|
|
1982
|
-
version = "0.9.
|
|
1974
|
+
version = "0.9.128"
|
|
1983
1975
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1984
|
-
checksum = "
|
|
1976
|
+
checksum = "ce04b2c55eff3a21aaa623fcc655d94373238e72cac6b3e1a3641ff31649f99a"
|
|
1985
1977
|
dependencies = [
|
|
1986
1978
|
"bindgen",
|
|
1987
1979
|
"lazy_static",
|
|
@@ -2074,9 +2066,9 @@ dependencies = [
|
|
|
2074
2066
|
|
|
2075
2067
|
[[package]]
|
|
2076
2068
|
name = "rustc-hash"
|
|
2077
|
-
version = "
|
|
2069
|
+
version = "2.1.2"
|
|
2078
2070
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2079
|
-
checksum = "
|
|
2071
|
+
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
|
|
2080
2072
|
|
|
2081
2073
|
[[package]]
|
|
2082
2074
|
name = "rustix"
|
data/Rakefile
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
require "bundler/gem_tasks"
|
|
2
2
|
require "rake/extensiontask"
|
|
3
|
-
require "rspec/core/rake_task"
|
|
4
3
|
|
|
5
|
-
#
|
|
6
|
-
|
|
4
|
+
# rspec is a DEVELOPMENT-only dependency. The cross-compile build container
|
|
5
|
+
# (rb-sys-dock, via scientist-labs/rust-gem-release) installs the runtime bundle
|
|
6
|
+
# only, so this require would raise LoadError and abort `rake` before the native
|
|
7
|
+
# build task can run. Guard it so this Rakefile always loads; the spec task simply
|
|
8
|
+
# isn't available in a build-only environment.
|
|
9
|
+
begin
|
|
10
|
+
require "rspec/core/rake_task"
|
|
11
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
12
|
+
rescue LoadError
|
|
13
|
+
desc "run specs (rspec unavailable in this environment)"
|
|
14
|
+
task(:spec) { abort "rspec is a development dependency and is not installed here" }
|
|
15
|
+
end
|
|
7
16
|
|
|
8
|
-
# Define the Rust extension
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
# Define the Rust extension. Passing the loaded gemspec to ExtensionTask makes
|
|
18
|
+
# rake-compiler expose the `native:<platform>` tasks rb-sys-dock invokes for each
|
|
19
|
+
# precompiled leg; without it the cross build fails with "Don't know how to build task".
|
|
20
|
+
GEMSPEC = Gem::Specification.load("clusterkit.gemspec")
|
|
21
|
+
Rake::ExtensionTask.new("clusterkit", GEMSPEC) do |ext|
|
|
11
22
|
ext.lib_dir = "lib/clusterkit"
|
|
12
23
|
ext.source_pattern = "*.{rs,toml}"
|
|
13
24
|
ext.cross_compile = true
|
|
14
|
-
|
|
25
|
+
# Union of the precompiled targets this gem ships: both glibc linux arches
|
|
26
|
+
# (assembled by oxidize-rb cross-gem in rb-sys-dock) plus Apple Silicon
|
|
27
|
+
# (built natively on a macOS runner).
|
|
28
|
+
ext.cross_platform = %w[x86_64-linux aarch64-linux arm64-darwin]
|
|
15
29
|
end
|
|
16
30
|
|
|
17
31
|
task default: [:compile, :spec]
|
data/ext/clusterkit/Cargo.toml
CHANGED
|
@@ -7,8 +7,7 @@ edition = "2021"
|
|
|
7
7
|
crate-type = ["cdylib"]
|
|
8
8
|
|
|
9
9
|
[dependencies]
|
|
10
|
-
magnus = {
|
|
11
|
-
annembed = { git = "https://github.com/scientist-labs/annembed", tag = "clusterkit-0.2.6" }
|
|
10
|
+
magnus = "0.8"annembed = { git = "https://github.com/scientist-labs/annembed", tag = "clusterkit-0.2.6" }
|
|
12
11
|
hnsw_rs = { git = "https://github.com/scientist-labs/hnswlib-rs", tag = "clusterkit-0.1.0" }
|
|
13
12
|
hdbscan = "0.11"
|
|
14
13
|
ndarray = "0.16"
|
data/ext/clusterkit/extconf.rb
CHANGED
|
@@ -3,10 +3,21 @@ require "rb_sys/mkmf"
|
|
|
3
3
|
|
|
4
4
|
create_rust_makefile("clusterkit/clusterkit") do |r|
|
|
5
5
|
if ENV["CLUSTERKIT_FEATURES"]
|
|
6
|
+
# Explicit override wins (set CLUSTERKIT_FEATURES=openblas-static,... to force a backend).
|
|
6
7
|
r.extra_cargo_args += ["--no-default-features"]
|
|
7
8
|
r.features = ENV["CLUSTERKIT_FEATURES"].split(",")
|
|
8
9
|
elsif RUBY_PLATFORM =~ /darwin/
|
|
10
|
+
# macOS links the system Accelerate framework — no OpenBLAS build needed.
|
|
9
11
|
r.extra_cargo_args += ["--no-default-features"]
|
|
10
12
|
r.features = ["macos-accelerate"]
|
|
13
|
+
elsif RUBY_PLATFORM =~ /linux/
|
|
14
|
+
# Linux: link the SYSTEM OpenBLAS/LAPACK (apt: libopenblas-dev liblapack-dev
|
|
15
|
+
# gfortran, provided by the rust-gem-cross image) instead of the default
|
|
16
|
+
# `openblas-static` feature, which compiles OpenBLAS from C+Fortran source.
|
|
17
|
+
# rb-sys-dock does NOT forward host env to extconf and a .cargo/config.toml
|
|
18
|
+
# [env] only reaches cargo-spawned procs (not mkmf), so this backend choice
|
|
19
|
+
# must live in committed code — it cannot be passed via a workflow input.
|
|
20
|
+
r.extra_cargo_args += ["--no-default-features"]
|
|
21
|
+
r.features = ["openblas-system"]
|
|
11
22
|
end
|
|
12
23
|
end
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Load the compiled Rust extension. Precompiled (platform) gems install it into a
|
|
4
|
+
# Ruby-ABI-versioned subdir (lib/clusterkit/<major.minor>/clusterkit.{so,bundle}) so a
|
|
5
|
+
# single fat gem can carry a binary per Ruby version; source/dev builds place it flat at
|
|
6
|
+
# lib/clusterkit/clusterkit.{so,bundle}. Try the versioned path first, fall back to the
|
|
7
|
+
# flat one. Resolution goes through $LOAD_PATH (`require`, never `require_relative`)
|
|
8
|
+
# because RubyGems installs native extensions outside the gem's lib/ dir.
|
|
3
9
|
begin
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
RUBY_VERSION =~ /(\d+\.\d+)/
|
|
11
|
+
require "clusterkit/#{Regexp.last_match(1)}/clusterkit"
|
|
6
12
|
rescue LoadError
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
end
|
|
13
|
+
require "clusterkit/clusterkit"
|
|
14
|
+
end
|
data/lib/clusterkit/version.rb
CHANGED
data/lib/clusterkit.rb
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "clusterkit/version"
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
# Load the native extension. Precompiled platform gems install one .so/.bundle per
|
|
6
|
+
# Ruby ABI under lib/clusterkit/<major.minor>/, while a source build (and the native
|
|
7
|
+
# darwin gem) produce the flat lib/clusterkit/clusterkit.{so,bundle}. Try the
|
|
8
|
+
# versioned path first, then fall back to flat. Use `require` (not
|
|
9
|
+
# `require_relative`) so RubyGems can resolve the extension through $LOAD_PATH when
|
|
10
|
+
# it installs native artifacts outside lib/.
|
|
11
|
+
begin
|
|
12
|
+
RUBY_VERSION =~ /(\d+\.\d+)/
|
|
13
|
+
require "clusterkit/#{Regexp.last_match(1)}/clusterkit"
|
|
14
|
+
rescue LoadError
|
|
15
|
+
require "clusterkit/clusterkit"
|
|
16
|
+
end
|
|
17
|
+
|
|
5
18
|
require_relative "clusterkit/configuration"
|
|
6
19
|
|
|
7
20
|
# Main module for ClusterKit gem
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: clusterkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.1.pre.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Petersen
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rb_sys
|
|
@@ -192,7 +191,6 @@ metadata:
|
|
|
192
191
|
homepage_uri: https://github.com/scientist-labs/clusterkit
|
|
193
192
|
source_code_uri: https://github.com/scientist-labs/clusterkit
|
|
194
193
|
changelog_uri: https://github.com/scientist-labs/clusterkit/blob/main/CHANGELOG.md
|
|
195
|
-
post_install_message:
|
|
196
194
|
rdoc_options: []
|
|
197
195
|
require_paths:
|
|
198
196
|
- lib
|
|
@@ -207,8 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
207
205
|
- !ruby/object:Gem::Version
|
|
208
206
|
version: '0'
|
|
209
207
|
requirements: []
|
|
210
|
-
rubygems_version: 3.
|
|
211
|
-
signing_key:
|
|
208
|
+
rubygems_version: 3.6.9
|
|
212
209
|
specification_version: 4
|
|
213
210
|
summary: High-performance clustering and dimensionality reduction for Ruby
|
|
214
211
|
test_files: []
|