Reputation: 2764
I'm trying to build on windows 8.1 a Python3.42 64bit extension module that uses C++11 features. The module builds correctly in linux and MacOs using gcc or clang.
On windows I have installed visual studio 2010 express and windows sdk 7.1 (to have the x64 compiler which apparently is missing in VS2010 express). I've been able to build part of the extension but there are errors for some C++11 features that are not available in VS2010. I could modify the extension code to avoid using these C++11 features but we have more extensions with C++11 features and I'm the only one using windows in my team... so that's not a viable option. I would prefer to get it build as it is.
So the question is. How can I build python 3 extensions on windows using a compiler version of VS that has more complete C++11 implementation, such as VS2012 or preferably VS2013?
Upvotes: 1
Views: 247
Reputation: 2764
Well, I'll answer myself this question.
I guess that the solution is to use vs2012 or vs2013 to build the extension. In this case I would need to rebuild the python interpreter with vs2012 or vs2013. I have found this page where it explains how: http://p-nand-q.com/python/building-python-33-with-vs2013.html it's nice that you can download the vs2013 built python binaries from this page. However, following that route means I would have to build with vs2013 every non-pure python extension I may need, which can be a few as I'm mostly doing research rather than production and I don't know what extensions I may be needing. Building numpy and scipy it's not trivial, and they seem to require a fortran compiler to build them. I guess this is the conclusion I wanted to avoid arriving to, I was hoping for some trick to avoid it.
At the end I opted for modifying the C++11 parts of the code so that it could build with vs2010, it's not nice but I think I'll avoid a lot of future problems building every extension I may need. I can just download the windows binaries from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/
I guess another solution is to develop in linux or MacOs.
Upvotes: 1