Skip to content

Read the UFCx version from ufcx.h in FindUFCxPython - #4663

Merged
jhale merged 1 commit into
mainfrom
jhale/ufcx-version-from-header
Oct 18, 2026
Merged

jhale merged 1 commit into
mainfrom
jhale/ufcx-version-from-header

Conversation

@jhale

@jhale jhale commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

This is a step towards unlocking the UFCx and FFCx version numbers. ufcx.h changes slowly, while FFCx releases with every minor version. Today the ufcx version is bumped with each FFCx release anyway, so DOLFINx has to require a matching FFCx even when the interface is unchanged. Versioning ufcx on its own, and bumping it only when ufcx.h changes, would let one DOLFINx release work with several FFCx releases.

FindUFCxPython stood in the way of that. It set UFCX_VERSION from ffcx.__version__, so find_package(UFCxPython 0.12...<0.13) (#4661) checks the FFCx release, not the interface DOLFINx compiles against. It now reads UFCX_VERSION_MAJOR, UFCX_VERSION_MINOR and UFCX_VERSION_MAINTENANCE from the ufcx.h it has already found and hashed. That matches what ufcxConfigVersion.cmake reports in CONFIG mode, which also takes its version from the ufcx project, not FFCx's Python package.

Today the two versions agree, so nothing changes. Once ufcx is versioned on its own, an FFCx release that still ships the same ufcx.h passes the check.

Tested against FFCx main (ffcx.__version__ 0.12.0.dev0, header 0.12), and against a stand-in ffcx package whose __version__ is 0.12.0.dev0 but whose header says 0.13:

package / header 0.12...<0.13 0.13...<0.14
0.12 / 0.12 found 0.12.0 unsuitable 0.12.0
0.12 / 0.13 unsuitable 0.13.0 found 0.13.0

The dev/release distinction is not in the header's three numbers, so the found version is 0.12.0, not 0.12.0.dev0. CMake ignored the .dev0 when comparing anyway.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2

UFCX_VERSION came from ffcx.__version__, which ties the find_package
version check to FFCx releases, not to the ufcx.h interface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2
@jhale
jhale added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit cb3cc04 Oct 18, 2026
21 of 22 checks passed
@jhale
jhale deleted the jhale/ufcx-version-from-header branch October 18, 2026 17:13
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