Skip to content

Commit 1f65811

Browse files
authored
Merge pull request #955 from rust-ndarray/blas-integration
Update docs about BLAS integration and update blas test
2 parents c7ae4eb + c542a6b commit 1f65811

File tree

4 files changed

+41
-316
lines changed

4 files changed

+41
-316
lines changed

README.rst

+23-15
Original file line numberDiff line numberDiff line change
@@ -101,39 +101,47 @@ How to use with cargo
101101
How to enable blas integration
102102
-----------------------------
103103

104-
Blas integration is an optional add-on.
104+
Blas integration is an optional add-on. Without BLAS, ndarray uses the
105+
``matrixmultiply`` crate for matrix multiplication for ``f64`` and ``f32``
106+
arrays (and it's always enabled as a fallback since it supports matrices of
107+
arbitrary strides in both dimensions).
105108

106109
Depend and link to ``blas-src`` directly to pick a blas provider. Ndarray
107110
presently requires a blas provider that provides the ``cblas-sys`` interface. If
108-
further feature selection is needed then you might need to depend directly on
109-
the backend crate's source too (for example ``openblas-src``, to select
110-
``cblas``). The backend version **must** be the one that ``blas-src`` also
111-
depends on.
111+
further feature selection is wanted or needed then you might need to depend directly on
112+
the backend crate's source too. The backend version **must** be the one that
113+
``blas-src`` also depends on.
112114

113115
An example configuration using system openblas is shown below. Note that only
114116
end-user projects (not libraries) should select provider::
115117

116118
[dependencies]
117119
ndarray = { version = "0.15.0", features = ["blas"] }
118-
blas-src = { version = "0.7.0", default-features = false, features = ["openblas"] }
119-
openblas-src = { version = "0.9", default-features = false, features = ["cblas", "system"] }
120+
blas-src = { version = "0.7.0", features = ["openblas"] }
121+
openblas-src = { version = "0.9", features = ["cblas", "system"] }
122+
123+
Using system-installed dependencies can save a long time building dependencies.
124+
An example configuration using (compiled) netlib is shown below anyway::
125+
126+
[dependencies]
127+
ndarray = { version = "0.15.0", features = ["blas"] }
128+
blas-src = { version = "0.7.0", default-features = false, features = ["netlib"] }
120129

121130
When this is done, your program must also link to ``blas_src`` by using it or
122131
explicitly including it in your code::
123132

124133
extern crate blas_src;
125134

126-
For official releases of ``ndarray``, versions that have been verified to work are:
135+
The following versions have been verified to work together. For ndarray 0.15 or later,
136+
there is no tight coupling to the ``blas-src`` version, so any version should in theory work.
127137

128-
=========== ============ ================
129-
``ndarray`` ``blas-src`` ``openblas-src``
130-
=========== ============ ================
131-
0.15 0.7.0 0.9.0
138+
=========== ============ ================ ==============
139+
``ndarray`` ``blas-src`` ``openblas-src`` ``netlib-src``
140+
=========== ============ ================ ==============
141+
0.15 0.7.0 0.9.0 0.8.0
132142
0.14 0.6.1 0.9.0
133143
0.13 0.2.0 0.6.0
134-
0.12 0.2.0 0.6.0
135-
0.11 0.1.2 0.5.0
136-
=========== ============ ================
144+
=========== ============ ================ ==============
137145

138146
Recent Changes
139147
--------------

src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
#![allow(
1111
clippy::many_single_char_names,
1212
clippy::deref_addrof,
13-
clippy::unreadable_literal
13+
clippy::unreadable_literal,
14+
clippy::manual_map, // is not an error
1415
)]
1516
#![cfg_attr(not(feature = "std"), no_std)]
1617

xtest-blas/Cargo.toml

+11-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ publish = false
88
test = false
99

1010
[dev-dependencies]
11-
approx = "0.4"
1211
ndarray = { path = "../", features = ["approx", "blas"] }
13-
blas-src = { version = "0.7.0", default-features = false, features = ["openblas"] }
14-
openblas-src = { version = "0.9.0", default-features = false, features = ["cblas", "system"] }
12+
13+
approx = "0.4"
1514
defmac = "0.2"
1615
num-traits = "0.2"
16+
17+
blas-src = { version = "0.7.0", features = ["openblas"] }
18+
openblas-src = { version = "0.9.0", features = ["system"] }
19+
20+
#blas-src = { version = "0.7.0", features = ["netlib"] }
21+
#netlib-src = { version = "0.8.0", default-features = false, features = ["cblas", "system"] }
22+
23+
#blas-src = { version = "0.7.0", features = ["blis"] }
24+
#blis-src = { version = "0.2.0", features = ["system"] }

0 commit comments

Comments
 (0)