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

Fails to compile on windows. #13

Closed
damnMeddlingKid opened this issue Jan 29, 2015 · 7 comments
Closed

Fails to compile on windows. #13

damnMeddlingKid opened this issue Jan 29, 2015 · 7 comments

Comments

@damnMeddlingKid
Copy link

Tried compiling this using pip install from the visual studio 2010 and 2013 commmand prompts but it fails due to a redefinition error from Murmurhash3.h
https://msdn.microsoft.com/en-us/library/x7t11wke.aspx

@honnibal
Copy link
Member

Thanks for bringing this here. I'll summarize what I said out-of-band in case anyone else can help.

  • I'd like to support Windows
  • Have no access to Windows box
  • No experience running a compiler on Windows

The MurmurHash headers are being installed from here: https://github.com/syllog1sm/headers_workaround . I created this to install headers via pip, as a workaround to a bug in setuptools.

If the problem is indeed with MurmurHash headers, we can either patch the files directly, or we can fork the files and decide which to install in headers_workaround.

To verify that the problem is here, you can try installing any of these packages, either over pip or by cloning their repo and building:

  • cymem: Cython, but no MurmurHash or C headers. We expect success.
  • preshed: Cython, with MurmurHash. We expect fail
  • preshed: Cython, with MurmurHash. We expect fail

@honnibal
Copy link
Member

A user on reddit writes:

Just an FYI because I see that you hope to support Windows and I managed to hack my way through to a 64bit Python 2.7.9 Windows build. Not especially elegant but here's what seems to have worked for me: - Installed Microsoft Visual C++ Compiler for Python 2.7; - Copied stdint.h from a mingw include folder over to the Visual C++ include folder; - Commented out the uint32_t and uint64_t typedefs in stdint.h; - Added the uint32_t and uint64_t typedefs to the various .cpp files in thinc, preshed, and spacy that used them in declarations(~ spacy\morphology.cpp spacy\en\attrs.cpp spacy\syntax\arc_eager.cpp thinc\weights.cpp thinc\search.cpp tests\c_test_search.cpp preshed\maps.c preshed\counter.c murmurhash\mrmr.cpp? ); - python setup.py install for thinc, preshed, spacy respectively.
I have reproduced the example usage etc. with this build.

You can try the work-around above for now, but in future it looks like proper Windows support won't be too difficult.

@maxirmx
Copy link
Contributor

maxirmx commented Oct 9, 2015

This happens because MSVC is not C99 compatible prior to 2010 version.
There is a version of stdin.h for MSVC that was properly maintained : http://msinttypes.googlecode.com/svn/trunk/stdint.h

@maxirmx
Copy link
Contributor

maxirmx commented Oct 9, 2015

This issue requires a change to headers_workaround -- available at https://github.com/maxirmx/headers_workaround for now.

Please pay attention to README-MSVC.txt

@honnibal
Copy link
Member

All builds now pass.

@henningpeters
Copy link
Contributor

Update: We are now shipping stdint.h together with spaCy, see https://github.com/spacy-io/spaCy/tree/master/include/msvc9.

@lock
Copy link

lock bot commented May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants