build_probe_mpi/
lib.rs

1#![deny(missing_docs)]
2#![warn(missing_copy_implementations)]
3#![warn(trivial_casts)]
4#![warn(trivial_numeric_casts)]
5#![warn(unused_extern_crates)]
6#![warn(unused_import_braces)]
7#![warn(unused_qualifications)]
8#![allow(unknown_lints)]
9
10//! Probe an environment for an installed MPI library
11//!
12//! Probing is done in several steps on Unix:
13//!
14//! 1. Try to find an MPI compiler wrapper either from the environment variable `MPICC` or under
15//!    the name `mpicc` then run the compiler wrapper with the command line argument `-show` and
16//!    interpret the resulting output as `gcc` compatible command line arguments.
17//! 2. Query the `pkg-config` database for an installation of `mpich`.
18//! 3. Query the `pkg-config` database for an installation of `openmpi`.
19//!
20//! On Windows, only MS-MPI is looked for. The MSMPI_INC and MSMPI_LIB32/64 environment variables
21//! are expected.
22//!
23//! The result of the first successful step is returned. If no step is successful, a list of errors
24//! encountered while executing the steps is returned.
25
26mod os;
27
28pub use os::probe;
29
30use std::path::PathBuf;
31
32/// Result of a successfull probe
33#[allow(clippy::manual_non_exhaustive)]
34#[derive(Clone, Debug)]
35pub struct Library {
36    /// Path to compiler capable of building MPI programs
37    pub mpicc: Option<String>,
38    /// Names of the native MPI libraries that need to be linked
39    pub libs: Vec<String>,
40    /// Search path for native MPI libraries
41    pub lib_paths: Vec<PathBuf>,
42    /// Search path for C header files
43    pub include_paths: Vec<PathBuf>,
44    /// The version of the MPI library
45    pub version: String,
46    _priv: (),
47}