|
1 | 1 | # metis-rs |
2 | 2 |
|
3 | | -Idiomatic bindings to [libmetis][METIS], a graph and mesh partitioner. |
| 3 | +**metis-rs** is a Rust library providing idiomatic bindings to [libmetis][METIS], a library for graph and mesh |
| 4 | +partitioning. It is made to be used with Rust version 1.67.0 or above. |
4 | 5 |
|
5 | | -## Building |
| 6 | +## Features |
6 | 7 |
|
7 | | -Prerequisites: |
| 8 | +### Use of Vendored Feature |
8 | 9 |
|
9 | | -- METIS |
10 | | -- clang v5.0 or above |
11 | | -- Rust v1.60.0 or above |
| 10 | +The `vendored` feature enables metis-rs to build METIS from source and link to it statically. If not enabled, metis-rs |
| 11 | +looks for an existing installation and links to it dynamically. |
12 | 12 |
|
13 | | -Bindings to METIS are made on the fly. If METIS is installed in a non-standard |
14 | | -location, please use the following commands: |
| 13 | +### Use of System-wide Feature |
15 | 14 |
|
16 | | - export METISDIR=path/to/your/metis/installation |
17 | | - export CPATH="$METISDIR/include" |
18 | | - export RUSTFLAGS="-L$METISDIR/lib" |
| 15 | +The `use-system` feature enables metis-rs to use the system-wide installation of METIS. If not enabled, metis-rs will |
| 16 | +refer to its own version of METIS. |
19 | 17 |
|
20 | | -The environment variable `$METISDIR` must point to a directory containing a |
21 | | -`lib/` and a `include/` directory containing the shared libraries and the |
22 | | -headers of METIS, respectively. |
| 18 | +Please note, `vendored` and `use-system` features are mutually exclusive. |
23 | 19 |
|
24 | | -Once these variables are set, you can build the bindings with `cargo build`. |
| 20 | +## Guidance for non-standard METIS installations |
25 | 21 |
|
26 | | -### Build the documentation |
| 22 | +If you enabled the `use-system` feature and METIS is installed in a non-standard location, you must set the following |
| 23 | +environment variables: |
| 24 | +```bash |
| 25 | +export METISDIR=path/to/your/metis/installation |
| 26 | +export CPATH="$METISDIR/include" |
| 27 | +export RUSTFLAGS="-L$METISDIR/lib" |
| 28 | +``` |
27 | 29 |
|
28 | | -If your METIS installation lies in a non-standard path, you will need to set |
29 | | -the `RUSTDOCFLAGS` environment variable to build the documentation: |
| 30 | +`$METISDIR` must point to a directory containing both `lib/` and `include/` directories with METIS's shared libraries and headers, respectively. |
30 | 31 |
|
31 | | - export RUSTDOCFLAGS="-L$METISDIR/lib" |
| 32 | +## Building the documentation |
32 | 33 |
|
33 | | -Then you can call `cargo doc --no-deps --open`. |
| 34 | +To build the documentation, especially if METIS is installed in a non-standard location, set the `RUSTDOCFLAGS` environment variable: |
| 35 | + |
| 36 | +```bash |
| 37 | +export RUSTDOCFLAGS="-L$METISDIR/lib" |
| 38 | +``` |
| 39 | +Then the following command will generate and open the documentation: |
| 40 | +```bash |
| 41 | +cargo doc --no-deps --open |
| 42 | +``` |
34 | 43 |
|
35 | 44 | ## License |
36 | 45 |
|
37 | | -This program is distributed under the terms of both the MIT license and the |
38 | | -Apache License (Version 2.0). See `LICENSE-APACHE` and `LICENSE-MIT` for |
39 | | -details. |
| 46 | +metis-rs is distributed under the terms of both the MIT license and the Apache License (Version 2.0). Refer to `LICENSE-APACHE` and `LICENSE-MIT` for more details. |
40 | 47 |
|
41 | | -[METIS]: http://glaros.dtc.umn.edu/gkhome/metis/metis/overview |
| 48 | +[METIS]: http://glaros.dtc.umn.edu/gkhome/metis/metis/overview |
0 commit comments