numo-tiny_linalg 0.3.0 → 0.3.2

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: dd5b3d90b9c0bc323420f2eed5363490ec7c2ec4a3b0950573f54f234d534eaf
4
- data.tar.gz: cd0a71621d1e3e935faba0a40036b3950c0f6ac32a74cdaad46b0e313b5dfa2f
3
+ metadata.gz: 3379a2dcd3ccd4ec37e0d8edca6e10e954891df2fc563b78adb9709a7160df61
4
+ data.tar.gz: 4d52946c1fa66687c590aa5c591057756766b385317585104d75e16d519486b8
5
5
  SHA512:
6
- metadata.gz: f904406ce9c883d59d93afc061bfc65c96073dc9660cb65e6eefa97e2be32cc8c79ac26970a8b181cd3acbdbd412cf97c08153017956c4cc4f2b29bf28bcda46
7
- data.tar.gz: 8f3ee9b0e0e9c3789f61148db03d43c245dab66fc4cb428488cbe668dad00b0d7fb73ef825e5dc0c5772ba817d41bb90d5fce843ece1f1adf6fe81857b9917ff
6
+ metadata.gz: 7238ec5a839348a060bb9eac27c3096600e489a9cf78f20e6bef608f84d1d2899e35e97b02180dfd3622ad966115c9fc0545cc471306418eed25039d15a89cfa
7
+ data.tar.gz: e15c5fa82989ca11aeca1eba79b6f690a20d4b3ad071b8a595bc469f16afc651df6ee1c9c92f9f9a01257354dae5b4b837a81e0e4ed6d6c9e87c725f38ea186b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [[0.3.2](https://github.com/yoshoku/numo-tiny_linalg/compare/v0.3.1...v0.4.0)] - 2023-09-04
4
+ - Bump OpenBLAS to be downloaded from 0.3.23 to 0.3.24.
5
+
6
+ ## [[0.3.1](https://github.com/yoshoku/numo-tiny_linalg/compare/v0.3.0...v0.3.1)] - 2023-08-15
7
+ - Support automatic build of OpenBLAS on Windows.
8
+ - The author does not have a Windows PC. It will probably work.
9
+ - Add OPENBLAS_VERSION constant to TinyLinalg.
10
+
3
11
  ## [[0.3.0](https://github.com/yoshoku/numo-tiny_linalg/compare/v0.2.0...v0.3.0)] - 2023-08-13
4
12
  - Add cholesky and cho_solve module functions to TinyLinalg.
5
13
 
@@ -18,7 +18,9 @@ end
18
18
 
19
19
  abort 'numo/narray.h is not found' unless have_header('numo/narray.h')
20
20
 
21
- if RUBY_PLATFORM.match?(/mswin|cygwin|mingw/)
21
+ on_windows = RUBY_PLATFORM.match?(/mswin|cygwin|mingw/)
22
+
23
+ if on_windows
22
24
  $LOAD_PATH.each do |lp|
23
25
  if File.exist?(File.join(lp, 'numo/libnarray.a'))
24
26
  $LDFLAGS = "-L#{lp}/numo #{$LDFLAGS}"
@@ -31,13 +33,6 @@ end
31
33
  abort 'libstdc++ is not found.' unless have_library('stdc++')
32
34
  $CXXFLAGS << ' -std=c++11'
33
35
 
34
- # NOTE: Accelerate framework does not support LAPACKE.
35
- # use_accelerate = false
36
- # if RUBY_PLATFORM.include?('darwin') && have_framework('Accelerate')
37
- # $CFLAGS << ' -DTINYLINALG_USE_ACCELERATE'
38
- # use_accelerate = true
39
- # end
40
-
41
36
  build_openblas = false
42
37
  unless find_library('openblas', 'LAPACKE_dsyevr')
43
38
  build_openblas = true unless have_library('openblas')
@@ -51,8 +46,9 @@ if build_openblas
51
46
  warn 'BLAS and LAPACKE APIs are not found. Downloading and Building OpenBLAS...'
52
47
 
53
48
  VENDOR_DIR = File.expand_path("#{__dir__}/../../../vendor")
54
- OPENBLAS_VER = '0.3.23'
55
- OPENBLAS_KEY = '115634b39007de71eb7e75cf7591dfb2'
49
+ TINYLINALG_DIR = File.expand_path("#{__dir__}/../../../lib/numo/tiny_linalg")
50
+ OPENBLAS_VER = '0.3.24'
51
+ OPENBLAS_KEY = '23599a30e4ce887590957d94896789c8'
56
52
  OPENBLAS_URI = "https://github.com/xianyi/OpenBLAS/archive/v#{OPENBLAS_VER}.tar.gz"
57
53
  OPENBLAS_TGZ = "#{VENDOR_DIR}/tmp/openblas.tgz"
58
54
 
@@ -82,18 +78,19 @@ if build_openblas
82
78
  File.open("#{VENDOR_DIR}/tmp/openblas.log", 'a') { |f| f.puts(insstdout) }
83
79
  abort("Failed to install OpenBLAS. Check the openblas.log file for more details: #{VENDOR_DIR}/tmp/openblas.log") unless insstatus.success?
84
80
 
81
+ FileUtils.cp("#{VENDOR_DIR}/lib/libopenblas.a", TINYLINALG_DIR) if on_windows
82
+
85
83
  FileUtils.touch("#{VENDOR_DIR}/installed_#{OPENBLAS_VER}")
86
84
  end
87
85
  end
88
86
 
89
- abort('libopenblas is not found.') unless find_library('openblas', nil, "#{VENDOR_DIR}/lib")
87
+ libopenblas_dir = on_windows ? TINYLINALG_DIR : "#{VENDOR_DIR}/lib"
88
+ abort('libopenblas is not found.') unless find_library('openblas', nil, libopenblas_dir)
90
89
  abort('openblas_config.h is not found.') unless find_header('openblas_config.h', nil, "#{VENDOR_DIR}/include")
91
90
  abort('cblas.h is not found.') unless find_header('cblas.h', nil, "#{VENDOR_DIR}/include")
92
91
  abort('lapacke.h is not found.') unless find_header('lapacke.h', nil, "#{VENDOR_DIR}/include")
93
92
  end
94
93
 
95
- $CFLAGS << ' -DNUMO_TINY_LINALG_USE_OPENBLAS'
96
-
97
94
  if RUBY_PLATFORM.include?('darwin') && Gem::Version.new('3.1.0') <= Gem::Version.new(RUBY_VERSION) &&
98
95
  try_link('int main(void){return 0;}', '-Wl,-undefined,dynamic_lookup')
99
96
  $LDFLAGS << ' -Wl,-undefined,dynamic_lookup'
@@ -248,6 +248,9 @@ extern "C" void Init_tiny_linalg(void) {
248
248
  */
249
249
  rb_mTinyLinalgLapack = rb_define_module_under(rb_mTinyLinalg, "Lapack");
250
250
 
251
+ /* The version of OpenBLAS used in background library. */
252
+ rb_define_const(rb_mTinyLinalg, "OPENBLAS_VERSION", rb_str_new_cstr(OPENBLAS_VERSION));
253
+
251
254
  /**
252
255
  * Returns BLAS char ([sdcz]) defined by data-type of arguments.
253
256
  *
@@ -33,6 +33,7 @@
33
33
 
34
34
  #include <cblas.h>
35
35
  #include <lapacke.h>
36
+ #include <openblas_config.h>
36
37
 
37
38
  #include <string>
38
39
 
@@ -5,6 +5,6 @@ module Numo
5
5
  # Numo::TinyLinalg is a subset library from Numo::Linalg consisting only of methods used in Machine Learning algorithms.
6
6
  module TinyLinalg
7
7
  # The version of Numo::TinyLinalg you install.
8
- VERSION = '0.3.0'
8
+ VERSION = '0.3.2'
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numo-tiny_linalg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-13 00:00:00.000000000 Z
11
+ date: 2023-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray
@@ -24,10 +24,9 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.1
27
- description: 'Numo::TinyLinalg is a subset library from Numo::Linalg consisting only
28
- of methods used in Machine Learning algorithms.
29
-
30
- '
27
+ description: |
28
+ Numo::TinyLinalg is a subset library from Numo::Linalg consisting only of methods used in Machine Learning algorithms.
29
+ The functions Numo::TinyLinalg supports are dot, det, eigh, inv, pinv, qr, solve, cholesky, cho_solve and svd.
31
30
  email:
32
31
  - yoshoku@outlook.com
33
32
  executables: []