| Crates.io | roup |
| lib.rs | roup |
| version | 0.7.0 |
| created_at | 2025-10-23 04:12:19.738548+00 |
| updated_at | 2025-11-25 08:04:11.162798+00 |
| description | Rust-first parser for OpenMP and OpenACC directives with C/C++ bindings |
| homepage | https://roup.ouankou.com |
| repository | https://github.com/ouankou/roup |
| max_upload_size | |
| id | 1896600 |
| size | 4,410,890 |
Rust-first parsing for OpenMP and OpenACC directives with C, C++, and Fortran bindings, plus compatibility shims.
Experimental: APIs continue to evolve. Expect breaking changes between releases.
# Cargo.toml
[dependencies]
roup = "0.7"
# C/C++/Fortran projects
cargo build --release
# Link against target/release/libroup.{a,so,dylib}
Platform-specific notes live in the building guide.
roup_debug provides interactive and non-interactive step tracing for OpenMP/OpenACC (C and Fortran sentinels).compat/).The mdBook at roup.ouankou.com provides tutorials, an architecture tour, and the API reference. Each chapter mirrors the sources under docs/book/src/.
use roup::parser::openmp;
use roup::lexer::Language;
fn main() {
let parser = openmp::parser().with_language(Language::C);
let (_, directive) = parser
.parse("#pragma omp parallel for num_threads(4)")
.expect("valid directive");
println!(
"parsed {:?} with {} clauses",
directive.name,
directive.clauses.len()
);
}
More C/C++/Fortran samples live in examples/. The C/OpenACC headers are generated at build time as src/roup_constants.h.
cargo build --release
cargo test
Rebuild the docs with cargo doc --no-deps followed by mdbook build docs/book.
roup_debug is built alongside the library: cargo run --release --bin roup_debug '#pragma omp parallel' -- --non-interactive.
compat/ompparser/ — drop-in replacement for the original ompparser.compat/accparser/ — drop-in replacement for accparser with ROUP_ACC_* constants.Each directory includes a build.sh that builds ROUP, the shim, and runs the bundled ctest suites.
See the contributing guide for coding standards, test expectations, and the pull-request workflow.
BSD-3-Clause License — see LICENSE.
© 2024–2025 Anjia Wang