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

ticcutils fails to build against new libicu 75 because -std=c++14 is too old #29

Open
proycon opened this issue Jul 3, 2024 · 10 comments

Comments

@proycon
Copy link
Member

proycon commented Jul 3, 2024

On my system (Arch Linux), ticcutils and everything else in the stack refuses to compile because -std=c++14 is set (by us? by autotools?) and the icu headers no longer compile with that but require at least -std=c++17.

The work around is to just set export CXXFLAGS="-std=c++17" before ./configure, but I guess the autoconf process should have figured this out themselves.

In file included from /usr/include/unicode/unistr.h:39,
                 from ../include/ticcutils/Unicode.h:39,
                 from Unicode.cxx:28:
/usr/include/unicode/stringpiece.h:134:23: error: 'is_same_v' is not a member of 'std'; did you mean 'is_same'?
  134 |                 (std::is_same_v<decltype(T().data()), const char*>
      |                       ^~~~~~~~~
      |                       is_same
/usr/include/unicode/stringpiece.h:134:66: error: template argument 1 is invalid
  134 |                 (std::is_same_v<decltype(T().data()), const char*>
      |                                                                  ^
/usr/include/unicode/stringpiece.h:138:17: error: expected '>' before ')' token
  138 |                 ) &&
      |                 ^
/usr/include/unicode/stringpiece.h:138:17: error: expected unqualified-id before ')' token
In file included from /usr/include/unicode/uenum.h:25,
                 from /usr/include/unicode/utrans.h:22,
                 from /usr/include/unicode/translit.h:29,
                 from ../include/ticcutils/Unicode.h:40:
/usr/include/unicode/localpointer.h:561:26: error: 'auto' parameter not permitted in this context
  561 | template <typename Type, auto closeFunction>
      |                          ^~~~
/usr/include/unicode/localpointer.h:573:76: error: template argument 2 is invalid
  573 |     explicit LocalOpenPointer(std::unique_ptr<Type, decltype(closeFunction)> &&p)
      |                                                                            ^
/usr/include/unicode/localpointer.h:583:78: error: template argument 2 is invalid
  583 |     LocalOpenPointer &operator=(std::unique_ptr<Type, decltype(closeFunction)> &&p) {
      |                                                                              ^
/usr/include/unicode/localpointer.h:599:59: error: template argument 2 is invalid
  599 |     operator std::unique_ptr<Type, decltype(closeFunction)> () && {
      |                                                           ^
/usr/include/unicode/uenum.h:69:1: note: invalid template non-type parameter
   69 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/uset.h:358:1: note: invalid template non-type parameter
  358 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/utrans.h:258:1: note: invalid template non-type parameter
  258 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUTransliteratorPointer, UTransliterator, utrans_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/unorm2.h:286:1: note: invalid template non-type parameter
  286 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/utext.h:1596:1: note: invalid template non-type parameter
 1596 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUTextPointer, UText, utext_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/uregex.h:229:1: note: invalid template non-type parameter
  229 | U_DEFINE_LOCAL_OPEN_POINTER(LocalURegularExpressionPointer, URegularExpression, uregex_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:697: Unicode.lo] Error 1
@egpbos
Copy link

egpbos commented Jul 25, 2024

Seeing this error for the conda build of ticcutils as well: https://github.com/conda-forge/ticcutils-feedstock/pull/34/checks?check_run_id=27458299416

@kosloot
Copy link
Contributor

kosloot commented Aug 5, 2024

Well, I can update the software stack to generally use -std=c++17
I did so for ticcutils, libfolia and ucto

This however leads to problems with the MacOS runners for GitHub actions. (as usual)
The clang builds is OK, but the c++12 build fails the 'make check'

Undefined symbols for architecture arm64:
  "icu_74::operator<<(std::ostream&, icu_74::UnicodeString const&)", referenced from:
      test_unicodehash() in runtest.o

I currently have no clue how to solve this, -licuio IS in the build libs

nevertheless, it would be nice if you all could test the builds on Arch Linux and Conda

@kosloot
Copy link
Contributor

kosloot commented Aug 8, 2024

Well, probably this due to a mixup between libC++ (clang style, default on MacOS) and libstdc++ (Gnu style, deprecated on MacOS)
see this article
on Mac, libicuio provides:

0000000000000000 T icu_74::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, icu_74::UnicodeString const&)

And the linker searches for :

icu_74::operator<<(std::ostream&, icu_74::UnicodeString const&)

There seems no easy way to solve this

@kosloot
Copy link
Contributor

kosloot commented Aug 9, 2024

see: this test which quick and dirty shows the pain

@egpbos
Copy link

egpbos commented Sep 3, 2024

Still seeing the error in a new PR conda-forge/ticcutils-feedstock#35.

@kosloot in your snippets I see icu_74, shouldn't that be 75?

@kosloot
Copy link
Contributor

kosloot commented Sep 3, 2024

@egpbos those snippets were to illustrate why building on MacOS using gcc is failing.
It should have nothing to do with your problem, which in fact should haven been solved,
as we now have switched to std=c++17 generally
c++14 should NOT be used anymore.

@egpbos
Copy link

egpbos commented Sep 3, 2024

Ah, that's great (the conda-forge build picked up the previous release still)! Do you plan on making a new versioned release for this soon?

@kosloot
Copy link
Contributor

kosloot commented Sep 3, 2024

Well, let's say soonish. a few weeks max

@kosloot
Copy link
Contributor

kosloot commented Sep 12, 2024

@egpbos a new version of Ticcutils is released.

@egpbos
Copy link

egpbos commented Sep 12, 2024

Thanks for the headsup!

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

3 participants