Skip to content

Provide MMDB Shim built on gemmi - #385

Open
Dialpuri wants to merge 24 commits into
pemsley:mainfrom
Dialpuri:mock-mmdb
Open

Provide MMDB Shim built on gemmi#385
Dialpuri wants to merge 24 commits into
pemsley:mainfrom
Dialpuri:mock-mmdb

Conversation

@Dialpuri

@Dialpuri Dialpuri commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Replace MMDB2 with a gemmi-backed shim

Coot can now be built against mmdb-shim/ instead of libmmdb2. The shim presents
MMDB's public API (mmdb::*) unchanged, but every object is a thin wrapper over
a live gemmi::Structure. Goal: drop the MMDB2 dependency while keeping MMDB's
observable behaviour.

Status: the full Coot tree compiles and links against the shim, and the
shim's own test suite passes. Runtime validation against real structures is still
required.

What's here

  • The shim (mmdb-shim/): mostly header-only inline implementations
    over gemmi, plus a compiled component (src/contacts.cc, src/io.cc) built
    into libmmdbshim.a. It uses gemmi for the real work (I/O, symmetry, neighbour
    search, mmCIF) and reimplements the parts gemmi lacks (MMDB's selection engine
    and UDData). Public headers fall through to real MMDB when COOT_USE_MMDB_SHIM
    is off. See mmdb-shim/ARCHITECTURE.md for the full design.
  • A one-time source rewrite (~181 files): MMDB exposes atom/residue fields as
    public data members, which gemmi can't; a clang AST-matcher tool converted
    field access to accessors (atom->xatom->x(), strcpy(at->name,…)
    at->SetAtomName(…)).

Build

Coot builds against the shim via the CMake path; the shim's tests build with
mmdb-shim/build.sh.

@Dialpuri
Dialpuri marked this pull request as ready for review July 23, 2026 16:20
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