numo-openblas 0.4.9 → 0.4.11

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: f3992584075243b93b120749f8363ec1d3a32f2403342f52260e4dc55ff92b39
4
- data.tar.gz: a8bf97ef48ce9f745105301ebf86f61f3a38125388783e59b02ecd81da299147
3
+ metadata.gz: 6dfc35bf1fad150b133c35591cac8b5ef8733bfb6330d6a1e831a662d2fc77e9
4
+ data.tar.gz: 3baa6585182c222cfe278a78644934da4528ec66443ed868b2b3d23f290dd934
5
5
  SHA512:
6
- metadata.gz: e35af4c011aac12b77f226dda01a8fa1b3ed90a90f3aa5f1ef42f2d4548de28fc80c367821b48502899bb364fbf95a55d4be9dfc1475c1f3f7f746a523f60722
7
- data.tar.gz: cc429204340fa5bb3c5add549e309160954b1fea89c9b40b5180845a00903b8f41e2a3efa6ee37eba24a705058c44118f3ced6976f28258b6bbe47587fed614a
6
+ metadata.gz: f449515f70a29ca8859af3889ec0e63e8a9958fb7916ab31b2809b3e5b8ce566b4d8cd692a38cc2c80ae185bc439f2189aeaab2a96f40eae2bae11bdd987ee6f
7
+ data.tar.gz: 05370f4f78a8734183fc3e7d1ce9cc58a3e8d543be102826924ffaa03775702fcaafd9c38331b40a7c307640c5c22c3644cad9f590b5edaef095ff33c73f781c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.4.11
2
+ - Change the version of OpenBLAS to be downloaded to 0.3.24.
3
+
4
+ ## 0.4.10
5
+ - Refactor extconf.rb with RuboCop.
6
+ - Change to check download file with MD5.
7
+ - Add vendor/bin directory to OpenBLAS load directory for Windows ([#2](https://github.com/yoshoku/numo-openblas/pull/2)).
8
+ - Since the author does not have a Windows PC, the operation cannot be confirmed.
9
+
1
10
  ## 0.4.9
2
11
  - Change the version of OpenBLAS to be downloaded to 0.3.23.
3
12
 
@@ -1,6 +1,6 @@
1
- # frozen-string-literal: true
1
+ # frozen_string_literal: true
2
2
 
3
- require 'digest/sha1'
3
+ require 'digest/md5'
4
4
  require 'etc'
5
5
  require 'fileutils'
6
6
  require 'mkmf'
@@ -8,17 +8,17 @@ require 'open-uri'
8
8
  require 'open3'
9
9
  require 'rubygems/package'
10
10
 
11
- OPENBLAS_VER = '0.3.23'
12
- OPENBLAS_KEY = '6b781727c7b95850ae4a3eb0a391492eb4f3e780'
11
+ OPENBLAS_VER = '0.3.24'
12
+ OPENBLAS_KEY = '23599a30e4ce887590957d94896789c8'
13
13
  OPENBLAS_URI = "https://github.com/xianyi/OpenBLAS/archive/v#{OPENBLAS_VER}.tar.gz"
14
- OPENBLAS_DIR = File.expand_path(__dir__ + '/../../../vendor')
14
+ OPENBLAS_DIR = File.expand_path("#{__dir__}/../../../vendor")
15
15
 
16
16
  unless File.exist?("#{OPENBLAS_DIR}/installed_#{OPENBLAS_VER}")
17
- URI.open(OPENBLAS_URI) do |rf|
18
- File.open("#{OPENBLAS_DIR}/tmp/openblas.tgz", 'wb') { |sf| sf.write(rf.read) }
19
- end
17
+ URI.parse(OPENBLAS_URI).open { |f| File.binwrite("#{OPENBLAS_DIR}/tmp/openblas.tgz", f.read) }
20
18
 
21
- abort('SHA1 digest of downloaded file does not match.') if OPENBLAS_KEY != Digest::SHA1.file("#{OPENBLAS_DIR}/tmp/openblas.tgz").to_s
19
+ if Digest::MD5.file("#{OPENBLAS_DIR}/tmp/openblas.tgz").to_s != OPENBLAS_KEY
20
+ abort('MD5 digest of downloaded file does not match.')
21
+ end
22
22
 
23
23
  Gem::Package::TarReader.new(Zlib::GzipReader.open("#{OPENBLAS_DIR}/tmp/openblas.tgz")) do |tar|
24
24
  tar.each do |entry|
@@ -28,7 +28,7 @@ unless File.exist?("#{OPENBLAS_DIR}/installed_#{OPENBLAS_VER}")
28
28
  next if filename == File.dirname(filename)
29
29
 
30
30
  FileUtils.mkdir_p("#{OPENBLAS_DIR}/tmp/#{File.dirname(entry.full_name)}")
31
- File.open(filename, 'wb') { |f| f.write(entry.read) }
31
+ File.binwrite(filename, entry.read)
32
32
  File.chmod(entry.header.mode, filename)
33
33
  end
34
34
  end
@@ -36,11 +36,15 @@ unless File.exist?("#{OPENBLAS_DIR}/installed_#{OPENBLAS_VER}")
36
36
  Dir.chdir("#{OPENBLAS_DIR}/tmp/OpenBLAS-#{OPENBLAS_VER}") do
37
37
  mkstdout, _mkstderr, mkstatus = Open3.capture3("make -j#{Etc.nprocessors}")
38
38
  File.open("#{OPENBLAS_DIR}/tmp/openblas.log", 'w') { |f| f.puts(mkstdout) }
39
- abort("Failed to build OpenBLAS. Check the openblas.log file for more details: #{OPENBLAS_DIR}/tmp/openblas.log") unless mkstatus.success?
39
+ unless mkstatus.success?
40
+ abort("Failed to build OpenBLAS. Check the openblas.log file for more details: #{OPENBLAS_DIR}/tmp/openblas.log")
41
+ end
40
42
 
41
43
  insstdout, _insstderr, insstatus = Open3.capture3("make install PREFIX=#{OPENBLAS_DIR}")
42
44
  File.open("#{OPENBLAS_DIR}/tmp/openblas.log", 'a') { |f| f.puts(insstdout) }
43
- abort("Failed to install OpenBLAS. Check the openblas.log file for more details: #{OPENBLAS_DIR}/tmp/openblas.log") unless insstatus.success?
45
+ unless insstatus.success?
46
+ abort("Failed to install OpenBLAS. Check the openblas.log file for more details: #{OPENBLAS_DIR}/tmp/openblas.log")
47
+ end
44
48
 
45
49
  FileUtils.touch("#{OPENBLAS_DIR}/installed_#{OPENBLAS_VER}")
46
50
  end
@@ -5,6 +5,6 @@ module Numo
5
5
  # Numo::OpenBLAS loads Numo::NArray and Linalg with OpenBLAS used as backend library.
6
6
  module OpenBLAS
7
7
  # The version of Numo::OpenBLAS you install.
8
- VERSION = '0.4.9'
8
+ VERSION = '0.4.11'
9
9
  end
10
10
  end
data/lib/numo/openblas.rb CHANGED
@@ -5,4 +5,7 @@ require 'numo/linalg/linalg'
5
5
  require 'numo/openblas/version'
6
6
  require 'numo/openblas/openblas'
7
7
 
8
- Numo::Linalg::Loader.load_openblas(File.expand_path("#{__dir__}/../../vendor/lib/"))
8
+ Numo::Linalg::Loader.load_openblas(
9
+ File.expand_path("#{__dir__}/../../vendor/lib/"),
10
+ File.expand_path("#{__dir__}/../../vendor/bin/")
11
+ )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numo-openblas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-03 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-linalg