diff --git a/openblas-build/src/build.rs b/openblas-build/src/build.rs index 2fe8da6..7ee408a 100644 --- a/openblas-build/src/build.rs +++ b/openblas-build/src/build.rs @@ -177,10 +177,12 @@ impl Configure { args.push("NO_LAPACKE=1".into()) } if self.use_thread { - args.push("USE_THREAD=1".into()) + args.push("USE_THREAD=1".into()); + args.push("NUM_THREADS=128".into()); } if self.use_openmp { - args.push("USE_OPENMP=1".into()) + args.push("USE_OPENMP=1".into()); + args.push("NUM_THREADS=128".into()); } if matches!(self.interface, Interface::ILP64) { args.push("INTERFACE64=1".into()) diff --git a/openblas-src/Cargo.toml b/openblas-src/Cargo.toml index 16fd3be..98e9388 100644 --- a/openblas-src/Cargo.toml +++ b/openblas-src/Cargo.toml @@ -43,6 +43,9 @@ cblas = [] lapacke = [] static = [] system = [] +use_thread = [] +use_openmp = [] +dynamic_arch = [] [dev-dependencies] libc = "0.2" diff --git a/openblas-src/build.rs b/openblas-src/build.rs index 5865271..5aa95a5 100644 --- a/openblas-src/build.rs +++ b/openblas-src/build.rs @@ -106,6 +106,15 @@ fn build() { } else { cfg.no_static = true; } + if feature_enabled("use_thread") { + cfg.use_thread = true; + } + if feature_enabled("use_openmp") { + cfg.use_openmp = true; + } + if feature_enabled("dynamic_arch") { + cfg.no_shared = true; + } let output = if feature_enabled("cache") { use std::{collections::hash_map::DefaultHasher, hash::*};