gslr 0.1.0 → 0.1.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: b27b1a52391be2bf333be3e9616b6ee68db6e8b9c558ffe7b4bfbdf8ab13d189
4
- data.tar.gz: 3fca23b69b38f316847779fa13be32b0403f4231e686d33338c1b75fc6db59a8
3
+ metadata.gz: 8ff1543c6434c221e210a9269d673c2b84632839f80e0ec0db047d30cc9a4b60
4
+ data.tar.gz: 10967bdbb5ab82e61b90f3f528d6d947b854f3993fbb4ee5bc0c11d25e71b63c
5
5
  SHA512:
6
- metadata.gz: 6406144f12edf5b93a3a833734efbaff3c3ab2863b4effdb882283ccb28acd7fe3e0ce03dbd8d88632803e4b722beea056bd50d22f6882c1996e9837f7819d53
7
- data.tar.gz: 5b15f2bfbf37f4908071ef16e926aaa386d617a9ede6006103aa76a4ce3a65ae613d1c073a32c3f469442faa1e3e504d51bcf8937a9ea15ac40a728d6d31bdc6
6
+ metadata.gz: b48d6c388ff6e93a1e0c2aa4c7f9406ab96a3e77ee4852dc24bd736e71cc864fa8f6eee1d9da8a8778a2653d624da860ef69fe32334915ff5cfef8d4759a1920
7
+ data.tar.gz: 04b1cdb82277e30e4abfc10004605479bf6a0064cd29122c279221ff3d62483486bdac4c29b30e488fbf315ab0d5c59b612625db80ffc9dd5cf7aa89c99b419f
@@ -1,3 +1,7 @@
1
+ ## 0.1.1 (2019-12-07)
2
+
3
+ - Fixed `undefined symbol` error on Linux
4
+
1
5
  ## 0.1.0 (2019-12-07)
2
6
 
3
7
  - First release
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  :fire: High performance linear regression for Ruby, powered by [GSL](https://www.gnu.org/software/gsl/)
4
4
 
5
+ [![Build Status](https://travis-ci.org/ankane/gslr.svg?branch=master)](https://travis-ci.org/ankane/gslr)
6
+
5
7
  ## Installation
6
8
 
7
9
  [Install GSL](#gsl-installation). For Homebrew, use:
@@ -92,7 +94,7 @@ Check out [the options](https://www.gnu.org/software/gsl/extras/native_win_build
92
94
  ### Ubuntu
93
95
 
94
96
  ```sh
95
- sudo apt-get install libgsl0-dev
97
+ sudo apt-get install libgsl-dev
96
98
  ```
97
99
 
98
100
  ## Heroku
@@ -100,7 +102,7 @@ sudo apt-get install libgsl0-dev
100
102
  Use the [Apt buildpack](https://github.com/heroku/heroku-buildpack-apt) and create an `Aptfile` with:
101
103
 
102
104
  ```text
103
- libgsl0-dev
105
+ libgsl-dev
104
106
  ```
105
107
 
106
108
  ## Travis CI
@@ -111,7 +113,7 @@ Add to `.travis.yml`:
111
113
  addons:
112
114
  apt:
113
115
  packages:
114
- - libgsl0-dev
116
+ - libgsl-dev
115
117
  ```
116
118
 
117
119
  ## History
@@ -11,14 +11,16 @@ module GSLR
11
11
  class Error < StandardError; end
12
12
 
13
13
  class << self
14
- attr_accessor :ffi_lib
14
+ attr_accessor :cblas_lib, :ffi_lib
15
15
  end
16
+ self.cblas_lib = []
16
17
  self.ffi_lib =
17
18
  if Gem.win_platform?
18
19
  ["gsl.dll"]
19
20
  elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
20
21
  ["libgsl.dylib"]
21
22
  else
23
+ self.cblas_lib = ["libgslcblas.so"]
22
24
  ["libgsl.so"]
23
25
  end
24
26
 
@@ -2,9 +2,22 @@ module GSLR
2
2
  module FFI
3
3
  extend Fiddle::Importer
4
4
 
5
+ # must link a cblas lib on some platforms
6
+ # https://lists.gnu.org/archive/html/bug-gsl/2017-04/msg00008.html
7
+ if GSLR.cblas_lib.any?
8
+ libs = GSLR.cblas_lib.dup
9
+ begin
10
+ Fiddle.dlopen(libs.shift)
11
+ rescue Fiddle::DLError => e
12
+ retry if libs.any?
13
+ raise e if ENV["GSLR_DEBUG"]
14
+ raise LoadError, "Could not find GSL"
15
+ end
16
+ end
17
+
5
18
  libs = GSLR.ffi_lib.dup
6
19
  begin
7
- dlload libs.shift
20
+ dlload Fiddle.dlopen(libs.shift)
8
21
  rescue Fiddle::DLError => e
9
22
  retry if libs.any?
10
23
  raise e if ENV["GSLR_DEBUG"]
@@ -1,3 +1,3 @@
1
1
  module GSLR
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gslr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-07 00:00:00.000000000 Z
11
+ date: 2019-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler