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

Fix build configuration for MSVC #13

Merged
merged 8 commits into from Jun 16, 2021

Conversation

oocytanb
Copy link
Contributor

@oocytanb oocytanb commented Jun 7, 2021

This PR will enable to build on Windows MSVC.

My environment:

  • Windows 10 (x64)
  • Visual Studio 2019

See also related PR

@r9y9
Copy link
Owner

r9y9 commented Jun 10, 2021

Thanks for your great PR! As I posted in r9y9/open_jtalk#3. we'd need some more efforts to get this PR merged. Also, it would be great if we can enable CI for this windows build (not sure If it's possible though; Maybe https://github.com/marketplace/actions/setup-msbuild helps?).

@oocytanb
Copy link
Contributor Author

Thank you for your reply. I see. 👀

@oocytanb
Copy link
Contributor Author

I have made CI configurations.

The merge procedure is as follows:

  1. Merge PR for open_jtalk.

  2. Update "submodule" to point to the latest revision.

  3. Merge this PR.

  4. CI will report the build results for both Linux and Windows.

Copy link
Owner

@r9y9 r9y9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

遅くなってすみません。コメントしました。

setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@oocytanb
Copy link
Contributor Author

レビューありがとうございます!
修正した分を、コミットしました。このような感じで、いかがでしょうか。
追加で、CI を通すために、open_jtalk のサブモジュールの参照先を、最新のリビジョンに更新しました。

Copy link
Owner

@r9y9 r9y9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。問題ないです!CI が通り次第、マージします。

setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
@r9y9 r9y9 merged commit 32df1db into r9y9:master Jun 16, 2021
@oocytanb
Copy link
Contributor Author

レビュー&マージ、大変ありがとうございました!

@oocytanb oocytanb deleted the fix/build_configuration_for_msvc branch June 16, 2021 16:45
@oocytanb oocytanb restored the fix/build_configuration_for_msvc branch June 16, 2021 16:45
@daogework
Copy link

daogework commented Aug 18, 2022

I built failed with Visual Studio 2022

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="dummy" -DPACKAGE="open_jtalk" -DVERSION="1.10" -DCHARSET_UTF_8 -IC:\Users\ADMINI~1\AppData\Local\Temp\pip-build-env-1ft3rqpo\overlay\Lib\site-packages\numpy\core\include -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\jpcommon -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\mecab/src -IH:\secrectFG\pyopenjtalk_msvc\lib\open_jtalk\src\mecab2njd -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\njd -IH:\secrectFG\pyopenjtalk_msvc\lib\open_jtalk\src\njd2jpcommon -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\njd_set_accent_phrase -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\njd_set_accent_type -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\njd_set_digit -IH:\secrectFG\pyopenjtalk_msvc\lib\open_jtalk\src\njd_set_long_vowel -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\njd_set_pronunciation -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\njd_set_unvoiced_vowel -IH:\pyopenjtalk_msvc\lib\open_jtalk\src\text2mecab -IC:\Users\Administrator.conda\envs\py37tf2\include -IC:\Users\Administrator.conda\envs\py37tf2\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tplib\open_jtalk\src\mecab/src\utils.cpp /Fobuild\temp.win-amd64-cpython-37\Release\lib\open_jtalk\src\mecab/src\utils.obj /source-charset:utf-8 /execution-charset:utf-8
utils.cpp
lib\open_jtalk\src\mecab/src\utils.cpp(60): fatal error C1083: 无法打开包括文件: “dirent.h”: No such file or directory
setup.py:26: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
_CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver)
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyopenjtalk
Failed to build pyopenjtalk
ERROR: Could not build wheels for pyopenjtalk, which is required to install pyproject.toml-based projects

My environment:

Windows 10 (x64)
Visual Studio 2022

@oocytanb
Copy link
Contributor Author

In Visual Studio 2022 Developer Command Prompt v17.3.1 (Windows 10 x64)

> cmake --version
cmake version 3.23.22060601-MSVC_2

> cd pyopenjtalk
> pip install -e .

...

Successfully installed colorama-0.4.5 cython-0.29.32 numpy-1.21.6 pyopenjtalk-0.3.0+d4c59cd six-1.16.0 tqdm-4.64.0

CMake will generate lib\open_jtalk\src\mecab\src\config.h as follows

...

/* Define to 1 if you have the <dirent.h> header file. */
/* #undef HAVE_DIRENT_H */

...

@daogework
Copy link

Thank you very, very much for solving my problem

aoirint pushed a commit to aoirint/pyopenjtalk that referenced this pull request Feb 1, 2023
* Workaround the installation issue r9y9#27

Not sure about the exact root cause, but the error messages suggested
that there's issues with setuptools/pip. I can confirm we can fix the
issue by changing the build-time setuptools requirement to <v60.0.

At least v59.8.0 should work.
https://github.com/pypa/setuptools/releases/tag/v59.8.0

* parepare for v0.1.6

* Start a new dev cycle

* Update hts_engine_API

* Update open_jtalk

https://github.com/r9y9/open_jtalk/releases/tag/v1.11.2

* Update version to v0.2.0

* [ci skip] update changelog

* Update pyproject.toml

Co-authored-by: Ryuichi Yamamoto <zryuichi@gmail.com>
@Mo-to Mo-to mentioned this pull request Feb 16, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants