roup

Crates.ioroup
lib.rsroup
version0.7.0
created_at2025-10-23 04:12:19.738548+00
updated_at2025-11-25 08:04:11.162798+00
descriptionRust-first parser for OpenMP and OpenACC directives with C/C++ bindings
homepagehttps://roup.ouankou.com
repositoryhttps://github.com/ouankou/roup
max_upload_size
id1896600
size4,410,890
Anjia Wang (ouankou)

documentation

https://roup.ouankou.com

README

ROUP: Rust-based OpenMP & OpenACC Parser

Rust-first parsing for OpenMP and OpenACC directives with C, C++, and Fortran bindings, plus compatibility shims.

Docs Status

Experimental: APIs continue to evolve. Expect breaking changes between releases.

Quick start

# 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.

Highlights

  • OpenMP 3.0–6.0 and OpenACC 3.4 coverage across directives, clauses, aliases, and combined forms.
  • Debugger: roup_debug provides interactive and non-interactive step tracing for OpenMP/OpenACC (C and Fortran sentinels).
  • Rust, C, C++17, and Fortran APIs with a narrow unsafe boundary confined to the FFI bindings.
  • Compatibility layers: drop-in replacements for ompparser and accparser (see compat/).
  • Extensive tests: hundreds of automated checks plus OpenMP_VV/OpenACCV-V validation and compat ctests.

Documentation

The mdBook at roup.ouankou.com provides tutorials, an architecture tour, and the API reference. Each chapter mirrors the sources under docs/book/src/.

Minimal example (Rust)

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.

Build and test

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.

Compatibility layers

Each directory includes a build.sh that builds ROUP, the shim, and runs the bundled ctest suites.

Contributing

See the contributing guide for coding standards, test expectations, and the pull-request workflow.

License

BSD-3-Clause License — see LICENSE.

© 2024–2025 Anjia Wang

Commit count: 0

cargo fmt