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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -3
- data/lib/gslr.rb +3 -1
- data/lib/gslr/ffi.rb +14 -1
- data/lib/gslr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ff1543c6434c221e210a9269d673c2b84632839f80e0ec0db047d30cc9a4b60
|
4
|
+
data.tar.gz: 10967bdbb5ab82e61b90f3f528d6d947b854f3993fbb4ee5bc0c11d25e71b63c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b48d6c388ff6e93a1e0c2aa4c7f9406ab96a3e77ee4852dc24bd736e71cc864fa8f6eee1d9da8a8778a2653d624da860ef69fe32334915ff5cfef8d4759a1920
|
7
|
+
data.tar.gz: 04b1cdb82277e30e4abfc10004605479bf6a0064cd29122c279221ff3d62483486bdac4c29b30e488fbf315ab0d5c59b612625db80ffc9dd5cf7aa89c99b419f
|
data/CHANGELOG.md
CHANGED
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
|
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
|
-
|
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
|
-
-
|
116
|
+
- libgsl-dev
|
115
117
|
```
|
116
118
|
|
117
119
|
## History
|
data/lib/gslr.rb
CHANGED
@@ -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
|
|
data/lib/gslr/ffi.rb
CHANGED
@@ -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"]
|
data/lib/gslr/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|