Development
Prerequisites
-
Rust and Cargo, installed via Rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shRust updates occur every six weeks. To update Rust:
rustup update -
netCDF, a system library
automeshlinks against for Exodus II I/O 1 — see the netCDF Prerequisite in Installation for per-platform install commands.
Optional
- VS Code with the following extensions:
- GitHub CLI
Clone Repository
git clone git@github.com:autotwin/automesh.git
cd automesh
Building the Book Locally
The book embeds live command output via mdbook-cmdrun: most pages run
automesh (some piped through ansifilter to strip ANSI color codes for
plain-text embedding), and a few run cat or python. If automesh isn't
resolvable on PATH, mdbook-cmdrun fails silently — the affected output
blocks simply render empty, with no error — so before running mdbook build
or mdbook serve, make sure both are available:
cd automesh # the repository root, containing Cargo.toml
cargo install --path . # installs `automesh` to ~/.cargo/bin; re-run after
# source changes you want reflected in the book
brew install ansifilter # macOS, one-time (apt-get install ansifilter on Linux)
cargo install --path . must be run from the repository root (or pass that
path explicitly, e.g. cargo install --path ~/autotwin/automesh from
anywhere) — --path points at the directory containing the crate's
Cargo.toml, not at the book or any other subdirectory.
Both install locations are typically already on PATH via Rustup/Homebrew,
so no PATH changes should be needed.
Development Cycle Overview
- Branch
- Develop
cargo build- Develop:
- tests
- implementation
- Document:
mdbook build(see Building the Book Locally for prerequisites)- output:
automesh/book/build
- output:
mdbook serve --open- interactive mode
- On the local machine, with Firefox, open the
index.htmlfile, e.g.,file:///Users/chovey/autotwin/automesh/book/build/index.html
cargo rustdoc --open -- --html-in-header docs/katex.html
- Test:
cargo testcargo run// test without required input and output flagscargo run --release -- -i tests/input/f.npy -o foo.exocargo run -- --help
- Lint:
cargo clippy
- Pre-commit:
pre-commit run --all-files
- Clean:
cargo clean
- Merge Request
References
-
automesh's build script looks for the netCDF library in a fixed, OS-specific location (e.g./opt/homebrew/libor/usr/local/libon macOS,/usr/lib/x86_64-linux-gnuon Linux, orC:/vcpkg/installed/x64-windows/libon Windows) rather than usingpkg-configor an environment variable, so netCDF must be installed to one of those default locations for the build to find it. ↩