numo-openblas 0.4.9 → 0.4.10

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: 3727204342344f16515ccd3e4bddd8f145df8a672ee1b900a58298e416b3daae
4
+ data.tar.gz: 6579a0317755f177e119077d76491b9c87a7483f29beee08d480a1c13c6fb3bc
5
5
  SHA512:
6
- metadata.gz: e35af4c011aac12b77f226dda01a8fa1b3ed90a90f3aa5f1ef42f2d4548de28fc80c367821b48502899bb364fbf95a55d4be9dfc1475c1f3f7f746a523f60722
7
- data.tar.gz: cc429204340fa5bb3c5add549e309160954b1fea89c9b40b5180845a00903b8f41e2a3efa6ee37eba24a705058c44118f3ced6976f28258b6bbe47587fed614a
6
+ metadata.gz: c5f8576676fb7739e0b9a652fbb47c4896957999e57fc4b83547422b4f43c93de49a07c03d79c333ddba1037a09d289ec74e2ff63248c8df6d6215c23745f3bb
7
+ data.tar.gz: d7b8052022a948d5cd9a8f3a808da131d0db2ab1606d01fe3e385ac4e2ef02329a8b4acd764cf6fb2b9735b8b9f6ce4f906c2b0709a84081bb13563e143fd934
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.4.10
2
+ - Refactor extconf.rb with RuboCop.
3
+ - Change to check download file with MD5.
4
+ - Add vendor/bin directory to OpenBLAS load directory for Windows ([#2](https://github.com/yoshoku/numo-openblas/pull/2)).
5
+ - Since the author does not have a Windows PC, the operation cannot be confirmed.
6
+
1
7
  ## 0.4.9
2
8
  - Change the version of OpenBLAS to be downloaded to 0.3.23.
3
9
 
@@ -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'
@@ -9,16 +9,16 @@ require 'open3'
9
9
  require 'rubygems/package'
10
10
 
11
11
  OPENBLAS_VER = '0.3.23'
12
- OPENBLAS_KEY = '6b781727c7b95850ae4a3eb0a391492eb4f3e780'
12
+ OPENBLAS_KEY = '115634b39007de71eb7e75cf7591dfb2'
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.10'
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.10
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-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-linalg