numo-blis 0.2.0 → 0.4.1

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: '09533d7e6a34154affbbfbb3bf8788c25a9eb9c5711dcc68aaf13b457c18986f'
4
- data.tar.gz: 2856a6a930c539af6f134b598f08d54ee53da8b40bbe524d6deab44b5dacbd7d
3
+ metadata.gz: 6cc4fbd4df419308bfbd867616a494c3030718fe7552d43e0812fcb5f339c567
4
+ data.tar.gz: 747171dc415ea8b12d50ce112c896aaf4e93a4616648ec34b4542819def4e614
5
5
  SHA512:
6
- metadata.gz: 2035b24379d38daa06e1b3ecd071f5926d00f0673a9190d2fc42d0f58464a62a7aea8fbc347c8ab71534cad02e05a54a002bfda36e5fc46b07b78108bc216adb
7
- data.tar.gz: '0699449615647ef228361d6d2e8e73cb7f20bad8cba35a7d62bbd712d38c901fa54c7efb6702daba9f1af17538b7e6b2e831d76f1f95da81b6f9d54edcbce21a'
6
+ metadata.gz: 7459dd80eaeb0ed69d51da6954b62276e9ca03f8029175157bc8bc3c836541cef27a1528325a5800224920007821117828e33fec62f94127ed767baa54b2be91
7
+ data.tar.gz: b2bcf7a51132f23fe5dc9c154523658777efa785fbde8f95579ee976f34039864b3c5fa0b2cf011b789bd5a3626c93e8eb44756c347230b86190d8d5c2a82c34
data/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
- ## [Unreleased]
1
+ ## [0.4.1] - 2022-07-31
2
+
3
+ - Refactor codes and configs with RuboCop.
4
+
5
+ ## [0.4.0] - 2022-04-15
6
+
7
+ - Change the version of BLIS to be downloaded to 0.9.0.
8
+
9
+ ## [0.3.0] - 2022-01-30
10
+
11
+ - Changed to use generic CPU type when installing on Apple M1 mac.
12
+ - Fixed a typo on threading method detection process.
13
+ - Introduced conventional commits.
2
14
 
3
15
  ## [0.2.0] - 2021-07-31
4
16
 
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021 Atsushi Tatsuma
1
+ Copyright (c) 2021-2022 Atsushi Tatsuma
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -33,6 +33,10 @@ Or install it yourself as:
33
33
 
34
34
  $ gem install numo-blis
35
35
 
36
+ Note:
37
+ Currently, when installing on Apple M1 mac, Numo::BLIS gives `generic` to the CPU type option of BLIS.
38
+ It is possible that BLIS is not fully optimized and has low performance.
39
+
36
40
  ## Usage
37
41
 
38
42
  Numo::BLIS loads Numo::NArray and Numo::Linalg using BLIS as a background library.
@@ -59,7 +63,7 @@ Moreover, the versions of background libraries are defined by constants.
59
63
 
60
64
  Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/numo-blis.
61
65
  This project is intended to be a safe, welcoming space for collaboration,
62
- and contributors are expected to adhere to the [code of conduct](https://github.com/yoshoku/numo-blis/blob/main/CODE_OF_CONDUCT.md).
66
+ and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
63
67
 
64
68
  ## License
65
69
 
@@ -23,7 +23,7 @@ void Init_blisext()
23
23
  mBLIS = rb_define_module_under(mNumo, "BLIS");
24
24
 
25
25
  /* The version of BLIS used as a background library. */
26
- rb_define_const(mBLIS, "BLIS_VERSION", rb_str_new_cstr("0.8.1"));
26
+ rb_define_const(mBLIS, "BLIS_VERSION", rb_str_new_cstr("0.9.0"));
27
27
 
28
28
  /* The version of LAPACK used as a background library. */
29
29
  rb_define_const(mBLIS, "LAPACK_VERSION", rb_str_new_cstr("3.10.0"));
@@ -10,7 +10,7 @@ require 'rubygems/package'
10
10
  ENABLE_THREADING_ARG = arg_config('--enable-threading')
11
11
 
12
12
  VENDOR_DIR = File.expand_path("#{__dir__}/../../../vendor")
13
- SOEXT = RbConfig::CONFIG['SOEXT'] || case RUBY_PLATFORM
13
+ SOEXT = RbConfig::CONFIG['SOEXT'] || case RbConfig::CONFIG['host_os']
14
14
  when /mswin|msys|mingw|cygwin/
15
15
  'dll'
16
16
  when /darwin|mac os/
@@ -19,13 +19,13 @@ SOEXT = RbConfig::CONFIG['SOEXT'] || case RUBY_PLATFORM
19
19
  'so'
20
20
  end
21
21
 
22
- BLIS_VERSION = '0.8.1'
22
+ BLIS_VERSION = '0.9.0'
23
23
  LAPACK_VERSION = '3.10.0'
24
24
  BLIS_URI = "https://github.com/flame/blis/archive/refs/tags/#{BLIS_VERSION}.tar.gz"
25
25
  LAPACK_URI = "https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v#{LAPACK_VERSION}.tar.gz"
26
26
  BLIS_TGZ = "#{VENDOR_DIR}/tmp/blis-#{BLIS_VERSION}.tgz"
27
27
  LAPACK_TGZ = "#{VENDOR_DIR}/tmp/lapack-#{LAPACK_VERSION}.tgz"
28
- BLIS_KEY = 'ce5998fccfac88153f1e52d6497020529a3b5217'
28
+ BLIS_KEY = 'c5ff9b0437edc1f93ad30fcdd633c0a276165b7e'
29
29
  LAPACK_KEY = '4a9384523bf236c83568884e8c62d9517e41ac42'
30
30
  RB_CC = "'#{RbConfig::expand('$(CC)')}'"
31
31
  RB_CXX = "'#{RbConfig::expand('$(CPP)')}'"
@@ -34,17 +34,18 @@ BLIS_THREADING = if ['openmp', 'pthreads', 'no'].include?(ENABLE_THREADING_ARG)
34
34
  ENABLE_THREADING_ARG
35
35
  elsif try_compile('#include <omp.h>')
36
36
  'openmp'
37
- elsif try_complie('#include <pthread.h>')
37
+ elsif try_compile('#include <pthread.h>')
38
38
  'pthreads'
39
39
  else
40
40
  'no'
41
41
  end
42
+ BLIS_CPU = RbConfig::CONFIG['host_os'] =~ /darwin|mac os/i && RbConfig::CONFIG['host_cpu'] =~ /arm|aarch/i ? 'generic' : 'auto'
42
43
  BLIS_CONFIGURE_OPTIONS = ['--enable-cblas',
43
44
  "--enable-threading=#{BLIS_THREADING}",
44
45
  "--prefix=#{VENDOR_DIR}",
45
46
  "CC=#{RB_CC}",
46
47
  "CXX=#{RB_CXX}",
47
- 'auto'].join(' ')
48
+ "#{BLIS_CPU}"].join(' ')
48
49
  LAPACK_CMAKE_OPTIONS = ["-DBLAS_LIBRARIES='#{VENDOR_DIR}/lib/libblis.#{SOEXT}'",
49
50
  '-DLAPACKE=ON',
50
51
  '-DBUILD_SHARED_LIBS=ON',
@@ -5,6 +5,6 @@ module Numo
5
5
  # Numo::BLIS loads Numo::NArray and Linalg with BLIS used as backend library.
6
6
  module BLIS
7
7
  # The version of Numo::BLIS you install.
8
- VERSION = '0.2.0'
8
+ VERSION = '0.4.1'
9
9
  end
10
10
  end
data/lib/numo/blis.rb CHANGED
@@ -16,15 +16,15 @@ module Numo
16
16
  # @!visibility private
17
17
  def load_blis(*dirs, exc: true)
18
18
  dirs.each do |d|
19
- begin
20
- f_blis = dlopen(Blas, 'libblis', d)
21
- f_lapacke = dlopen(Lapack, 'liblapacke', d)
22
- @@libs = [f_blis, f_lapacke].compact
23
- return true
24
- rescue
25
- end
19
+ f_blis = dlopen(Blas, 'libblis', d)
20
+ f_lapacke = dlopen(Lapack, 'liblapacke', d)
21
+ @@libs = [f_blis, f_lapacke].compact # rubocop:disable Style/ClassVars
22
+ return true
23
+ rescue StandardError
24
+ # Suppress errors as well as loading methods in Numo::Linalg::Loader.
26
25
  end
27
26
  raise 'Failed to find BLIS/LAPACK library' if exc
27
+
28
28
  false
29
29
  end
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numo-blis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-31 00:00:00.000000000 Z
11
+ date: 2022-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-linalg
@@ -34,20 +34,13 @@ extensions:
34
34
  - ext/numo/blis/extconf.rb
35
35
  extra_rdoc_files: []
36
36
  files:
37
- - ".github/workflows/build.yml"
38
- - ".gitignore"
39
- - ".rspec"
40
37
  - CHANGELOG.md
41
- - CODE_OF_CONDUCT.md
42
- - Gemfile
43
38
  - LICENSE.txt
44
39
  - README.md
45
- - Rakefile
46
40
  - ext/numo/blis/blisext.c
47
41
  - ext/numo/blis/extconf.rb
48
42
  - lib/numo/blis.rb
49
43
  - lib/numo/blis/version.rb
50
- - numo-blis.gemspec
51
44
  - vendor/tmp/.gitkeep
52
45
  homepage: https://github.com/yoshoku/numo-blis
53
46
  licenses:
@@ -57,6 +50,7 @@ metadata:
57
50
  source_code_uri: https://github.com/yoshoku/numo-blis
58
51
  changelog_uri: https://github.com/yoshoku/numo-blis/blob/main/CHANGELOG.md
59
52
  documentation_uri: https://github.com/yoshoku/numo-blis/blob/main/README.md
53
+ rubygems_mfa_required: 'true'
60
54
  post_install_message:
61
55
  rdoc_options: []
62
56
  require_paths:
@@ -72,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
66
  - !ruby/object:Gem::Version
73
67
  version: '0'
74
68
  requirements: []
75
- rubygems_version: 3.2.22
69
+ rubygems_version: 3.2.33
76
70
  signing_key:
77
71
  specification_version: 4
78
72
  summary: Numo::BLIS downloads and builds BLIS during installation and uses that as
@@ -1,22 +0,0 @@
1
- name: build
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- strategy:
9
- fail-fast: false
10
- matrix:
11
- ruby: [ '2.6', '2.7', '3.0' ]
12
- steps:
13
- - uses: actions/checkout@v2
14
- - name: Install gcc and gfortran
15
- run: sudo apt-get install -y gcc gfortran
16
- - name: Set up Ruby ${{ matrix.ruby }}
17
- uses: ruby/setup-ruby@v1
18
- with:
19
- ruby-version: ${{ matrix.ruby }}
20
- bundler-cache: true
21
- - name: Build and test with Rake
22
- run: bundle exec rake
data/.gitignore DELETED
@@ -1,24 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- /vendor/lib/
11
- /vendor/include/
12
- /vendor/share/
13
- /vendor/installed_*
14
- /vendor/tmp/blis*
15
- /vendor/tmp/lapack*
16
-
17
- # rspec failure tracking
18
- .rspec_status
19
-
20
- *.bundle
21
- .ruby-version
22
-
23
- *.swp
24
- .DS_Store
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at yoshoku@outlook.com. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in numo-blis.gemspec
6
- gemspec
7
-
8
- gem 'rake', '~> 13.0'
9
- gem 'rake-compiler', '~> 1.1'
10
- gem 'rspec', '~> 3.0'
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require 'rake/extensiontask'
9
-
10
- task build: :compile
11
-
12
- Rake::ExtensionTask.new('blisext') do |ext|
13
- ext.ext_dir = 'ext/numo/blis'
14
- ext.lib_dir = 'lib/numo/blis'
15
- end
16
-
17
- task default: %i[clobber compile spec]
data/numo-blis.gemspec DELETED
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/numo/blis/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'numo-blis'
7
- spec.version = Numo::BLIS::VERSION
8
- spec.authors = ['yoshoku']
9
- spec.email = ['yoshoku@outlook.com']
10
-
11
- spec.summary = <<~MSG
12
- Numo::BLIS downloads and builds BLIS during installation and
13
- uses that as a background library for Numo::Linalg.
14
- MSG
15
- spec.description = <<~MSG
16
- Numo::BLIS downloads and builds BLIS during installation and
17
- uses that as a background library for Numo::Linalg.
18
- MSG
19
- spec.homepage = 'https://github.com/yoshoku/numo-blis'
20
- spec.license = 'BSD-3-Clause'
21
-
22
- spec.metadata['homepage_uri'] = spec.homepage
23
- spec.metadata['source_code_uri'] = spec.homepage
24
- spec.metadata['changelog_uri'] = 'https://github.com/yoshoku/numo-blis/blob/main/CHANGELOG.md'
25
- spec.metadata['documentation_uri'] = 'https://github.com/yoshoku/numo-blis/blob/main/README.md'
26
-
27
- # Specify which files should be added to the gem when it is released.
28
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
30
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
31
- end
32
- spec.bindir = 'exe'
33
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
34
- spec.require_paths = ['lib']
35
- spec.extensions = ['ext/numo/blis/extconf.rb']
36
-
37
- # Uncomment to register a new dependency of your gem
38
- # spec.add_dependency "example-gem", "~> 1.0"
39
- spec.add_dependency 'numo-linalg', '>= 0.1.4'
40
-
41
- # For more information and examples about making a new gem, checkout our
42
- # guide at: https://bundler.io/guides/creating_gem.html
43
- end