Skip to content

Install a consumable CMake package with ABI-aware dependencies - #29

Merged
d-torrance merged 2 commits into
Macaulay2:masterfrom
dimpase:install-cmake-package
Sep 19, 2026
Merged

d-torrance merged 2 commits into
Macaulay2:masterfrom
dimpase:install-cmake-package

Conversation

@dimpase

@dimpase dimpase commented Sep 18, 2026 •

Copy link
Copy Markdown

CMake installations currently provide no package config or exported target, hard-code installation directories, and reconstruct memtailor as a static imported library without its ABI flags. A Debug mathic build also forces MEMT_DEBUG even if the installed dependency has the Release layout.

Install mathicConfig.cmake, version metadata, mathic::mathic, and mathic.pc, using GNUInstallDirs and the existing Autotools-compatible SONAME. The target supplies C++17 and transitive dependency requirements. Prefer memtailor's CMake config, with pkg-config support for existing distribution packages, so this PR does not require Macaulay2/memtailor#23 to merge first. Dependency discovery now requires one of those metadata formats rather than assuming ABI compatibility from headers and a library alone.

Publish the installed library's MATHIC_DEBUG setting independently of the consumer's build type, and inherit memtailor's own ABI flags. Enable CTest at the project root. Linux/macOS CI gains shared/static × Release/Debug installation checks, pkg-config flag checks, and separate Release consumers of relocated installations. The consumer requests C++11 to verify that the exported target raises the requirement to C++17. Include the new templates and fixtures in Autotools distributions, and document installation and consumption. CMake 3.18 is now required for aliases of non-global imported dependency targets.

macOS CMake CI builds released dependencies with Autotools to obtain their pkg-config metadata, which the current Homebrew memtailor bottle lacks. This does not require unmerged dependency changes.

Local Gentoo validation, at low priority with two compilation jobs:

  • All 14 tests passed for Release/shared and Debug/static builds.
  • Relocated installed CMake consumers and pkg-config consumers passed, including Release consumers of Debug libraries.
  • Config-based dependencies were exercised in Release; pkg-config discovery was forced in Debug.
  • make dist succeeded and its archive contains the new CMake templates and consumer fixtures.
  • Workflow lint and diff checks passed. The full hosted Linux/macOS CI matrix passed.

This is the upstream counterpart of the CMake packaging work for the local Gentoo mathic ebuild. External mathic selection in M2 remains a separate task.

🤖 gpt-6-astra worked on this 🤖

Export mathic::mathic with C++17, install versioned shared/static libraries and pkg-config metadata, and preserve the installed Debug ABI. Support both config and pkg-config dependencies and exercise relocated consumers in CI.

Co-authored-by: Codex <noreply@openai.com>
Build tagged Autotools dependencies in a temporary prefix because current Homebrew CMake bottles omit package metadata.

Co-authored-by: Codex <noreply@openai.com>

@dimpase dimpase left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simplified a bit once a new release of memtailor, 1.5+, is done (and propagated to upstreams such as Homebrew)

@d-torrance - over to you

@dimpase
dimpase marked this pull request as ready for review September 19, 2026 18:49

@d-torrance d-torrance left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I'll likely do new memtailor/mathic/mathicgb releases pretty soon. Definitely before the next M2 release in November

@d-torrance
d-torrance merged commit 7c0f42b into Macaulay2:master Sep 19, 2026
4 checks passed
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.

2 participants