diff --git a/Cargo.toml b/Cargo.toml index 374838b7e..f48a371e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,6 @@ description = "An n-dimensional array for general elements and for numerics. Lig keywords = ["array", "data-structure", "multidimensional", "matrix", "blas"] categories = ["data-structures", "science"] -build = "build.rs" - exclude = ["docgen/images/*"] [lib] @@ -63,8 +61,7 @@ blas = ["cblas-sys", "libc"] serde-1 = ["serde"] # These features are used for testing -test-blas-openblas-sys = ["blas"] -test = ["test-blas-openblas-sys"] +test = [] # This feature is used for docs docs = ["approx", "serde", "rayon"] diff --git a/build.rs b/build.rs deleted file mode 100644 index dd06c0b81..000000000 --- a/build.rs +++ /dev/null @@ -1,10 +0,0 @@ -/// -/// This build script emits the openblas linking directive if requested -/// - -fn main() { - println!("cargo:rerun-if-changed=build.rs"); - if cfg!(feature = "test-blas-openblas-sys") { - println!("cargo:rustc-link-lib=dylib=openblas"); - } -} diff --git a/scripts/all-tests.sh b/scripts/all-tests.sh index a9cd3e758..15fb3fe48 100755 --- a/scripts/all-tests.sh +++ b/scripts/all-tests.sh @@ -18,4 +18,5 @@ cargo test --manifest-path=xtest-serialization/Cargo.toml --verbose cargo test --manifest-path=xtest-blas/Cargo.toml --verbose cargo test --examples CARGO_TARGET_DIR=target/ cargo test --manifest-path=xtest-numeric/Cargo.toml --verbose +CARGO_TARGET_DIR=target/ cargo test --manifest-path=xtest-numeric/Cargo.toml --verbose --features test_blas ([ "$CHANNEL" != "nightly" ] || cargo bench --no-run --verbose --features "$FEATURES") diff --git a/xtest-numeric/Cargo.toml b/xtest-numeric/Cargo.toml index fd017bd39..8636fec41 100644 --- a/xtest-numeric/Cargo.toml +++ b/xtest-numeric/Cargo.toml @@ -10,6 +10,9 @@ ndarray = { path = "..", features = ["approx"] } ndarray-rand = { path = "../ndarray-rand/" } rand_distr = "0.4" +blas-src = { optional = true, version = "0.7.0", default-features = false, features = ["openblas"] } +openblas-src = { optional = true, version = "0.9", default-features = false, features = ["cblas", "system"] } + [dependencies.rand] version = "0.8.0" features = ["small_rng"] @@ -18,7 +21,7 @@ features = ["small_rng"] test = false [features] -test_blas = ["ndarray/blas", "ndarray/test-blas-openblas-sys"] +test_blas = ["ndarray/blas", "blas-src", "openblas-src"] [profile.dev] opt-level = 2 diff --git a/xtest-numeric/src/lib.rs b/xtest-numeric/src/lib.rs index e69de29bb..ba1c3b0d9 100644 --- a/xtest-numeric/src/lib.rs +++ b/xtest-numeric/src/lib.rs @@ -0,0 +1,3 @@ +#[cfg(feature = "test_blas")] +extern crate blas_src; + diff --git a/xtest-numeric/tests/accuracy.rs b/xtest-numeric/tests/accuracy.rs index 044ba17cc..4c454bac1 100644 --- a/xtest-numeric/tests/accuracy.rs +++ b/xtest-numeric/tests/accuracy.rs @@ -4,6 +4,8 @@ extern crate ndarray; extern crate ndarray_rand; extern crate rand; +extern crate numeric_tests; + use ndarray_rand::{RandomExt, F32}; use rand::{Rng, SeedableRng}; use rand::rngs::SmallRng;