在Windows 10 TP编译VS-2015 CTP 5和Python 3.5A升压蟒蛇教程 [英] Compile boost-python tutorial with VS-2015 CTP 5 and Python 3.5a on Windows 10 TP

查看:477
本文介绍了在Windows 10 TP编译VS-2015 CTP 5和Python 3.5A升压蟒蛇教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得的升压Python扩展模块教程在Windows 10上的现代C ++编译器14的工作,我用vc-14(VS 2015下载提升1.57和python 3.5A源的最新版本CTP 5)。

I'm trying to get the boost-python extension module tutorial working on a modern C++14 compiler in Windows 10. I've downloaded the latest versions of boost 1.57 and python 3.5a source using vc-14 (VS 2015 CTP 5).

我使用VS 2015年CTP 5和这些指令编译从源代码蟒蛇: 1.1.3.3。窗户

I compiled python from source using VS 2015 CTP 5 and these instructions: 1.1.3.3. Windows.

我已经运行命令

.\bootstrap.bat && .\b2 stage toolset=msvc --with-python

从升压项目文件夹C:\\提振

from the boost project folder c:\boost

这是我的主目录用户config.jam中的文件:

This is the user-config.jam file in my home directory:

using msvc : 14.0 : C:\\Program\ Files\ (x86)\\Microsoft\ Visual\ Studio\ 14.0\\VC\\bin\\cl.exe ;

using python                                                                                     
        : 3.5                                        # Version                                                            
        : C:\\python35a3\\PCBuild\\win32\\python.exe # Python Path                              
        : C:\\python35a3\\include                    # include path                                   
        : C:\\python35a3\\libs                       # lib path                                       
        : <define>BOOST_ALL_NO_LIB=1                                                                 
        ;  

在不兼容教程目录结果创建PDB文件时运行的bjam:

Running bjam in the tutorial directory results in an incompatibility when creating the pdb file:

    c:\boost\libs\python\example\tutorial>bjam --debug-configuration
        notice: found boost-build.jam at C:/boost/libs/python/example/tutorial/boost-build.jam
        notice: loading Boost.Build from C:/boost/tools/build/src
    ....
        notice: Loading user-config configuration file 'user-config.jam' from 'C:/Users/marcel'.
        notice: [msvc-cfg] msvc-14.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe'
        notice: [msvc-cfg] msvc-12.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe'
        notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-14.0
        notice: [msvc-cfg] condition: '<toolset>msvc-14.0/<architecture>/<address-model>', setup: 'call "C:\Users\marcel\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" >nul
        '
        notice: [msvc-cfg] condition: '<toolset>msvc-14.0/<architecture>/<address-model>32', setup: 'call "C:\Users\marcel\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" >nul
        '
        notice: [msvc-cfg] condition: '<toolset>msvc-14.0/<architecture>x86/<address-model>', setup: 'call "C:\Users\marcel\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" >nul
        '
        notice: [msvc-cfg] condition: '<toolset>msvc-14.0/<architecture>x86/<address-model>32', setup: 'call "C:\Users\marcel\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" >nul
        '
        notice: [python-cfg] Configuring python...
        notice: [python-cfg]   user-specified version: "3.5"
        notice: [python-cfg]   user-specified cmd-or-prefix: "C:\python35a3\PCBuild\amd64\python_d.exe"
        notice: [python-cfg]   user-specified includes: "C:\python35a3\include"
        notice: [python-cfg]   user-specified libraries: "C:\python35a3\libs"
        notice: [python-cfg]   user-specified condition: "<define>BOOST_ALL_NO_LIB=1"
        notice: [python-cfg] Checking interpreter command "C:\python35a3\PCBuild\amd64\python_d.exe"...
        notice: [python-cfg] running command 'DIR /-C /A:S "C:\Python35a3\PCbuild\amd64\python_d.exe" 2>&1'
        notice: [python-cfg] running command 'C:\python35a3\PCBuild\amd64\python_d.exe -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
        notice: [python-cfg] ...requested configuration matched!
        notice: [python-cfg] Details of this Python configuration:
        notice: [python-cfg]   interpreter command: "C:\python35a3\PCBuild\amd64\python_d.exe"
        notice: [python-cfg]   include path: "C:\python35a3\include"
        notice: [python-cfg]   library path: "C:\python35a3\libs"
        notice: [python-cfg]   DLL search path: "C:\python35a3"
        notice: Searching '../../../..' for project-config configuration file 'project-config.jam'.
        notice: Loading project-config configuration file 'project-config.jam' from '../../../..'.
    ....
        ...patience...
        ...patience...
        ...found 1893 targets...
        ...updating 6 targets...
        msvc.link.dll bin\msvc-14.0\debug\threading-multi\hello_ext.dll
           Creating library bin\msvc-14.0\debug\threading-multi\hello_ext.pdb and object bin\msvc-14.0\debug\threading-multi\hello_ext.exp
        LINK : fatal error LNK1207: incompatible PDB format in 'c:\boost\libs\python\example\tutorial\bin\msvc-14.0\debug\threading-multi\hello_ext.pdb'; delete and rebuild

    ....

    ...removing bin\hello.test\msvc-14.0\debug\threading-multi\hello.py
    ...skipped <pbin\hello.test\msvc-14.0\debug\threading-multi>hello for lack of <pbin\hello.test\msvc-14.0\debug\threading-multi>hello.py...
    ...failed updating 3 targets...
    ...skipped 3 targets...

产生错误输出的命令是:

The command producing the error output is:

call "C:\Users\marcel\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" >nul

link /NOLOGO /INCREMENTAL:NO /DLL /NOENTRY /DEBUG /MACHINE:X86 /MANIFEST /subsystem:console /out:"bin\msvc-14.0\debug\threading-multi\hello_ext.dll" /IMPLIB:"bin\msvc-14.0\debug\threading-multi\hello_ext.pdb" /LIBPATH:"C:\python35a3\libs"   @"bin\msvc-14.0\debug\threading-multi\hello_ext.dll.rsp"

Creating library bin\msvc-14.0\debug\threading-multi\hello_ext.pdb and object bin\msvc-14.0\debug\threading-multi\hello_ext.exp
LINK : fatal error LNK1207: incompatible PDB format in 'c:\boost\libs\python\example\tutorial\bin\msvc-14.0\debug\threading-multi\hello_ext.pdb'; delete and rebuild

链接命令似乎与方式Python和升压一致编译(32位在相同的编译器版本)。

The link command seems to be consistent with the way python and boost are compiled (32 bit on the same compiler version).

有诊断这哪里起源的错误的方式?

Is there an way to diagnose where this error originated?

更新:与VC9(VS2010)和prebuilt蟒蛇3.4安装编译。我仍然得到了同样的错误:

UPDATE: Compiling with VC9 (VS2010) and a prebuilt python 3.4 installation. I still get the same error:

link /NOLOGO /INCREMENTAL:NO /DLL /NOENTRY /DEBUG /MACHINE:X86 /MANIFEST /subsystem:console /out:"bin\msvc-10.0\debug\threading-multi\hello_ext.pyd" /IMPLIB:"bin\msvc-10.0\debug\threading-multi\hello_ext.pdb" /LIBPATH:"C:\python34\libs"   @"bin\msvc-10.0\debug\threading-multi\hello_ext.pyd.rsp"

Creating library bin\msvc-10.0\debug\threading-multi\hello_ext.pdb and object bin\msvc-10.0\debug\threading-multi\hello_ext.exp

LINK : fatal error LNK1207: incompatible PDB format in 'c:\boost\libs\python\example\tutorial\bin\msvc-10.0\debug\threading-multi\hello_ext.pdb'; delete and rebuild

运行蟒间preTER以确认正确的编译器的版本:

Running the python interpreter to confirm the correct compiler version:

c:\Python34\python.exe
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

显然,这个错误无关的构建正在运行环境的前沿性。而其升压构建配置问题的一个直接结果。

Apparently this error has nothing to do with the "bleeding edge-ness" of the environment the build is running on. Rather its a direct result of a boost-build configuration issue.

更新2:试图用pre-内置的Python 2.7和VS 2008的结果相同的错误相同的测试。

UPDATE 2: Trying the same test with pre-built Python 2.7 and VS 2008 results in the same error.

更新3 解决:此建立正确的提振v1.55采取以下步骤时:

UPDATE 3 SOLVED This builds correctly on boost v1.55 when the following steps are taken:


  • 下载并构建Python 3.5 A3和建设提升1.55 VC14
    修改用户文件config.jam中在主目录并运行
    的bjam阶段--use-蟒蛇

  • 从移动舞台\\ lib中产生的文件
    libboost *提振*从教程目录中运行的bjam

  • 加入以下LIBPATH开关更改错误的链接命令:
    / LIBPATH:C:\\ boost_1_55_0 \\阶段\\ lib中

链接到Python 3.5素α3与VC14被隔离,以提高v1.57的问题的基础之上。

The problem of linking to python 3.5 alpha3 with VC14 is isolated to boost v1.57 builds.

推荐答案

这个问题似乎已经与1.56介绍。我已经成功地得到Boost.Build通过编辑文件再次合作:

The problem seems to have been introduced with 1.56. I've managed to get Boost.Build working again by editing the file:

D:\boost\boost_1_59_0\tools\build\src\tools\msvc.jam

我做了两个变化:

I made two changes:


  1. 更​​改此设置(线#1351-1355):

  1. Change this (lines #1351-1355):

     generators.register [ new msvc-linking-generator msvc.link.dll :
         OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB :
         <toolset>msvc <suppress-import-lib>false ] ;
     generators.register [ new msvc-linking-generator msvc.link.dll :
         OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB :
         <toolset>msvc <suppress-import-lib>true ] ;

    generators.register [ new msvc-linking-generator msvc.link.dll :
        OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB :
        <toolset>msvc ] ;


  • 删除这一行(#1472):

  • Remove this line (#1472):

        toolset.flags msvc.link.dll LINKFLAGS <suppress-import-lib>true : /NOENTRY ;
    


  • 我曾与VS2012和Python 2.7测试了这个Win7上。

    I've tested this on Win7 with VS2012 and Python 2.7.

    这篇关于在Windows 10 TP编译VS-2015 CTP 5和Python 3.5A升压蟒蛇教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆