faiss 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01c09476fa378a49da82beddeab101d2c4ac124346260f56fe4dab0312b9c1ba
4
- data.tar.gz: 587c6213b479cf979fca6c21c9f4a08cc56825e9403b84fff98e33b6a8759e5b
3
+ metadata.gz: 106966f6d5e7f6a3f5237a2ebb59912304bbe319ba2891c45166c753fc0e9df1
4
+ data.tar.gz: 3d72777c777d75beb15c09cb223c4e63f188b7e89fab06d6fa9268bc2be4ff59
5
5
  SHA512:
6
- metadata.gz: 38f65e098d1ac5ff8217bcdbafb68673dc6a37804175f00c0076cfad56534dcd6776dd294d5bb5178cf87b749fb342447255aa35fc39c1afbcf2011499285981
7
- data.tar.gz: 0f62e4e4c7ead6503e935a26d2ae6d3a4fc3d83db19b648337be5847c598ad82235968aed368a0d75b64aad161518006cf91836e9315c00d7e4c67250b6a1bad
6
+ metadata.gz: b1d822fd4e0850dd667aba09a02f81c43e2afde90a6d88fff1e631539a8d47f42b4dfe0705980a6ff8be88b021af805998d1e70b09cd1010302702a1c1363cac
7
+ data.tar.gz: 24e4febd81142150541199523f0b1e19a0be7c658e504472778173e38006234ea47f7e362c1396c3135b4449b7ab5229dc027c4bcea59c880902e1fa23e3c956
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.3 (2021-12-17)
2
+
3
+ - Fixed installation error with ARM Mac
4
+
1
5
  ## 0.2.2 (2021-06-08)
2
6
 
3
7
  - Fixed installation error
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # Faiss
1
+ # Faiss Ruby
2
2
 
3
3
  [Faiss](https://github.com/facebookresearch/faiss) - efficient similarity search and clustering - for Ruby
4
4
 
5
5
  Learn more about [Faiss](https://engineering.fb.com/data-infrastructure/faiss-a-library-for-efficient-similarity-search/)
6
6
 
7
- [![Build Status](https://github.com/ankane/faiss/workflows/build/badge.svg?branch=master)](https://github.com/ankane/faiss/actions)
7
+ [![Build Status](https://github.com/ankane/faiss-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/faiss-ruby/actions)
8
8
 
9
9
  ## Installation
10
10
 
@@ -220,22 +220,22 @@ Numo::NArray.cast([[1, 2, 3], [4, 5, 6]])
220
220
 
221
221
  ## History
222
222
 
223
- View the [changelog](https://github.com/ankane/faiss/blob/master/CHANGELOG.md)
223
+ View the [changelog](https://github.com/ankane/faiss-ruby/blob/master/CHANGELOG.md)
224
224
 
225
225
  ## Contributing
226
226
 
227
227
  Everyone is encouraged to help improve this project. Here are a few ways you can help:
228
228
 
229
- - [Report bugs](https://github.com/ankane/faiss/issues)
230
- - Fix bugs and [submit pull requests](https://github.com/ankane/faiss/pulls)
229
+ - [Report bugs](https://github.com/ankane/faiss-ruby/issues)
230
+ - Fix bugs and [submit pull requests](https://github.com/ankane/faiss-ruby/pulls)
231
231
  - Write, clarify, or fix documentation
232
232
  - Suggest or add new features
233
233
 
234
234
  To get started with development:
235
235
 
236
236
  ```sh
237
- git clone --recursive https://github.com/ankane/faiss.git
238
- cd faiss
237
+ git clone --recursive https://github.com/ankane/faiss-ruby.git
238
+ cd faiss-ruby
239
239
  bundle install
240
240
  bundle exec rake compile
241
241
  bundle exec rake test
data/ext/faiss/extconf.rb CHANGED
@@ -5,10 +5,12 @@ abort "BLAS not found" unless have_library("blas")
5
5
  abort "LAPACK not found" unless have_library("lapack")
6
6
  abort "OpenMP not found" unless have_library("omp") || have_library("gomp")
7
7
 
8
- numo = $LOAD_PATH.find { |v| File.exist?("#{v}/numo/numo/narray.h") }
9
- abort "Numo not found" unless numo && find_header("numo/narray.h", "#{numo}/numo")
8
+ numo = File.join(Gem.loaded_specs["numo-narray"].require_path, "numo")
9
+ abort "Numo not found" unless find_header("numo/narray.h", numo)
10
10
 
11
- $CXXFLAGS << " -std=c++17 $(optflags) -DFINTEGER=int " << with_config("optflags", "-march=native")
11
+ # -march=native not supported with ARM Mac
12
+ default_optflags = RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i ? "" : "-march=native"
13
+ $CXXFLAGS << " -std=c++17 $(optflags) -DFINTEGER=int " << with_config("optflags", default_optflags)
12
14
 
13
15
  ext = File.expand_path(".", __dir__)
14
16
  vendor = File.expand_path("../../vendor/faiss", __dir__)
data/ext/faiss/numo.hpp CHANGED
@@ -24,19 +24,19 @@ namespace numo {
24
24
  return this->_value;
25
25
  }
26
26
 
27
- size_t ndim() {
27
+ size_t ndim() const {
28
28
  return RNARRAY_NDIM(this->_value);
29
29
  }
30
30
 
31
- size_t* shape() {
31
+ size_t* shape() const {
32
32
  return RNARRAY_SHAPE(this->_value);
33
33
  }
34
34
 
35
- size_t size() {
35
+ size_t size() const {
36
36
  return RNARRAY_SIZE(this->_value);
37
37
  }
38
38
 
39
- bool is_contiguous() {
39
+ bool is_contiguous() const {
40
40
  return nary_check_contiguous(this->_value) == Qtrue;
41
41
  }
42
42
 
data/ext/faiss/utils.cpp CHANGED
@@ -1,6 +1,6 @@
1
1
  #include "utils.h"
2
2
 
3
- size_t check_shape(numo::NArray objects, size_t k) {
3
+ size_t check_shape(const numo::NArray& objects, size_t k) {
4
4
  auto ndim = objects.ndim();
5
5
  if (ndim != 2) {
6
6
  throw Rice::Exception(rb_eArgError, "expected 2 dimensions, not %d", ndim);
data/ext/faiss/utils.h CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  #include "numo.hpp"
4
4
 
5
- size_t check_shape(numo::NArray objects, size_t k);
5
+ size_t check_shape(const numo::NArray& objects, size_t k);
data/lib/faiss/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Faiss
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faiss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-08 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice
@@ -259,7 +259,7 @@ files:
259
259
  - vendor/faiss/faiss/utils/simdlib_neon.h
260
260
  - vendor/faiss/faiss/utils/utils.cpp
261
261
  - vendor/faiss/faiss/utils/utils.h
262
- homepage: https://github.com/ankane/faiss
262
+ homepage: https://github.com/ankane/faiss-ruby
263
263
  licenses:
264
264
  - MIT
265
265
  metadata: {}
@@ -278,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
278
  - !ruby/object:Gem::Version
279
279
  version: '0'
280
280
  requirements: []
281
- rubygems_version: 3.2.3
281
+ rubygems_version: 3.2.32
282
282
  signing_key:
283
283
  specification_version: 4
284
284
  summary: Efficient similarity search and clustering for Ruby