Skip to content

Using GLM as a linked library

Matt Hipsey edited this page Aug 30, 2026 · 1 revision

Note

This page is a stub and needs input from the maintainers. GLM 4 can be built as a library rather than a standalone executable, but the public API and a worked example are not yet documented here.

GLM can be compiled as a linked library, so that it can be driven from another program rather than run as a standalone executable. This is used for coupling GLM to external frameworks and for embedding it in larger modelling workflows.

Building as a library

Pass --with-lib to the build script (see Compiling the code):

cd glm-source
./build_glm.sh --with-lib

Use --without-lib to build the standalone executable only.

Coupling interface

In the 4.x line the AED coupling is provided through libaed-api, a restructured interface introduced in GLM 4. This replaces the direct coupling used in the GLM 3.x line, and is the reason current glm-aed builds are not compatible with the archived GLM3 repository.

Still to document

  • The public entry points exposed by the library build, and their calling conventions.
  • A minimal worked example of driving GLM from an external program.
  • How simulation state and time-stepping are controlled by the caller.
  • Whether the library build supports the AED coupling, or hydrodynamics only.

Clone this wiki locally