src-d / wmd-relax

Calculates Word Mover's Distance Insanely Fast
Other
460 stars 79 forks source link

Windows installation issue #8

Open nsriram13 opened 7 years ago

nsriram13 commented 7 years ago

Trying to use pip install wmd in Windows 10. I am using MSVC to compile from source. I have reproduced the log below. Can you please help troubleshoot?

 c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(82): error C2146: syntax error: missing ')' before identifier 'in'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(82): error C2988: unrecognizable template declaration/definition
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(82): error C2059: syntax error: 'in'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(83): error C2059: syntax error: ')'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(117): error C2143: syntax error: missing ';' before '{'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(117): error C2447: '{': missing function header (old-style formal list?)
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(118): error C3001: 'simd': expected an OpenMP directive name
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(125): error C3001: 'simd': expected an OpenMP directive name
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(148): error C2146: syntax error: missing ')' before identifier 'w1'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(148): error C3646: 'w1': unknown override specifier
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(148): error C2988: unrecognizable template declaration/definition
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(148): error C2059: syntax error: ','
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd.h(149): error C2059: syntax error: ')'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd_relaxed.h(9): error C2143: syntax error: missing ';' before '{'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd_relaxed.h(9): error C2447: '{': missing function header (old-style formal list?)
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd_relaxed.h(46): error C2146: syntax error: missing ')' before identifier 'w1'
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd_relaxed.h(46): error C3646: 'w1': unknown override specifier
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd_relaxed.h(46): error C2988: unrecognizable template declaration/definition
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd_relaxed.h(46): error C2059: syntax error: ','
    c:\users\36996\appdata\local\temp\pip-build-8hj30bdc\wmd\emd_relaxed.h(48): error C2059: syntax error: ')'
    python.cc(34): error C2065: 'py_emd_relaxed': undeclared identifier
    python.cc(36): error C2065: 'py_emd_relaxed_cache_init': undeclared identifier
    python.cc(38): error C2065: 'py_emd_relaxed_cache_fini': undeclared identifier
    python.cc(40): error C2065: 'py_emd': undeclared identifier
    python.cc(42): error C2065: 'py_emd_cache_init': undeclared identifier
    python.cc(44): error C2065: 'py_emd_cache_fini': undeclared identifier
    python.cc(54): error C2065: 'module_docstring': undeclared identifier
    python.cc(201): error C2672: 'emd_entry': no matching overloaded function found
    python.cc(201): error C2784: 'PyObject *emd_entry(PyObject *,PyObject *,PyObject *,float (__cdecl *)(const float *,const float *,const float *,uint32_t,const C &))': could not deduce template argument for 'float (__cdecl *)(const float *,const float *,const float *,uint32_t,const C &)' from 'overloaded-function'
    python.cc(94): note: see declaration of 'emd_entry'
    python.cc(205): error C2672: 'emd_entry': no matching overloaded function found
    python.cc(205): error C2784: 'PyObject *emd_entry(PyObject *,PyObject *,PyObject *,float (__cdecl *)(const float *,const float *,const float *,uint32_t,const C &))': could not deduce template argument for 'float (__cdecl *)(const float *,const float *,const float *,uint32_t,const C &)' from 'overloaded-function'
    python.cc(94): note: see declaration of 'emd_entry'
    python.cc(209): error C2065: 'EMDRelaxedCache': undeclared identifier
    python.cc(209): error C2672: 'cache_init': no matching overloaded function found
    python.cc(209): error C2974: 'cache_init': invalid template argument for 'C', type expected
    python.cc(180): note: see declaration of 'cache_init'
    python.cc(213): error C2065: 'EMDRelaxedCache': undeclared identifier
    python.cc(213): error C2672: 'cache_fini': no matching overloaded function found
    python.cc(213): error C2974: 'cache_fini': invalid template argument for 'C', type expected
    python.cc(191): note: see declaration of 'cache_fini'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
vmarkovtsev commented 7 years ago

I am afraid python 2.7 and older are not supported, only 3.4+. Besides, looks like an outdated pip... What's its version?

nsriram13 commented 7 years ago

Output of pip --version pip 9.0.1 from c:\program files\anaconda3\lib\site-packages (python 3.5)

I have defaulted my PYTHONPATH to Python 3.

vmarkovtsev commented 7 years ago

I cannot reproduce it on a test win10 machine... Looks like the compilation went terribly wrong. What's your c++ compiler version?

vmarkovtsev commented 7 years ago

Probably it has smth to do with anaconda environment, it is not supported (and never will be, officially).

nsriram13 commented 7 years ago

Hmm... I am using Visual Studio 2015. So I think it is Visual C++ 14.0 compiler. I will try my hand at building it using MinGW using the cmake approach you have outlined in the docs. Fingers crossed it'll work - if not I will default to a non conda version. Thanks!

xiaojieliu7 commented 6 years ago

have you sloved this problem?

vmarkovtsev commented 6 years ago

No, unfortunately not. I am not using Windows. PRs and fixes welcome.

m-piccolino commented 6 years ago

@nsriram13 did you manage to get this working somehow?

nsriram13 commented 5 years ago

@m-piccolino - Sorry - do not have any updates on this. I switched to using Linux after running into similar build issues for other packages.

martech-engineer commented 5 years ago

Did someone solve the problem for Windows?

hsuanju commented 5 years ago

Did someone solve the problem for Windows?

got same problem...

mansiganatra commented 5 years ago

Did someone solve the problem for Windows?

Facing the same issue

obbrc commented 5 years ago

Please see https://github.com/src-d/wmd-relax/issues/61 for how to compile in windows.

Giorg4 commented 3 years ago

Did someone solve the problem for Windows?

caidingbei commented 2 years ago

I have the same problem. Has anyone solved it?