Title: [Build] Error building ArrayFire with fmt 11.2.0 · Issue #3692 · arrayfire/arrayfire · GitHub
Open Graph Title: [Build] Error building ArrayFire with fmt 11.2.0 · Issue #3692 · arrayfire/arrayfire
X Title: [Build] Error building ArrayFire with fmt 11.2.0 · Issue #3692 · arrayfire/arrayfire
Description: Note This is similar to #3596 in nature. Description ArrayFire is failing to compile with fmt 11.2.0 (in ArrayFireTypesIO.hpp). It seems to be a mismatch between ArrayFire’s custom fmt::formatter specialization and the version of fmt on ...
Open Graph Description: Note This is similar to #3596 in nature. Description ArrayFire is failing to compile with fmt 11.2.0 (in ArrayFireTypesIO.hpp). It seems to be a mismatch between ArrayFire’s custom fmt::formatter s...
X Description: Note This is similar to #3596 in nature. Description ArrayFire is failing to compile with fmt 11.2.0 (in ArrayFireTypesIO.hpp). It seems to be a mismatch between ArrayFire’s custom fmt::formatter s...
Opengraph URL: https://github.com/arrayfire/arrayfire/issues/3692
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Build] Error building ArrayFire with fmt 11.2.0","articleBody":"\u003e [!NOTE]\n\u003e \n\u003e This is similar to #3596 in nature.\n\u003e \n\nDescription\n===========\n\nArrayFire is failing to compile with fmt 11.2.0 (in `ArrayFireTypesIO.hpp`).\n\nIt seems to be a mismatch between ArrayFire’s custom fmt::formatter specialization and the version of fmt on arch (which is 11)\n\nSomething to note as well, if I just add `const` to the format functions I will get this error:\n\n```bash\n[ 1%] Building CXX object third_party/arrayfire/src/backend/cpu/CMakeFiles/afcpu.dir/ __/common/DependencyModule.cpp.o \nIn file included from /home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/co mmon/DependencyModule.cpp:10: \n/home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/common/ArrayFireTypesIO. hpp: \nIn member function ‘decltype (ctx.out()) fmt::v11::formatter\u003carrayfire::common::V ersion\u003e::format(const arrayfire::common::Version\u0026, FormatContext\u0026) const’: \n/home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/common/ArrayFireTypesIO. hpp:80:43: \nerror: assignment of member ‘fmt::v11::formatter\u003carrayfire::common::Version \u003e::show_minor’ in read-only object [-Wtemplate-body] 80 | if (ver.minor() == -1) show_minor = false; | ~~~~~~~~~~~^~~~~~~ \n/home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/common/ArrayFireTypesIO. hpp:81:43: \nerror: assignment of member ‘fmt::v11::formatter\u003carrayfire::common::Version \u003e::show_patch’ in read-only object [-Wtemplate-body] 81 | if (ver.patch() == -1) show_patch = false; | ~~~~~~~~~~~^~~~~~~ \nAt global scope: \ncc1plus: note: unrecognized command-line option ‘-Wno-unqualified-std-cast-call’ may h ave been intended to silence earlier diagnostics\n```\n\nThere is a fix I have in mind to have it work for older (9\u003c) and newer fmt versions (like 11).\n\nError Log\n---------\n\u003c!-- Output of the error log. --\u003e\n```\nIn file included from /usr/include/fmt/format.h:41,\n from /usr/include/fmt/chrono.h:23,\n from /usr/include/fmt/ostream.h:23,\n from /usr/include/spdlog/fmt/ostr.h:21,\n from /home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/co\nmmon/ArrayFireTypesIO.hpp:12,\n from /home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/co\nmmon/DependencyModule.cpp:10:\n/usr/include/fmt/base.h: In instantiation of ‘static void fmt::v11::detail::value\u003cCont\next\u003e::format_custom(void*, fmt::v11::parse_context\u003ctypename Context::char_type\u003e\u0026, Cont\next\u0026) [with T = arrayfire::common::Version; Formatter = fmt::v11::formatter\u003carrayfire:\n:common::Version\u003e; Context = fmt::v11::context; typename Context::char_type = char]’:\n/usr/include/fmt/base.h:2255:19: required from ‘constexpr fmt::v11::detail::value\u003cCo\nntext\u003e::value(T\u0026, fmt::v11::detail::custom_tag) [with T = arrayfire::common::Version; \ntypename std::enable_if\u003chas_formatter\u003cT, typename Context::char_type\u003e(), int\u003e::type \u003ca\nnonymous\u003e = 0; Context = fmt::v11::context]’\n 2255 | custom.format = format_custom\u003cvalue_type, formatter\u003cvalue_type, char_type\u003e\n\u003e;\n | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n~\n/usr/include/fmt/base.h:2235:65: required from ‘fmt::v11::detail::value\u003cContext\u003e::va\nlue(T\u0026) [with T = arrayfire::common::Version; typename std::enable_if\u003c(std::integral_c\nonstant\u003cbool, (((((((std::is_class\u003cT\u003e::value || std::is_enum\u003cT\u003e::value) || std::is_uni\non\u003cT\u003e::value) || std::is_array\u003cT\u003e::value) \u0026\u0026 (! fmt::v11::detail::has_to_string_view\u003cT\n, void\u003e::value)) \u0026\u0026 (! fmt::v11::detail::is_named_arg\u003cT\u003e::value)) \u0026\u0026 (! fmt::v11::deta\nil::use_format_as\u003cT\u003e::value)) \u0026\u0026 (! fmt::v11::detail::use_format_as_member\u003ctypename st\nd::remove_const\u003cT\u003e::type, std::integral_constant\u003cbool, true\u003e \u003e::value))\u003e::value || (!1\n)), int\u003e::type \u003canonymous\u003e = 0; Context = fmt::v11::context]’\n 2235 | FMT_CONSTEXPR20 FMT_INLINE value(T\u0026 x) : value(x, custom_tag()) {}\n | ^\n/usr/include/fmt/base.h:2808:20: required from ‘constexpr fmt::v11::detail::format_a\nrg_store\u003cContext, NUM_ARGS, NUM_NAMED_ARGS, DESC\u003e fmt::v11::make_format_args(T\u0026 ...) [\nwith Context = context; T = {std::__cxx11::basic_string\u003cchar, std::char_traits\u003cchar\u003e, \nstd::allocator\u003cchar\u003e \u003e, arrayfire::common::Version}; int NUM_ARGS = 2; int NUM_NAMED_A\nRGS = 0; long long unsigned int DESC = 253]’\n 2808 | return {{args...}};\n | ^\n/usr/include/spdlog/logger.h:328:75: required from ‘void spdlog::logger::log_(spdlog\n::source_loc, spdlog::level::level_enum, spdlog::string_view_t, Args\u0026\u0026 ...) [with Args\n = {std::__cxx11::basic_string\u003cchar, std::char_traits\u003cchar\u003e, std::allocator\u003cchar\u003e \u003e\u0026, \narrayfire::common::Version\u0026}; spdlog::string_view_t = fmt::v11::basic_string_view\u003cchar\n\u003e]’\n 328 | fmt::vformat_to(fmt::appender(buf), fmt, fmt::make_format_args(args...));\n | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~\n/usr/include/spdlog/logger.h:80:13: required from ‘void spdlog::logger::log(spdlog::\nsource_loc, spdlog::level::level_enum, fmt::v11::format_string\u003cT ...\u003e, Args\u0026\u0026 ...) [wi\nth Args = {std::__cxx11::basic_string\u003cchar, std::char_traits\u003cchar\u003e, std::allocator\u003ccha\nr\u003e \u003e\u0026, arrayfire::common::Version\u0026}; fmt::v11::format_string\u003cT ...\u003e = fmt::v11::fstrin\ng\u003cstd::__cxx11::basic_string\u003cchar, std::char_traits\u003cchar\u003e, std::allocator\u003cchar\u003e \u003e\u0026, ar\nrayfire::common::Version\u0026\u003e]’\n 80 | log_(loc, lvl, details::to_string_view(fmt), std::forward\u003cArgs\u003e(args).\n..);\n | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n~~~\n/usr/include/spdlog/logger.h:85:12: required from ‘void spdlog::logger::log(spdlog::\nlevel::level_enum, fmt::v11::format_string\u003cT ...\u003e, Args\u0026\u0026 ...) [with Args = {std::__cx\nx11::basic_string\u003cchar, std::char_traits\u003cchar\u003e, std::allocator\u003cchar\u003e \u003e\u0026, arrayfire::co\nmmon::Version\u0026}; fmt::v11::format_string\u003cT ...\u003e = fmt::v11::fstring\u003cstd::__cxx11::basi\nc_string\u003cchar, std::char_traits\u003cchar\u003e, std::allocator\u003cchar\u003e \u003e\u0026, arrayfire::common::Ver\nsion\u0026\u003e]’\n 85 | log(source_loc{}, lvl, fmt, std::forward\u003cArgs\u003e(args)...);\n | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/usr/include/spdlog/logger.h:130:12: required from ‘void spdlog::logger::trace(fmt::\nv11::format_string\u003cT ...\u003e, Args\u0026\u0026 ...) [with Args = {std::__cxx11::basic_string\u003cchar, \nstd::char_traits\u003cchar\u003e, std::allocator\u003cchar\u003e \u003e\u0026, arrayfire::common::Version\u0026}; fmt::v1\n1::format_string\u003cT ...\u003e = fmt::v11::fstring\u003cstd::__cxx11::basic_string\u003cchar, std::char\n_traits\u003cchar\u003e, std::allocator\u003cchar\u003e \u003e\u0026, arrayfire::common::Version\u0026\u003e]’\n 130 | log(level::trace, fmt, std::forward\u003cArgs\u003e(args)...);\n | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/common/DependencyModule.\ncpp:137:33: required from here\n 67 | getLogger()-\u003etrace(\"[ \" __FILE__ \\\n | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~\n 68 | \":\" AF_STR_HELPER(__LINE__) \" ] \" __VA_ARGS__)\n | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/usr/include/fmt/base.h:2275:29: error: passing ‘const fmt::v11::formatter\u003carrayfire::\ncommon::Version\u003e’ as ‘this’ argument discards qualifiers [-fpermissive]\n 2275 | ctx.advance_to(cf.format(*static_cast\u003cqualified_type*\u003e(arg), ctx));\n | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/home/s1dd/dev/rcai/cppgrad/third_party/arrayfire/src/backend/common/ArrayFireTypesIO.\nhpp:76:10: note: in call to ‘decltype (ctx.out()) fmt::v11::formatter\u003carrayfire::com\nmon::Version\u003e::format(const arrayfire::common::Version\u0026, FormatContext\u0026) [with FormatC\nontext = fmt::v11::context; decltype (ctx.out()) = fmt::v11::basic_appender\u003cchar\u003e]’\n 76 | auto format(const arrayfire::common::Version\u0026 ver, FormatContext\u0026 ctx)\n | ^~~~~~\ncc1plus: note: unrecognized command-line option ‘-Wno-unqualified-std-cast-call’ may h\nave been intended to silence earlier diagnostics\nmake[2]: *** [third_party/arrayfire/src/backend/cpu/CMakeFiles/afcpu.dir/build.make:39\n29: third_party/arrayfire/src/backend/cpu/CMakeFiles/afcpu.dir/__/common/DependencyMod\nule.cpp.o] Error 1\nmake[1]: *** [CMakeFiles/Makefile2:2791: third_party/arrayfire/src/backend/cpu/CMakeFi\nles/afcpu.dir/all] Error 2\nmake: *** [Makefile:166: all] Error 2\n```\n\nBuild Environment\n-----------------\nCompiler version: gcc version 15.2.1 20250813 (GCC)\nOperating system: Arch Linux (kernel: 6.16.1-zen1-1-zen)\nBuild environment: fmt 11.2.0, ArrayFire at commit hash (a699cb9eb2d7f7bfbeca9e00a2b53b26d90b2efb)\nCMake variables:\n```text\nAF_BACKEND:STRING=cpu\nAF_BUILD_CPU:BOOL=ON\nAF_BUILD_CUDA:BOOL=OFF\nAF_BUILD_DOCS:BOOL=ON\nAF_BUILD_EXAMPLES:BOOL=ON\nAF_BUILD_FORGE:BOOL=OFF\nAF_BUILD_ONEAPI:BOOL=OFF\nAF_BUILD_OPENCL:BOOL=OFF\nAF_BUILD_UNIFIED:BOOL=ON\nAF_COMPUTE_LIBRARY:STRING=FFTW/LAPACK/BLAS\nAF_CTEST_SEPARATED:BOOL=OFF\nAF_SKIP_UNSUPPORTED_TESTS:BOOL=OFF\nAF_STACKTRACE_TYPE:STRING=Basic\nAF_WITH_CUDNN:BOOL=OFF\nAF_WITH_EXTERNAL_PACKAGES_ONLY:BOOL=OFF\nAF_WITH_FAST_MATH:BOOL=OFF\nAF_WITH_FMT_HEADER_ONLY:BOOL=OFF\nAF_WITH_SPDLOG_HEADER_ONLY:BOOL=OFF\nAF_WITH_STATIC_CUDA_NUMERIC_LIBS:BOOL=OFF\nBENCHMARK_BUILD_32_BITS:BOOL=OFF\nBENCHMARK_DOWNLOAD_DEPENDENCIES:BOOL=OFF\nBENCHMARK_ENABLE_ASSEMBLY_TESTS:BOOL=ON\nBENCHMARK_ENABLE_DOXYGEN:BOOL=OFF\nBENCHMARK_ENABLE_EXCEPTIONS:BOOL=ON\nBENCHMARK_ENABLE_GTEST_TESTS:BOOL=ON\nBENCHMARK_ENABLE_LIBPFM:BOOL=OFF\nBENCHMARK_ENABLE_LTO:BOOL=OFF\nBENCHMARK_ENABLE_WERROR:BOOL=ON\nBENCHMARK_FORCE_WERROR:BOOL=OFF\nBENCHMARK_INSTALL_DOCS:BOOL=ON\nBENCHMARK_USE_BUNDLED_GTEST:BOOL=ON\nBENCHMARK_USE_LIBCXX:BOOL=OFF\nBUILD_TESTING:BOOL=ON\nCATCH_DEVELOPMENT_BUILD:BOOL=OFF\nCATCH_ENABLE_REPRODUCIBLE_BUILD:BOOL=ON\nCATCH_INSTALL_DOCS:BOOL=ON\nCATCH_INSTALL_EXTRAS:BOOL=ON\nCLBlast_DIR:PATH=CLBlast_DIR-NOTFOUND\nCMAKE_BUILD_TYPE:STRING=Release\nCMAKE_INSTALL_PREFIX:PATH=/usr/local\nCXXFEATURECHECK_DEBUG:BOOL=OFF\nFETCHCONTENT_UPDATES_DISCONNECTED_SPAN-LITE:BOOL=OFF\nGTest_DIR:PATH=/lib/cmake/GTest\nLLVM_FILECHECK_EXE:PATH=/sbin/FileCheck\nMKL_Core_LINK_LIBRARY:FILEPATH=MKL_Core_LINK_LIBRARY-NOTFOUND\nMKL_DIR:PATH=MKL_DIR-NOTFOUND\nMKL_FFTW_INCLUDE_DIR:PATH=MKL_FFTW_INCLUDE_DIR-NOTFOUND\nMKL_INCLUDE_DIR:PATH=MKL_INCLUDE_DIR-NOTFOUND\nMKL_Interface_LINK_LIBRARY:FILEPATH=MKL_Interface_LINK_LIBRARY-NOTFOUND\nMKL_RT_LINK_LIBRARY:FILEPATH=MKL_RT_LINK_LIBRARY-NOTFOUND\nMKL_THREAD_LAYER:STRING=Intel OpenMP\nMKL_ThreadLayer_LINK_LIBRARY:FILEPATH=MKL_ThreadLayer_LINK_LIBRARY-NOTFOUND\nMKL_ThreadingLibrary_LINK_LIBRARY:FILEPATH=MKL_ThreadingLibrary_LINK_LIBRARY-NOTFOUND\nMKL_mkl_avx2_LINK_LIBRARY:FILEPATH=MKL_mkl_avx2_LINK_LIBRARY-NOTFOUND\nMKL_mkl_avx512_LINK_LIBRARY:FILEPATH=MKL_mkl_avx512_LINK_LIBRARY-NOTFOUND\nMKL_mkl_avx_LINK_LIBRARY:FILEPATH=MKL_mkl_avx_LINK_LIBRARY-NOTFOUND\nMKL_mkl_def_LINK_LIBRARY:FILEPATH=MKL_mkl_def_LINK_LIBRARY-NOTFOUND\nMKL_mkl_mc3_LINK_LIBRARY:FILEPATH=MKL_mkl_mc3_LINK_LIBRARY-NOTFOUND\nMKL_mkl_mc_LINK_LIBRARY:FILEPATH=MKL_mkl_mc_LINK_LIBRARY-NOTFOUND\nUSE_PREBUILT_ARRAYFIRE:BOOL=OFF\n```\n","author":{"url":"https://github.com/nots1dd","@type":"Person","name":"nots1dd"},"datePublished":"2025-08-28T12:53:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3692/arrayfire/issues/3692"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d76fbe26-aba1-064c-cc96-4d34ac916582 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE1E:2AB245:8B55A93:B78013F:696DEC2F |
| html-safe-nonce | f016e72f391fc32adb17c1cc9c8aee0bac65d58cf0523dcaee7151b613fc1421 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTFFOjJBQjI0NTo4QjU1QTkzOkI3ODAxM0Y6Njk2REVDMkYiLCJ2aXNpdG9yX2lkIjoiNDcyODg4NDYyNjc1MzE4Njg2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6d82ed210f2caacae9394edf1afa67de943387b04a070557a6d72691859dd6ca |
| hovercard-subject-tag | issue:3363220448 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/arrayfire/arrayfire/3692/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a3fe79bf9ccb64ebf916be283d622f4ce2d7b771d2d579803d59aa85b69eb6b/arrayfire/arrayfire/issues/3692 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a3fe79bf9ccb64ebf916be283d622f4ce2d7b771d2d579803d59aa85b69eb6b/arrayfire/arrayfire/issues/3692 |
| og:image:alt | Note This is similar to #3596 in nature. Description ArrayFire is failing to compile with fmt 11.2.0 (in ArrayFireTypesIO.hpp). It seems to be a mismatch between ArrayFire’s custom fmt::formatter s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nots1dd |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064 |
| turbo-cache-control | no-preview |
| go-import | github.com/arrayfire/arrayfire git https://github.com/arrayfire/arrayfire.git |
| octolytics-dimension-user_id | 5395442 |
| octolytics-dimension-user_login | arrayfire |
| octolytics-dimension-repository_id | 25889802 |
| octolytics-dimension-repository_nwo | arrayfire/arrayfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 25889802 |
| octolytics-dimension-repository_network_root_nwo | arrayfire/arrayfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7e5ae23c70136152637ceee8d6faceb35596ec46 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width