Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ioss: fmt is failing to compile against LLVM 20 #573

Open
jjellio opened this issue Jan 21, 2025 · 6 comments
Open

Ioss: fmt is failing to compile against LLVM 20 #573

jjellio opened this issue Jan 21, 2025 · 6 comments

Comments

@jjellio
Copy link

jjellio commented Jan 21, 2025

I don't have a good way to reproduce this. I've been evaluating a "to be released" AMD release, which uses LLVM 20 under the hood. It's falling over due to FMT. This will become live with ROCM 6.4. Perhaps if there is a regular LLVM 20 compiler hanging around (I don't have one built within SNL's compute ecosystem).

In file included from /g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/Ioss_Region.C:40:
In file included from /g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/core.h:5:
In file included from /g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h:4417:
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format-inl.h:60:22: error: call to consteval function 'fmt::basic_format_string<char, const char (&)[7], int &>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression
   60 |   fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code);
      |                      ^
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h:1827:23: note: expanded from macro 'FMT_STRING'
 1827 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, )
      |                       ^
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h:1806:3: note: expanded from macro 'FMT_STRING_IMPL'
 1806 |   [] {                                                                        \
      |   ^
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h:780:54: note: subexpression not valid in a constant expression
  780 |     format_str_.remove_prefix(detail::to_unsigned(it - begin()));
      |                                                   ~~~^~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h:2762:5: note: in call to 'this->context_.advance_to(&"{}{}"[1])'
 2762 |     context_.advance_to(begin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h:2757:5: note: in call to 'this->on_format_specs(0, &"{}{}"[1], &"{}{}"[1])'
 2757 |     on_format_specs(id, begin, begin);  // Call parse() on empty specs.
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h:2582:5: note: in call to 'handler.on_replacement_field(0, &"{}{}"[1])'
 2582 |     handler.on_replacement_field(handler.on_arg_id(), begin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h:2614:21: note: in call to 'parse_replacement_field<char, fmt::detail::format_string_checker<char, char[7], int> &>(&"{}{}"[1], &"{}{}"[4], checker(s))'
 2614 |         begin = p = parse_replacement_field(p - 1, end, handler);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h:2885:7: note: in call to 'parse_format_string<true, char, fmt::detail::format_string_checker<char, char[7], int>>({&"{}{}"[0], 4}, checker(s))'
 2885 |       detail::parse_format_string<true>(str_, checker(s));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format-inl.h:60:22: note: in call to 'basic_format_string<FMT_COMPILE_STRING, 0>([] {
    struct __attribute__((visibility("hidden")))  FMT_COMPILE_STRING : fmt::detail::compile_string {
        using char_type [[maybe_unused]] = fmt::remove_cvref_t<decltype("{}{}"[0])>;
        [[maybe_unused]] constexpr operator fmt::basic_string_view<char_type>() const {
            return fmt::detail_exported::compile_string_to_view<char_type>("{}{}");
        }
    };
    return FMT_COMPILE_STRING();
}())'
   60 |   fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code);
      |                      ^~~~~~~~~~~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h:1827:23: note: expanded from macro 'FMT_STRING'
 1827 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, )
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g20/jjellio/src/github/Trilinos/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h:1806:3: note: expanded from macro 'FMT_STRING_IMPL'
 1806 |   [] {                                                                        \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1807 |     /* Use the hidden visibility as a workaround for a GCC bug (#1973). */    \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1808 |     /* Use a macro-like name to avoid shadowing warnings. */                  \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1809 |     struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base {               \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1810 |       using char_type FMT_MAYBE_UNUSED = fmt::remove_cvref_t<decltype(s[0])>; \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1811 |       FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit                                 \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1812 |       operator fmt::basic_string_view<char_type>() const {                    \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1813 |         return fmt::detail_exported::compile_string_to_view<char_type>(s);    \
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1814 |       }                                                                       \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1815 |     };                                                                        \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1816 |     return FMT_COMPILE_STRING();                                              \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1817 |   }()
      |   ~~~
@gsjaardema
Copy link
Member

Do you know what version of the embedded fmt library is in the Trilinos version you are using. Should be in packages/seacas/libraries/ioss/src/private_copy_fmt/include/fmt/base.h

@jjellio
Copy link
Author

jjellio commented Jan 21, 2025

I'm getting this via Trilinos/develop, my path has base at fmt/base.h

[jjellio@elcap1008:Trilinos]$ git log packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h
commit be2bce43a32ede3981f660397dbe9a2a68349a78
Author: Greg Sjaardema <gdsjaar@sandia.gov>
Date:   Tue Aug 27 18:07:56 2024 -0600

    Specify HEADER_ONLY use of fmt

Seems inline with
https://github.com/trilinos/Trilinos/blob/master/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/base.h

@jjellio
Copy link
Author

jjellio commented Jan 21, 2025

I could look at building an LLVM 20 build, and eliminating AMD's stuff. Given this isn't device code, I doubt their stuff is making a difference though.

@gsjaardema
Copy link
Member

We are using a very up-to-date copy of libfmt, 11.0.2 and the current is 11.1.2

I don't see any recent changes that were added to deal with llvm 20, but will try using lib::fmt on compiler explorer and see if I can reproduce what you are seeing...

@jjellio
Copy link
Author

jjellio commented Jan 23, 2025

I talked with AMD today - the next release from them will be LLVM 19. This beta I have is a bit forward looking, so maybe we can table this. It did fall over with LLVM 20, but maybe it will work with 19.

@gsjaardema
Copy link
Member

I'm planning to take a look at fmt usage with llvm 20 on compiler explorer, but havent had a chance yet...

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

No branches or pull requests

2 participants