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

Compiling on Windows 64 bit and Python 3 #63

Open
rossant opened this issue Jun 29, 2015 · 13 comments
Open

Compiling on Windows 64 bit and Python 3 #63

rossant opened this issue Jun 29, 2015 · 13 comments

Comments

@rossant
Copy link
Member

rossant commented Jun 29, 2015

Hi @thesamovar
have you ever succeeded in compiling KK2 on Windows 64 bit and Python 3? I tried with no success..

@thesamovar
Copy link
Contributor

I haven't tried because I run Python 2.x only. What happened when you tried?

@rossant
Copy link
Member Author

rossant commented Jun 29, 2015

The classic errors on windows: unable to find vcvarsall, or some bug in cygwincompiler.py, etc etc. I tried many things with the Visual Studio compilers. Using mingw64 is not possible apparently.

At some point we should resolve this on a dedicated build machine and ship binstar binaries so that no one else needs to do the compilation!

@thesamovar
Copy link
Contributor

Oh there's a fix for this that we're using in Brian 2 but I don't remember what it is exactly. @mstimberg? I think it's just something like you have to import setuptools before distutils or something.

@mstimberg
Copy link

Yes, we compile C extensions for Python 3 on Windows 64 Bit with MSCV 10/SDK 7.1 on appveyor. I think it also works with the "C++ for Python" compiler, but I'd have to check that again (I'm sure it works for Python 2, but I did less testing for Python 3). The trick is indeed to import setuptools (a fairly recent version, but everything >=6 should work, I think) in the beginning, it will monkey-patch distutils and then things work.

@nippoo
Copy link
Contributor

nippoo commented Jul 2, 2015

@mstimberg have you got this working with MSVC 2010 Express Edition? Or do I need to get hold of the full edition?

@mstimberg
Copy link

I think all that is needed is the SDK 7.1, I don't have any full MSVC compiler on my (virtual) Windows machine. The tricky bit is that you have to set up the environment in the right way. We do this in a script on appveyor, it is a copy from this repository: https://github.com/ogrisel/python-appveyor-demo The relevant bits are here: https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor/run_with_env.cmd#L35
The necessary steps are also described here: https://github.com/cython/cython/wiki/CythonExtensionsOnWindows#using-windows-sdk-cc-compiler-older-method

@mstimberg
Copy link

I'm actually not that sure anymore that the monkeypatching by setuptools is necessary here, maybe it was only necessary for the C++ for Python 2.7 compiler.

@nippoo
Copy link
Contributor

nippoo commented Jul 2, 2015

I've managed to get it to build (python 3.4, 64-bit) by installing VS2010 (full edition, express only has 32-bit). Now I'm trying to build a binstar package but I guess something to do with the monkey-patching is failing...

  File "C:\Users\Max\Miniconda\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\Max\\Miniconda\\Scripts\\pa
tch.exe', '-p0', '-i', 'c:\\users\\max\\appdata\\local\\temp\\tmpqu71m7conda_ske
leton_klustakwik2-0.2.2.tar.bz2\\pypi-distutils.patch']' returned non-zero exit
status 2

We'll get there... slowly!

@mstimberg have you had any experience with binstar packages?

@rossant
Copy link
Member Author

rossant commented Jul 2, 2015

would it be simpler to use wheels and pip?

@nippoo
Copy link
Contributor

nippoo commented Jul 2, 2015

hey I've solved this previous issue - turns out there was an issue with conda's version of patch. I built it from source.

Then tried to file an issue and discovered it was already filed - a year ago :(

conda/conda-build#119

@nippoo
Copy link
Contributor

nippoo commented Jul 2, 2015

boom - now it's all done https://binstar.org/kwikteam/klustakwik2 (for win64 python 2.7 / python 3.3 / python 3.4 only - other platforms coming at some point)

@thesamovar
Copy link
Contributor

Nice work! Will look in more detail soon.

On 2 July 2015 23:49:40 BST, nippoo notifications@github.com wrote:

boom - now it's all done https://binstar.org/kwikteam/klustakwik2 (for
win64 python 2.7 / python 3.3 / python 3.4 only - other platforms
coming at some point)


Reply to this email directly or view it on GitHub:
#63 (comment)

@rossant
Copy link
Member Author

rossant commented Jul 1, 2016

@nippoo could you tell me how you built the conda packages? I'd like to update newer releases on anaconda cloud (Python 3.5 etc). I now have a Windows setup that can build Python packages on Py 2.7 and Py 3.5 (I have Visual C++ 2015 installed for the latter).

I also uploaded Windows wheels on PyPI so I think pip install klustakwik2 might just work on Windows?

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

No branches or pull requests

4 participants