Struct intel_mkl_tool::Library
source · [−]pub struct Library {
pub config: Config,
pub include_dir: PathBuf,
pub library_dir: PathBuf,
pub iomp5_static_dir: Option<PathBuf>,
pub iomp5_dynamic_dir: Option<PathBuf>,
}
Expand description
Found MKL library
use std::str::FromStr;
use intel_mkl_tool::{Config, Library};
let cfg = Config::from_str("mkl-static-lp64-iomp").unwrap();
if let Ok(lib) = Library::new(cfg) {
lib.print_cargo_metadata().unwrap();
}
Fields
config: Config
include_dir: PathBuf
Directory where mkl.h
and mkl_version.h
exists
library_dir: PathBuf
Directory where libmkl_core.a
or libmkl_core.so
exists
iomp5_static_dir: Option<PathBuf>
Directory where libiomp5.a
or corresponding file exists
- They are not required for
mkl-*-*-seq
andmkl-dynamic-*-iomp
cases, and then this isNone
. - Both static and dynamic dir can be
Some
whenopenmp-strict-link-type
feature is OFF.
iomp5_dynamic_dir: Option<PathBuf>
Directory where libiomp5.so
or corresponding file exists
- They are not required for
mkl-*-*-seq
cases andmkl-static-*-iomp
, and then this isNone
. - Both static and dynamic dir can be
Some
whenopenmp-strict-link-type
feature is OFF.
Implementations
sourceimpl Library
impl Library
sourcepub fn pkg_config(config: Config) -> Result<Option<Self>>
pub fn pkg_config(config: Config) -> Result<Option<Self>>
Find MKL using pkg-config
This only use the installed prefix obtained by pkg-config --variable=prefix
$ pkg-config --variable=prefix mkl-static-lp64-seq
/opt/intel/mkl
Then pass it to Self::seek_directory.
Limitation
This will not work for mkl-*-*-iomp
configure since libiomp5.{a,so}
will not be found under the prefix directory of MKL.
Please use $MKLROOT
environment variable for this case,
see Self::new for detail.
sourcepub fn seek_directory(
config: Config,
root_dir: impl AsRef<Path>
) -> Result<Option<Self>>
pub fn seek_directory(
config: Config,
root_dir: impl AsRef<Path>
) -> Result<Option<Self>>
Seek MKL libraries in the given directory.
- This will seek the directory recursively until finding MKL libraries, but do not follow symbolic links.
- This will not seek directory named
ia32*
- Retuns
Ok(None)
iflibiomp5.{a,so}
is not found withmkl-*-*-iomp
configure even if MKL binaries are found.
sourcepub fn new(config: Config) -> Result<Self>
pub fn new(config: Config) -> Result<Self>
Seek MKL in system
This try to find installed MKL in following order:
- Ask to
pkg-config
- Seek the directory specified by
$MKLROOT
environment variable - Seek well-known directory
/opt/intel
for LinuxC:/Program Files (x86)/IntelSWTools/
andC:/Program Files (x86)/Intel/oneAPI/
for Windows
pub fn available() -> Vec<Self>
sourcepub fn version(&self) -> Result<(u32, u32, u32)>
pub fn version(&self) -> Result<(u32, u32, u32)>
Found MKL version parsed from mkl_version.h
mkl_version.h
will define
#define __INTEL_MKL__ 2020
#define __INTEL_MKL_MINOR__ 0
#define __INTEL_MKL_UPDATE__ 1
and this corresponds to (2020, 0, 1)
sourcepub fn print_cargo_metadata(&self) -> Result<()>
pub fn print_cargo_metadata(&self) -> Result<()>
Print cargo:rustc-link-*
metadata to stdout
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnwindSafe for Library
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more