Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force optimization for builtin Metis #31

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

[metis-sys-0.2.0...0.2.1](https://github.com/LIHPC-Computational-Geometry/metis-rs/compare/metis-0.2.0...metis-0.2.1)

### Added

- `force-optimize-vendor` feature for `metis-sys` to force builtin metis to be compiled as optimized, even for debug or
dev profiles [#31](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/31)

### Fixed

- move `vendor` library in `metis-sys` [#29](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/29)
Expand All @@ -14,14 +19,17 @@

### Added

- Builtin metis with the new `vendored` feature, enabled by default [#16](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/16)
- Builtin metis with the new `vendored` feature, enabled by
default [#16](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/16)
- Convert from sprs matrices [#10](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/10)
- Add unchecked constructors [#13](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/13)

### Changed

- Remove mutability requirement on input from public facing API [#18](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/18)
- Remove numbering feature, now only Rust (or C) 0-based arrays are supported [#13](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/13)
- Remove mutability requirement on input from public facing
API [#18](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/18)
- Remove numbering feature, now only Rust (or C) 0-based arrays are
supported [#13](https://github.com/LIHPC-Computational-Geometry/metis-rs/pull/13)

### Documentation

Expand Down
6 changes: 5 additions & 1 deletion metis-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords = ["graph", "mesh", "matrix", "partitioning", "ordering"]


[features]
default = ["vendored"]
default = ["vendored", "force-optimize-vendor"]

# Build and statically link to METIS and GKLib.
vendored = ["dep:cc"]
Expand All @@ -24,6 +24,10 @@ use-system = ["bindgen"]
# directory. Also enables "vendored".
generate-bindings = ["vendored", "bindgen"]

# Force Metis to be optimized and to not follow the current profile for Rust
# Therefore, debug or dev build lead to correct performance.
force-optimize-vendor = ["vendored"]

[build-dependencies]
bindgen = { version = "0.69", default-features = false, features = ["runtime"], optional = true }
cc = { version = "1", features = ["parallel"], optional = true }
7 changes: 5 additions & 2 deletions metis-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ fn build_lib() {
build.define("MACOS", None);
}

#[cfg(not(debug_assertions))]
build.flag("-DNDEBUG").flag("-DNDEBUG2");
#[cfg(any(not(debug_assertions), feature = "force-optimize-vendor"))]
build.define("NDEBUG", None).define("NDEBUG2", None);

#[cfg(feature = "force-optimize-vendor")]
build.no_default_flags(true).opt_level(3).debug(false);

// METIS triggers an infinite amount of warnings and showing them to users
// downstream does not really help.
Expand Down