polm / fugashi

A Cython MeCab wrapper for fast, pythonic Japanese tokenization and morphological analysis.
MIT License
389 stars 31 forks source link

Cygwin64 support #6

Closed KoichiYasuoka closed 4 years ago

KoichiYasuoka commented 4 years ago

Hi, I've just tried to pip3.7 install fugashi on Cygwin64 with my mecab-cygwin64, but failed with the error message below:

  gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-3.0.7-x86_64-3.7/fugashi/fugashi.o -L/usr/lib/python3.7/config -L/usr/lib -lmecab -lpython3.7m -o build/lib.cygwin-3.0.7-x86_64-3.7/fugashi.cpython-37m-x86_64-cygwin.dll
  /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmecab

In my Cygwin64, libmecab.a and libmecab.la is at /usr/local/lib and mecab-config --libs-only-L returns /usr/local/lib but fugashi installer does not recognize it. How do I add /usr/local/lib for the library-path?

KoichiYasuoka commented 4 years ago

On the other hand, pip3.7 install git+https://github.com/polm/fugashi works fine on the same Cygwin64, and fugashi is installed perfectly:

Requirement already satisfied: Cython in /usr/lib/python3.7/site-packages (from fugashi==0.1.5) (0.29.6)
Building wheels for collected packages: fugashi
  Building wheel for fugashi (setup.py) ... done

Umm....

polm commented 4 years ago

Thanks for the bug report.

Since this works when installed directly from Github, but not when installing from source via Pypi, and since fugashi doesn't do anything special to the library path, I think this might be a Cygwin issue.

I'll look into this some more, but I'm not used to Cygwin development, so if someone more familiar could check that'd be helpful.

polm commented 4 years ago

I released a new version 1.6 that includes the updated Windows-related changes, could you try installing from pypi again?

KoichiYasuoka commented 4 years ago

Thank you @polm for version 0.1.6. It installs fine with pip3.7 install fugashi==0.1.6 on Cygwin64. Thank you again, and how did you do that?

polm commented 4 years ago

Changes related to Windows packaging were made for the wheel of 1.5 but after the source release, which is why installing from Github but not PyPI worked for you. The new release just includes those changes.

I didn't think that was related at first because it wasn't clear to me how Windows changes would interact with Cygwin.