Skip to content

Make GMP an optional dependency; add developer documentation#94

Open
loumalouomega wants to merge 9 commits into
wildmeshing:masterfrom
loumalouomega:doc+gmp-optional
Open

Make GMP an optional dependency; add developer documentation#94
loumalouomega wants to merge 9 commits into
wildmeshing:masterfrom
loumalouomega:doc+gmp-optional

Conversation

@loumalouomega
Copy link
Copy Markdown

Summary

GMP (GNU Multiple Precision) was previously a hard build requirement that caused cmake to abort when the library was not installed. This PR makes GMP opt-in and ships a full documentation set and a convenience configure script.


Changes

GMP is now optional (FLOAT_TETWILD_USE_GMP)

  • CMakeLists.txt — added a new CMake option FLOAT_TETWILD_USE_GMP (default OFF). When disabled, find_package(GMPfTetWild) is skipped entirely and GMP headers/libraries are never linked. When enabled, the existing GMP path is used and the preprocessor macro FLOAT_TETWILD_USE_GMP is propagated to the library.
  • Rational.h — the Rational class is now conditionally compiled:
    • With -DFLOAT_TETWILD_USE_GMP=ON: full GMP-backed mpq_t exact rational arithmetic (previous behaviour).
    • Without (default): a lightweight long double fallback implementation is used for AMIPS energy stabilisation, removing the hard GMP dependency for the common case.

New configure script (configure.sh)

A self-contained Bash helper that wraps cmake with a structured argument parser. Features include:

  • All fTetWild feature flags exposed as named options (--with-gmp, --no-tbb, --exact-envelope, --use-float, …).
  • Compiler, sanitizer (ASan / MSan / TSan / UBSan), and dependency-path overrides.
  • Auto-detects Ninja vs. Unix Makefiles; prints a human-readable configuration summary before running cmake.
  • --dry-run mode prints the assembled cmake command without executing it.
  • --offline sets FETCHCONTENT_UPDATES_DISCONNECTED=ON for air-gapped builds.

Documentation (doc)

Nine new Markdown files documenting the algorithm and codebase:

File Content
index.md Entry point and navigation
overview.md High-level algorithm overview and pipeline
preprocessing.md Input surface preparation
triangle_insertion.md Triangle insertion into the tetrahedral mesh
mesh_improvement.md Local mesh improvement operations
data_structures.md Core data-structure reference
filtering_and_booleans.md Inside/outside filtering and CSG booleans
envelope_and_aabb.md Envelope and AABB wrapper details
dependencies.md Third-party dependencies overview

README.md was updated to reference the new docs, clarify that GMP is optional, and describe the --with-gmp configure flag.


Migration / upgrade notes

  • Existing users who rely on GMP exact arithmetic: pass -DFLOAT_TETWILD_USE_GMP=ON to cmake (or --with-gmp to configure.sh) — behaviour is identical to before.
  • New users / CI without libgmp-dev: no change needed; the build works out of the box with the long double fallback.

…a structures

- Introduced detailed documentation for the following phases:
  - Phase 1: Input Preprocessing
  - Phase 2: Incremental Triangle Insertion
  - Phase 3: Mesh Improvement
  - Phase 4: Filtering and Boolean Operations
- Added a new overview document summarizing the fTetWild algorithm and its key properties.
- Documented data structures used in the algorithm, including scalar types, mesh representations, and parameters.
- Included information on envelope and AABB structures for proximity queries.
- Enhanced library API documentation for integration into C++ projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant