diff --git a/openblas-build/src/build.rs b/openblas-build/src/build.rs index 10d15ca..f74289f 100644 --- a/openblas-build/src/build.rs +++ b/openblas-build/src/build.rs @@ -394,9 +394,11 @@ impl Configure { } if self.use_thread { args.push("USE_THREAD=1".into()); + args.push("NUM_THREADS=256".into()); } if self.use_openmp { args.push("USE_OPENMP=1".into()); + args.push("NUM_THREADS=256".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 e0911dd..f32cff9 100644 --- a/openblas-src/Cargo.toml +++ b/openblas-src/Cargo.toml @@ -31,6 +31,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 f555c03..43ae8f0 100644 --- a/openblas-src/build.rs +++ b/openblas-src/build.rs @@ -155,6 +155,15 @@ fn build() { cfg.compilers.hostcc = env::var("OPENBLAS_HOSTCC").ok(); cfg.compilers.fc = env::var("OPENBLAS_FC").ok(); cfg.compilers.ranlib = env::var("OPENBLAS_RANLIB").ok(); + 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::hash::*;