numo-blis 0.1.0 → 0.2.0

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: 971c5622cc488550e5121b2e5154ddc00a7bbf278af99ea9abb91e277a0bacb7
4
- data.tar.gz: d839070587642f51b3093601db00bcfb8ac29a953318c1b85558be64222c4b6e
3
+ metadata.gz: '09533d7e6a34154affbbfbb3bf8788c25a9eb9c5711dcc68aaf13b457c18986f'
4
+ data.tar.gz: 2856a6a930c539af6f134b598f08d54ee53da8b40bbe524d6deab44b5dacbd7d
5
5
  SHA512:
6
- metadata.gz: aba94ef6eeed63d75af97281bff116635beb6d5121c87d0e6d8ccff5c7b48c2b6519e4a412b16be31471c1423024046f9283147f5ecbcbc1bc67e994b39613cf
7
- data.tar.gz: e4870f8162f8a57e9fb3272935b9c9e617658974945adb5df8efbdbeae0cf43bb73a68b7e882587f5c02a616f2b104b2a9effdd7b3892bf85bfe617eb772e5b7
6
+ metadata.gz: 2035b24379d38daa06e1b3ecd071f5926d00f0673a9190d2fc42d0f58464a62a7aea8fbc347c8ab71534cad02e05a54a002bfda36e5fc46b07b78108bc216adb
7
+ data.tar.gz: '0699449615647ef228361d6d2e8e73cb7f20bad8cba35a7d62bbd712d38c901fa54c7efb6702daba9f1af17538b7e6b2e831d76f1f95da81b6f9d54edcbce21a'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2021-07-31
4
+
5
+ - Added enable-threading option to specify the threding method of BLIS.
6
+
7
+ ```
8
+ $ gem install numo-blis -- --enable-threading=openmp
9
+ ```
10
+
11
+ - Changed to detect threading method automatically when the enable-threading option is not given.
12
+
3
13
  ## [0.1.0] - 2021-07-17
4
14
 
5
15
  - Initial release
@@ -1,4 +1,3 @@
1
- # frozen-string-literal: true
2
1
 
3
2
  require 'etc'
4
3
  require 'fileutils'
@@ -8,6 +7,8 @@ require 'open3'
8
7
  require 'rbconfig'
9
8
  require 'rubygems/package'
10
9
 
10
+ ENABLE_THREADING_ARG = arg_config('--enable-threading')
11
+
11
12
  VENDOR_DIR = File.expand_path("#{__dir__}/../../../vendor")
12
13
  SOEXT = RbConfig::CONFIG['SOEXT'] || case RUBY_PLATFORM
13
14
  when /mswin|msys|mingw|cygwin/
@@ -26,13 +27,28 @@ BLIS_TGZ = "#{VENDOR_DIR}/tmp/blis-#{BLIS_VERSION}.tgz"
26
27
  LAPACK_TGZ = "#{VENDOR_DIR}/tmp/lapack-#{LAPACK_VERSION}.tgz"
27
28
  BLIS_KEY = 'ce5998fccfac88153f1e52d6497020529a3b5217'
28
29
  LAPACK_KEY = '4a9384523bf236c83568884e8c62d9517e41ac42'
30
+ RB_CC = "'#{RbConfig::expand('$(CC)')}'"
31
+ RB_CXX = "'#{RbConfig::expand('$(CPP)')}'"
32
+
33
+ BLIS_THREADING = if ['openmp', 'pthreads', 'no'].include?(ENABLE_THREADING_ARG)
34
+ ENABLE_THREADING_ARG
35
+ elsif try_compile('#include <omp.h>')
36
+ 'openmp'
37
+ elsif try_complie('#include <pthread.h>')
38
+ 'pthreads'
39
+ else
40
+ 'no'
41
+ end
29
42
  BLIS_CONFIGURE_OPTIONS = ['--enable-cblas',
30
- '--enable-threading=pthreads',
43
+ "--enable-threading=#{BLIS_THREADING}",
31
44
  "--prefix=#{VENDOR_DIR}",
45
+ "CC=#{RB_CC}",
46
+ "CXX=#{RB_CXX}",
32
47
  'auto'].join(' ')
33
48
  LAPACK_CMAKE_OPTIONS = ["-DBLAS_LIBRARIES='#{VENDOR_DIR}/lib/libblis.#{SOEXT}'",
34
49
  '-DLAPACKE=ON',
35
50
  '-DBUILD_SHARED_LIBS=ON',
51
+ '-DCMAKE_BUILD_TYPE=Release',
36
52
  "-DCMAKE_INSTALL_PREFIX='#{VENDOR_DIR}'"].join(' ')
37
53
 
38
54
  unless File.exist?("#{VENDOR_DIR}/installed_blis-#{BLIS_VERSION}")
@@ -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.1.0'
8
+ VERSION = '0.2.0'
9
9
  end
10
10
  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.1.0
4
+ version: 0.2.0
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-17 00:00:00.000000000 Z
11
+ date: 2021-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-linalg
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.1.6
75
+ rubygems_version: 3.2.22
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Numo::BLIS downloads and builds BLIS during installation and uses that as