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

Error installing on MacOS 15.1 #190

Open
samuelvaneck opened this issue Nov 23, 2024 · 3 comments
Open

Error installing on MacOS 15.1 #190

samuelvaneck opened this issue Nov 23, 2024 · 3 comments

Comments

@samuelvaneck
Copy link

I'm trying to install version 0.7.9 on MacOS. It seems that since upgrading to MacOS 15.1 i'm getting error. I've tried setting the correct flags like explained in the README but with no luck yet.

Installing in on Linux within a docker container works fine.

This is the begin and end part of the error logs that I'm getting.

/Users/username/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/charlock_holmes-0.7.9/ext/charlock_holmes
/Users/username/.rbenv/versions/3.3.6/bin/ruby extconf.rb --with-icu-dir\=/path/to/installed/icu4c
--with-cxxflags\=-std\=c++11
checking for pkg-config for icu-i18n... ["-I/opt/homebrew/Cellar/icu4c@76/76.1_1/include ",
"-L/opt/homebrew/Cellar/icu4c@76/76.1_1/lib", "-licui18n"]
checking for pkg-config for icu-io... ["-I/opt/homebrew/Cellar/icu4c@76/76.1_1/include ",
"-L/opt/homebrew/Cellar/icu4c@76/76.1_1/lib", "-licuio"]
checking for pkg-config for icu-uc... ["-I/opt/homebrew/Cellar/icu4c@76/76.1_1/include ",
"-L/opt/homebrew/Cellar/icu4c@76/76.1_1/lib", "-licuuc"]
checking for -licui18n... yes
checking for unicode/ucnv.h... yes
checking for -lz... yes
checking for -licuuc... yes
checking for -licudata... yes
checking for icu that requires explicit C++ version flag... yes
checking for icu that compiles with c++20 standard... yes
Static linking is disabled.
creating Makefile

.....

current directory:
/Users/samuelvaneck/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/charlock_holmes-0.7.9/ext/charlock_holmes
make DESTDIR\= sitearchdir\=./.gem.20241123-31238-ug4gdv sitelibdir\=./.gem.20241123-31238-ug4gdv clean

In file included from transliterator.cpp:5:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/translit.h:27:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:37:
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:316:16: warning: variable templates are a C++14
extension [-Wc++14-extensions]
  316 | constexpr bool ConvertibleToU16StringView =
      |                ^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:317:10: error: no template named 'is_convertible_v'
in namespace 'std'; did you mean 'is_convertible'?
  317 |     std::is_convertible_v<T, std::u16string_view>
      |     ~~~~~^~~~~~~~~~~~~~~~
      |          is_convertible
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_convertible.h:28:29:
note: 'is_convertible' declared here
   28 | struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant<bool, __is_convertible(_T1, _T2)> {};
      |                             ^
In file included from transliterator.cpp:5:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/translit.h:27:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:37:
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:324:5: error: expected '(' for function-style cast
or type construction
  317 |     std::is_convertible_v<T, std::u16string_view>
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  318 | #if !U_CHAR16_IS_TYPEDEF && (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 180000)
  319 |     || std::is_convertible_v<T, std::basic_string_view<uint16_t>>
  320 | #endif
  321 | #if U_SIZEOF_WCHAR_T==2
  322 |     || std::is_convertible_v<T, std::wstring_view>
  323 | #endif
  324 |     ;
      |     ^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:360:36: error: no type named 'enable_if_t' in
namespace 'std'
  360 |           typename = typename std::enable_if_t<!std::is_pointer_v<std::remove_reference_t<T>>>>
      |                      ~~~~~~~~~~~~~~^~~~~~~~~~~
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:360:47: error: expected ',' or '>' in
template-parameter-list
  360 |           typename = typename std::enable_if_t<!std::is_pointer_v<std::remove_reference_t<T>>>>
      |                                               ^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:360:93: error: expected unqualified-id
  360 |           typename = typename std::enable_if_t<!std::is_pointer_v<std::remove_reference_t<T>>>>
      |                                                                                             ^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:370:36: error: no type named 'enable_if_t' in
namespace 'std'
  370 |           typename = typename std::enable_if_t<std::is_pointer_v<std::remove_reference_t<T>>>,
      |                      ~~~~~~~~~~~~~~^~~~~~~~~~~
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:370:47: error: expected ',' or '>' in
template-parameter-list
  370 |           typename = typename std::enable_if_t<std::is_pointer_v<std::remove_reference_t<T>>>,
      |                                               ^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/char16ptr.h:370:92: error: expected unqualified-id
  370 |           typename = typename std::enable_if_t<std::is_pointer_v<std::remove_reference_t<T>>>,
      |                                                                                            ^
In file included from transliterator.cpp:5:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/translit.h:27:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:40:
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/stringpiece.h:134:29: error: no template named 'enable_if_t' in
namespace 'std'
  134 |             typename = std::enable_if_t<
      |                        ~~~~~^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/stringpiece.h:135:23: error: no template named 'is_same_v' in
namespace 'std'; did you mean 'is_same'?
  135 |                 (std::is_same_v<decltype(T().data()), const char*>
      |                  ~~~~~^~~~~~~~~
      |                       is_same
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_same.h:22:29:
note: 'is_same' declared here
   22 | struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> {};
      |                             ^
In file included from transliterator.cpp:5:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/translit.h:27:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:40:
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/stringpiece.h:140:17: error: use of address-of-label extension
outside of a function body
  140 |                 std::is_same_v<decltype(T().size()), size_t>>>
      |                 ^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/stringpiece.h:140:62: error: expected member name or ';' after
declaration specifiers
  140 |                 std::is_same_v<decltype(T().size()), size_t>>>
      |                                                              ^
In file included from transliterator.cpp:5:
In file included from /opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/translit.h:27:
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:346:40: error: no template named 'enable_if_t' in
namespace 'std'
  346 |   template<typename S, typename = std::enable_if_t<ConvertibleToU16StringView<S>>>
      |                                   ~~~~~^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:381:40: error: no template named 'enable_if_t' in
namespace 'std'
  381 |   template<typename S, typename = std::enable_if_t<ConvertibleToU16StringView<S>>>
      |                                   ~~~~~^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:1959:40: error: no template named 'enable_if_t' in
namespace 'std'
 1959 |   template<typename S, typename = std::enable_if_t<ConvertibleToU16StringView<S>>>
      |                                   ~~~~~^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:2226:40: error: no template named 'enable_if_t' in
namespace 'std'
 2226 |   template<typename S, typename = std::enable_if_t<ConvertibleToU16StringView<S>>>
      |                                   ~~~~~^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:2299:40: error: no template named 'enable_if_t' in
namespace 'std'
 2299 |   template<typename S, typename = std::enable_if_t<ConvertibleToU16StringView<S>>>
      |                                   ~~~~~^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:3273:40: error: no template named 'enable_if_t' in
namespace 'std'
 3273 |   template<typename S, typename = std::enable_if_t<ConvertibleToU16StringView<S>>>
      |                                   ~~~~~^
/opt/homebrew/Cellar/icu4c@76/76.1_1/include/unicode/unistr.h:3599:40: error: no template named 'enable_if_t' in
namespace 'std'
 3599 |   template<typename S, typename = std::enable_if_t<ConvertibleToU16StringView<S>>>
      |                                   ~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [Makefile:240: transliterator.o] Error 1
@dshorthouse
Copy link

dshorthouse commented Nov 30, 2024

Same with me on homebrew, rvm and MacOS 15.1.1. Tried all kinds of combinations in the flags for different c++ or icu4c (74, 75, or 76) as well as versions of the gem, but no luck. Am now always met with:

compiling ext.c
compiling transliterator.cpp
make: *** [transliterator.o] Error 1

@dshorthouse
Copy link

Same with me on homebrew, rvm and MacOS 15.1.1. Tried all kinds of combinations in the flags for different c++ or icu4c (74, 75, or 76) as well as versions of the gem, but no luck. Am now always met with:

compiling ext.c
compiling transliterator.cpp
make: *** [transliterator.o] Error 1

In my case, I rebuilt ruby through rvm and it fixed the issue:

rvm reinstall 3.2.1 --with-openssl-dir=/usr/local/opt/openssl

...where the symlinked version of openssl is [email protected]

@samuelvaneck
Copy link
Author

I was able to solve the issue by installing the gem using the following command

export ICU_PATH="/opt/homebrew/opt/icu4c"
gem install charlock_holmes -- --with-icu-dir="$ICU_PATH" --with-cxxflags="-std=c++17"

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