Compiling native extensions with Visual Studio 2012?

Discussion in 'Python' started by Alec Taylor, Jan 12, 2013.

  1. Alec Taylor

    Alec Taylor Guest

    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.c...ki.python.org/moin/VS2010 &cd=1&hl=en&ct=clnk
    [3] https://groups.google.com/d/topic/dev-python/W1RpFhaOIGk
    Alec Taylor, Jan 12, 2013
    #1
    1. Advertising

  2. Alec Taylor

    Guest

    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.c...ki.python.org/moin/VS2010 &cd=1&hl=en&ct=clnk
    >
    > [3] https://groups.google.com/d/topic/dev-python/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
    , Feb 6, 2013
    #2
    1. Advertising

  3. Alec Taylor

    Guest

    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.c...ki.python.org/moin/VS2010 &cd=1&hl=en&ct=clnk
    >
    > [3] https://groups.google.com/d/topic/dev-python/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
    , Feb 6, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hkaiser
    Replies:
    3
    Views:
    568
    Ebenezer
    Jan 13, 2012
  2. Gina- Microsoft
    Replies:
    3
    Views:
    441
    Öö Tiib
    Sep 9, 2012
  3. Lynn McGuire
    Replies:
    7
    Views:
    659
    Jorgen Grahn
    Nov 6, 2012
  4. Saeed Amrollahi
    Replies:
    4
    Views:
    884
    Saeed Amrollahi
    Dec 23, 2012
  5. Alec Taylor
    Replies:
    0
    Views:
    212
    Alec Taylor
    Jan 12, 2013
Loading...

Share This Page