Fix python bindings compilation on Windows #19
Comments
Related - http://stackoverflow.com/questions/13328180/installing-cld-libary-on-windows-and-bind-to-python Im having some problems getting this up and running on Windows. I have got as far as 5, but not entirely sure on the steps involved in your hack. Can you elaborate? (im a rookie at python, but keen to learn) |
@Jakc Huh, sorry, missed your post. Step 5 is to edit setup.py and replace the whole pkgconfig function with simply just this:
@mzsanford OK, I'll follow up with the patch, I just don't have it handy at the moment. |
Also, for posterity, CLD is now included in the absolutely wonderful Unofficial Windows Binaries for Python Extension Packages list: http://www.lfd.uci.edu/~gohlke/pythonlibs/ |
Fixing up old projects and made the requested change in the issue_19_python_windows branch (SHA: 5a29fd5). Can you try that out and let me know if it works? |
Thanks for the fix, Matt. I'm sorry to say I don't have that dev environment set up any more. It would take quite some effort and time to get everything to the point where I can test it, so I'll leave it be right now. |
Merged it in |
Thanks for the nice repackaging. It still needs some work on Windows though. To compile:
The hackish solution to (5) is to make pkgconfig return (on Windows only) the dict
{'define_macros': [('WIN32',None)], 'libraries': packages}
Why the hack is necessary: On windows, pkg-config is not available by default. If you get it, it depends on a dll. If you get that one as well, it doesn't find the cld.pc file. If you copy it over, it returns the nonsensical (for MSVC) value "-I/usr/local/include/cld -L/usr/local/lib/cld -lcld". It also fails to define WIN32, without which the whole thing does not compile.
Do you prefer getting a pull request or making the changes yourself? Thanks.
The text was updated successfully, but these errors were encountered: