Skip to content

Commit 07fbbb4

Browse files
committed
Add doc for Library, make members public
1 parent 45d83aa commit 07fbbb4

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

intel-mkl-tool/src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() -> Result<()> {
2020
}
2121
for lib in available {
2222
let (year, minor, update) = lib.version()?;
23-
println!("{:<22}: {}.{}.{}", lib.config(), year, minor, update);
23+
println!("{:<22}: {}.{}.{}", lib.config, year, minor, update);
2424
}
2525
}
2626
}

intel-mkl-tool/src/entry.rs

+15-8
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,29 @@ use std::{
77
process::Command,
88
};
99

10+
/// Found MKL library
11+
///
12+
/// ```no_run
13+
/// use std::str::FromStr;
14+
/// use intel_mkl_tool::{Config, Library};
15+
///
16+
/// let cfg = Config::from_str("mkl-static-lp64-iomp").unwrap();
17+
/// if let Ok(lib) = Library::new(cfg) {
18+
/// lib.print_cargo_metadata().unwrap();
19+
/// }
20+
/// ```
1021
#[derive(Debug, Clone)]
1122
pub struct Library {
12-
config: Config,
23+
pub config: Config,
1324
/// Directory where `mkl.h` and `mkl_version.h` exists
14-
include_dir: PathBuf,
25+
pub include_dir: PathBuf,
1526
/// Directory where `libmkl_core.a` or `libmkl_core.so` exists
16-
library_dir: PathBuf,
27+
pub library_dir: PathBuf,
1728
/// Directory where `libiomp5.a` or `libiomp5.so` exists
1829
///
1930
/// They are not required for `mkl-*-*-seq` cases,
2031
/// and then this is `None`.
21-
iomp5_dir: Option<PathBuf>,
32+
pub iomp5_dir: Option<PathBuf>,
2233
}
2334

2435
impl Library {
@@ -202,10 +213,6 @@ impl Library {
202213
.collect()
203214
}
204215

205-
pub fn config(&self) -> &Config {
206-
&self.config
207-
}
208-
209216
/// Found MKL version parsed from `mkl_version.h`
210217
///
211218
/// `mkl_version.h` will define

0 commit comments

Comments
 (0)