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

Disable stdout printing from within glucose and minisat #68

Merged
merged 1 commit into from
Mar 26, 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
2 changes: 2 additions & 0 deletions glucose/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ build = "build.rs"

[features]
debug = []
quiet = []
default = ["quiet"]

[dependencies]
cpu-time = "1.0.0"
Expand Down
1 change: 1 addition & 0 deletions glucose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The Glucose SAT solver to be used with the [RustSAT](https://github.com/chrjabs/
## Features

- `debug`: if this feature is enables, the C++ library will be built with debug and check functionality if the Rust project is built in debug mode
- `quiet`: disable all glucose-internal printing to stdout during solving (on by default)

## Glucose Version

Expand Down
9 changes: 5 additions & 4 deletions glucose/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() {
build(
"https://github.com/chrjabs/glucose4.git",
"main",
"7446ea43cd7b0beb8778de00fc373849983ad067",
"2c41a6d2e9c8db7b5bdebc8dc65760d01bc938e9",
);

let out_dir = env::var("OUT_DIR").unwrap();
Expand All @@ -35,9 +35,10 @@ fn build(repo: &str, branch: &str, commit: &str) {
let mut conf = cmake::Config::new(glucose_dir);
conf.define("BUILD_SYRUP", "OFF")
.define("BUILD_EXECUTABLES", "OFF");
if cfg!(not(feature = "debug")) {
conf.profile("Release");
}
#[cfg(feature = "quiet")]
conf.define("QUIET", "ON");
#[cfg(not(feature = "debug"))]
conf.profile("Release");
conf.build();
};

Expand Down
1 change: 1 addition & 0 deletions glucose/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! ## Features
//!
//! - `debug`: if this feature is enables, the C++ library will be built with debug and check functionality if the Rust project is built in debug mode
//! - `quiet`: disable all glucose-internal printing to stdout during solving (on by default)
//!
//! ## Glucose Version
//!
Expand Down
2 changes: 2 additions & 0 deletions minisat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ build = "build.rs"

[features]
debug = []
quiet = []
default = ["quiet"]

[dependencies]
cpu-time = "1.0.0"
Expand Down
1 change: 1 addition & 0 deletions minisat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The Minisat SAT solver to be used with the [RustSAT](https://github.com/chrjabs/
## Features

- `debug`: if this feature is enables, the C++ library will be built with debug and check functionality if the Rust project is built in debug mode
- `quiet`: disable all glucose-internal printing to stdout during solving (on by default)

## Minisat Version

Expand Down
9 changes: 5 additions & 4 deletions minisat/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() {
build(
"https://github.com/chrjabs/minisat.git",
"master",
"809d350ff282e695014e96a2afd3625196f58dff",
"8237c54e97272d16531e785dd8031c27c2360904",
);

let out_dir = env::var("OUT_DIR").unwrap();
Expand All @@ -34,9 +34,10 @@ fn build(repo: &str, branch: &str, commit: &str) {
{
let mut conf = cmake::Config::new(minisat_dir);
conf.define("BUILD_BINARIES", "OFF");
if cfg!(not(feature = "debug")) {
conf.profile("Release");
}
#[cfg(feature = "quiet")]
conf.define("QUIET", "ON");
#[cfg(not(feature = "debug"))]
conf.profile("Release");
conf.build();
};

Expand Down
1 change: 1 addition & 0 deletions minisat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! ## Features
//!
//! - `debug`: if this feature is enables, the C++ library will be built with debug and check functionality if the Rust project is built in debug mode
//! - `quiet`: disable all glucose-internal printing to stdout during solving (on by default)
//!
//! ## Minisat Version
//!
Expand Down
Loading