Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Compiling native extensions with Visual Studio 2012?

Reply
Thread Tools

Compiling native extensions with Visual Studio 2012?

 
 
Alec Taylor
Guest
Posts: n/a
 
      01-12-2013
There have been various threads for MSVC 2010[1][2], but the most
recent thing I found for MSVC 2012 was [3]… from 6 months ago.

Basically I want to be able to compile bcrypt—and yes I should be
using Keccak—x64 binaries on Windows x64.

There are other packages also which I will benefit from, namely I
won't need to use the unofficial setup files and will finally be able
to use virtualenv.

So anyway, can I get an update on the status of MSVC 2010 and MSVC
2012 compatibility?

Thanks,

Alec Taylor

[1] http://bugs.python.org/issue13210
[2] http://webcache.googleusercontent.co...&hl=en&ct=clnk
[3] https://groups.google.com/d/topic/de...on/W1RpFhaOIGk
 
Reply With Quote
 
 
 
 
wcdolphin@gmail.com
Guest
Posts: n/a
 
      02-06-2013
On Saturday, January 12, 2013 2:45:38 AM UTC-5, Alec Taylor wrote:
> There have been various threads for MSVC 2010[1][2], but the most
>
> recent thing I found for MSVC 2012 was [3]… from 6 months ago.
>
>
>
> Basically I want to be able to compile bcrypt—and yes I should be
>
> using Keccak—x64 binaries on Windows x64.
>
>
>
> There are other packages also which I will benefit from, namely I
>
> won't need to use the unofficial setup files and will finally be able
>
> to use virtualenv.
>
>
>
> So anyway, can I get an update on the status of MSVC 2010 and MSVC
>
> 2012 compatibility?
>
>
>
> Thanks,
>
>
>
> Alec Taylor
>
>
>
> [1] http://bugs.python.org/issue13210
>
> [2] http://webcache.googleusercontent.co...&hl=en&ct=clnk
>
> [3] https://groups.google.com/d/topic/de...on/W1RpFhaOIGk


Besides the deep technicality of potential conflicts, two changes will allow you to compile your C extension. msvc9compiler.py is written only lookingfor VS2010, and even if you have vs2010 installed, it will still fail on Windows 7, Windows 8 with silly manifest errors.

The fix is simple:
In: Python27/Lib/distutils/msvc9compiler.py,
line#648 in definition of "link", before the call to "ld_args.append('/MANIFESTFILE:' + temp_manifest)",insert:
ld_args.append('/MANIFEST')

line#178 in the definition of "get_build_version", insert:
return 11.0

 
Reply With Quote
 
 
 
 
wcdolphin@gmail.com
Guest
Posts: n/a
 
      02-06-2013
On Saturday, January 12, 2013 2:45:38 AM UTC-5, Alec Taylor wrote:
> There have been various threads for MSVC 2010[1][2], but the most
>
> recent thing I found for MSVC 2012 was [3]… from 6 months ago.
>
>
>
> Basically I want to be able to compile bcrypt—and yes I should be
>
> using Keccak—x64 binaries on Windows x64.
>
>
>
> There are other packages also which I will benefit from, namely I
>
> won't need to use the unofficial setup files and will finally be able
>
> to use virtualenv.
>
>
>
> So anyway, can I get an update on the status of MSVC 2010 and MSVC
>
> 2012 compatibility?
>
>
>
> Thanks,
>
>
>
> Alec Taylor
>
>
>
> [1] http://bugs.python.org/issue13210
>
> [2] http://webcache.googleusercontent.co...&hl=en&ct=clnk
>
> [3] https://groups.google.com/d/topic/de...on/W1RpFhaOIGk


Besides the deep technicality of potential conflicts, two changes will allow you to compile your C extension. msvc9compiler.py is written only lookingfor VS2010, and even if you have vs2010 installed, it will still fail on Windows 7, Windows 8 with silly manifest errors.

The fix is simple:
In: Python27/Lib/distutils/msvc9compiler.py,
line#648 in definition of "link", before the call to "ld_args.append('/MANIFESTFILE:' + temp_manifest)",insert:
ld_args.append('/MANIFEST')

line#178 in the definition of "get_build_version", insert:
return 11.0

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Compiling native extensions with Visual Studio 2012? Alec Taylor Python 0 01-12-2013 08:30 AM
Should I write Visual studio 2005 or Visual studio 2003 MCSD =?Utf-8?B?VmlqYXk=?= Microsoft Certification 14 06-30-2006 09:05 AM
Is Visual Studio Team System and Visual Studio Foundation Server are same?. Thirumalai ASP .Net 0 05-22-2006 08:48 AM
visual studio .net 2003 verses visual studio .net 2002 wh ASP .Net 2 01-16-2004 04:54 PM



Advertisments