Skip to content

build: compile against fmt 10 and 11 - #3722

Draft
melonakos wants to merge 2 commits into
masterfrom
fix/3692-fmt11
Draft

build: compile against fmt 10 and 11#3722
melonakos wants to merge 2 commits into
masterfrom
fix/3692-fmt11

Conversation

@melonakos

@melonakos melonakos commented Sep 10, 2026

Copy link
Copy Markdown
Member

fmt 10 made formatter::format() const and fmt 11 moved fmt::join to ranges.h, so ArrayFire no longer builds against a system fmt on Arch, Homebrew, or recent Ubuntu:

error C2662: 'fmt::v11::formatter<arrayfire::common::Version,char,void>::format' ... cannot convert 'this' pointer from 'const formatter' to 'formatter &'

Every custom formatter's format() is now const, ranges.h is included where join is used, and the Version formatter combines its parsed flags into locals instead of mutating them, so {:Mm} still renders 1.2 rather than 1.2.0 (the patch on #3596 lost that, and the OpenCL backend uses it for -cl-std). The two debug headers that nothing includes also stop naming spdlog's bundled fmt directly. Built the CPU backend against fmt 11.2 / spdlog 1.15 and against the pinned fmt 8.1 / spdlog 1.9, and the CUDA backend against fmt 8; a standalone probe compiles the CUDA and debug formatter headers under both fmt versions with identical output. The OpenCL file was not built here. Fixes #3692 and #3596.

fmt 10 made formatter::format() const and fmt 11 moved fmt::join to ranges.h, so ArrayFire no longer built against a system fmt (Arch, Homebrew, Ubuntu 24.10+). Make every custom formatter's format() const, include ranges.h where join is used, and turn the Version formatter's in-place flag mutation into locals so "{:Mm}" still renders 1.2 rather than 1.2.0. Output is unchanged under the pinned fmt 8. Fixes #3692 and #3596.
debug.hpp and NodeIO.hpp included spdlog/fmt/bundled/format.h directly, which does not exist when spdlog is built against an external fmt. Nothing in src includes these headers today, but they now compile under both layouts.
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.

[Build] Error building ArrayFire with fmt 11.2.0

1 participant