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

MacOS 安装时遇到pyopenjtalk编译失败的解决办法 #413

Open
evpeople opened this issue Feb 6, 2024 · 1 comment
Open

MacOS 安装时遇到pyopenjtalk编译失败的解决办法 #413

evpeople opened this issue Feb 6, 2024 · 1 comment

Comments

@evpeople
Copy link

evpeople commented Feb 6, 2024

问题在于Xcode 15.0按照 C++ 20的标准进行编译,导致代码失败。

解决方法是

首先激活虚拟环境
然后

git clone https://github.com/r9y9/pyopenjtalk/

然后按照这个 PR 修改clone下来的项目中的文件

接着

pip install Cython
pip install numpy 

最后在pyopenjtalk 的根目录使用 python setup.py install

此时pyopenjtalk就安装好了

@SakuraToErii
Copy link

I found that "pip install pyopenjtalk" cannot use the clang installed by homebrew, instead we can use gcc
lib/open_jtalk/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
47 | std::sprintf(s, "%-16f", val);
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
180 | __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
218 | #define __deprecated_msg(_msg) attribute((deprecated(_msg)))
| ^
In file included from lib/open_jtalk/src/mecab/src/char_property.cpp:11:
lib/open_jtalk/src/mecab/src/char_property.h:40:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
40 | register const char *p = begin;
| ^~~~~~~~
1 warning and 1 error generated.
error: command '/opt/homebrew/opt/llvm/bin/clang' failed with exit code 1
[end of output]

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