-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into fix-unsound
# Conflicts: # src/lib.rs # src/option.rs
- Loading branch information
Showing
14 changed files
with
710 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "vendor/GKlib"] | ||
path = vendor/GKlib | ||
url = https://github.com/KarypisLab/GKlib | ||
[submodule "vendor/metis"] | ||
path = vendor/metis | ||
url = https://github.com/KarypisLab/METIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ members = [".", "metis-sys"] | |
|
||
[package] | ||
name = "metis" | ||
version = "0.1.2" | ||
authors = ["Hubert Hirtz <[email protected]>"] | ||
version = "0.2.0" | ||
authors = ["Hubert Hirtz <[email protected]>", "Cedric Chevalier <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
repository = "https://github.com/LIHPC-Computational-Geometry/metis-rs" | ||
|
@@ -14,5 +14,14 @@ keywords = ["graph", "mesh", "matrix", "partitioning", "ordering"] | |
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
default = ["metis-sys/default"] | ||
|
||
# Build and statically link to METIS and GKLib. | ||
vendored = ["metis-sys/vendored"] | ||
|
||
# Use existing METIS install and links dynamically to it. | ||
use-system = ["metis-sys/use-system"] | ||
|
||
[dependencies] | ||
metis-sys = { version = "0.2", path = "metis-sys" } | ||
metis-sys = { version = "0.3", path = "metis-sys", default-features = false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,48 @@ | ||
# metis-rs | ||
|
||
Idiomatic bindings to [libmetis][METIS], a graph and mesh partitioner. | ||
**metis-rs** is a Rust library providing idiomatic bindings to [libmetis][METIS], a library for graph and mesh | ||
partitioning. It is made to be used with Rust version 1.67.0 or above. | ||
|
||
## Building | ||
## Features | ||
|
||
Prerequisites: | ||
### Use of Vendored Feature | ||
|
||
- METIS | ||
- clang v5.0 or above | ||
- Rust v1.60.0 or above | ||
The `vendored` feature enables metis-rs to build METIS from source and link to it statically. If not enabled, metis-rs | ||
looks for an existing installation and links to it dynamically. | ||
|
||
Bindings to METIS are made on the fly. If METIS is installed in a non-standard | ||
location, please use the following commands: | ||
### Use of System-wide Feature | ||
|
||
export METISDIR=path/to/your/metis/installation | ||
export CPATH="$METISDIR/include" | ||
export RUSTFLAGS="-L$METISDIR/lib" | ||
The `use-system` feature enables metis-rs to use the system-wide installation of METIS. If not enabled, metis-rs will | ||
refer to its own version of METIS. | ||
|
||
The environment variable `$METISDIR` must point to a directory containing a | ||
`lib/` and a `include/` directory containing the shared libraries and the | ||
headers of METIS, respectively. | ||
Please note, `vendored` and `use-system` features are mutually exclusive. | ||
|
||
Once these variables are set, you can build the bindings with `cargo build`. | ||
## Guidance for non-standard METIS installations | ||
|
||
### Build the documentation | ||
If you enabled the `use-system` feature and METIS is installed in a non-standard location, you must set the following | ||
environment variables: | ||
```bash | ||
export METISDIR=path/to/your/metis/installation | ||
export CPATH="$METISDIR/include" | ||
export RUSTFLAGS="-L$METISDIR/lib" | ||
``` | ||
|
||
If your METIS installation lies in a non-standard path, you will need to set | ||
the `RUSTDOCFLAGS` environment variable to build the documentation: | ||
`$METISDIR` must point to a directory containing both `lib/` and `include/` directories with METIS's shared libraries and headers, respectively. | ||
|
||
export RUSTDOCFLAGS="-L$METISDIR/lib" | ||
## Building the documentation | ||
|
||
Then you can call `cargo doc --no-deps --open`. | ||
To build the documentation, especially if METIS is installed in a non-standard location, set the `RUSTDOCFLAGS` environment variable: | ||
|
||
```bash | ||
export RUSTDOCFLAGS="-L$METISDIR/lib" | ||
``` | ||
Then the following command will generate and open the documentation: | ||
```bash | ||
cargo doc --no-deps --open | ||
``` | ||
|
||
## License | ||
|
||
This program is distributed under the terms of both the MIT license and the | ||
Apache License (Version 2.0). See `LICENSE-APACHE` and `LICENSE-MIT` for | ||
details. | ||
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. | ||
|
||
[METIS]: http://glaros.dtc.umn.edu/gkhome/metis/metis/overview | ||
[METIS]: http://glaros.dtc.umn.edu/gkhome/metis/metis/overview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "metis-sys" | ||
version = "0.2.1" | ||
authors = ["Hubert Hirtz <[email protected]>"] | ||
version = "0.3.0" | ||
authors = ["Hubert Hirtz <[email protected]>", "Cedric Chevalier <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
repository = "https://github.com/LIHPC-Computational-Geometry/metis-rs" | ||
|
@@ -11,5 +11,19 @@ categories = ["external-ffi-bindings", "mathematics"] | |
keywords = ["graph", "mesh", "matrix", "partitioning", "ordering"] | ||
|
||
|
||
[features] | ||
default = ["vendored"] | ||
|
||
# Build and statically link to METIS and GKLib. | ||
vendored = ["dep:cc"] | ||
|
||
# Use existing METIS install and links dynamically to it. | ||
use-system = ["bindgen"] | ||
|
||
# Regenerate bindings in metis-sys/gen/bindings.rs from METIS in the "vendor" | ||
# directory. Also enables "vendored". | ||
generate-bindings = ["vendored", "bindgen"] | ||
|
||
[build-dependencies] | ||
bindgen = { version = "0.66", default-features = false, features = ["runtime"] } | ||
bindgen = { version = "0.69", default-features = false, features = ["runtime"], optional = true } | ||
cc = { version = "1", features = ["parallel"], optional = true } |
Oops, something went wrong.