gtopt/solver_build_info.hpp file

Plugin-exported identity: solver-library versions and build tag.

Two OPTIONAL C entry points a solver plugin may export so that SolverRegistry can verify it is loading the plugin it expects, linked to the solver library it was compiled against:

  • int gtopt_solver_build_info(const char* solver, SolverBuildInfo* out) — the solver version from the headers the plugin was COMPILED with, the version reported by the library actually loaded at RUNTIME, and an address inside that library (the registry resolves it with dladdr / dl_iterate_phdr into a path and an ELF build-id).
  • const char* gtopt_plugin_build_tag() — the gtopt build the plugin belongs to (<git describe>+<build-tree id>), compared with the host's own tag.
  • int gtopt_solver_version_pin(const char* solver, SolverVersionPin*) — the solver release this gtopt is PINNED to (CMake GTOPT_<SOLVER>_PIN_VERSION, e.g. HiGHS 1.16.0: the goldens are generated with it) and whether the plugin was built with -DGTOPT_<SOLVER>_ALLOW_UNPINNED=ON. The registry refuses a solver whose RUNTIME library is not the pinned release (see check_solver_version_pin). A separate entry point rather than new SolverBuildInfo fields, so an older host never receives a struct larger than the one it allocated.
  • int gtopt_plugin_linked_libraries(int* struct_version, const SolverLinkedLibrary** out) — the identity (soname, GNU build-id, else SHA-256, and path) of every shared library the plugin was LINKED against, recorded at build time and compiled into the plugin (cmake_local/PluginLinkedLibraries.cmake, every plugin gets it from gtopt_add_solver_plugin). The registry compares the solver library actually mapped in the process with it, so a foreign library that reports the right version (LD_LIBRARY_PATH / LD_PRELOAD) is refused (see check_solver_library_identity).

All are optional: plugins that predate them still load (with a warning), so adding them does not bump k_solver_abi_version. The POD carries its own struct_version so it can grow the same way SolverResourceDescriptor does.

Namespaces

namespace gtopt

Classes

struct gtopt::SolverBuildInfo
struct gtopt::SolverLinkedLibrary
struct gtopt::SolverVersionPin