Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Development

crates docs

Prerequisites

  • Git

  • Rust and Cargo, installed via Rustup:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    

    Rust updates occur every six weeks. To update Rust:

    rustup update
    
  • netCDF, a system library automesh links against for Exodus II I/O 1 — see the netCDF Prerequisite in Installation for per-platform install commands.

Optional

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
      • mdbook serve --open
        • interactive mode
        • On the local machine, with Firefox, open the index.html file, e.g.,
          • file:///Users/chovey/autotwin/automesh/book/build/index.html
      • cargo rustdoc --open -- --html-in-header docs/katex.html
    • Test:
      • cargo test
      • cargo run // test without required input and output flags
      • cargo run --release -- -i tests/input/f.npy -o foo.exo
      • cargo run -- --help
    • Lint:
      • cargo clippy
    • Pre-commit:
      • pre-commit run --all-files
    • Clean:
      • cargo clean
  • Merge Request

References


  1. automesh's build script looks for the netCDF library in a fixed, OS-specific location (e.g. /opt/homebrew/lib or /usr/local/lib on macOS, /usr/lib/x86_64-linux-gnu on Linux, or C:/vcpkg/installed/x64-windows/lib on Windows) rather than using pkg-config or an environment variable, so netCDF must be installed to one of those default locations for the build to find it.