Windows Boost 1.64 VS2017 missing Python libraries
Windows Boost 1.64 VS2017 missing Python libraries
我试图用VS2017在Windows上构建Boost 1.64。一切都没有错误构建,但是我的输出libs目录缺少某些.lib
和.dll
s。具体来说,我需要的主要缺少库是boost.python。
我最近在建造的尝试看起来像这样,尽管我尝试了许多不同的选项组合:
.b2 --prefix=c:boost --build-dir=boost_build --layout=versioned toolset=msvc-14.1 address-model=64 -j4 --with-python -a --reconfigure --stage-dir=stage --build-type=complete --debug-configuration -d2 stage >build.log 2>&1
,我的构建输出看起来像这样:
notice: found boost-build.jam at C:/boost_1_64_0/boost_1_64_0/boost-build.jam
notice: loading Boost.Build from C:/boost_1_64_0/boost_1_64_0/tools/build/src
notice: Searching 'C:Windows' 'C:Userstsanders' 'C:Userstsanders' 'C:boost_1_64_0boost_1_64_0tools/build/src' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/kernel' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/util' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/build' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/tools' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/contrib' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/.' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in 'C:Windows' 'C:Userstsanders' 'C:Userstsanders' 'C:boost_1_64_0boost_1_64_0tools/build/src' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/kernel' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/util' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/build' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/tools' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/contrib' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/.'.
notice: Searching 'C:Userstsanders' 'C:Userstsanders' 'C:boost_1_64_0boost_1_64_0tools/build/src' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/kernel' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/util' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/build' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/tools' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/contrib' 'C:/boost_1_64_0/boost_1_64_0/tools/build/src/.' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from 'C:/Users/tsanders'.
notice: [python-cfg] Configuring python...
notice: [python-cfg] user-specified cmd-or-prefix: "C:Miniconda2python.exe"
notice: [python-cfg] user-specified includes: "C:Miniconda2include"
notice: [python-cfg] user-specified libraries: "C:Miniconda2libs"
notice: [python-cfg] Checking interpreter command "C:Miniconda2python.exe"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:Miniconda2python.exe" 2>&1'
notice: [python-cfg] running command 'C:Miniconda2python.exe -c "from sys import *; print('version=%d.%dnplatform=%snprefix=%snexec_prefix=%snexecutable=%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:Miniconda2python.exe"
notice: [python-cfg] include path: "C:Miniconda2include"
notice: [python-cfg] library path: "C:Miniconda2libs"
notice: [python-cfg] DLL search path: "C:Miniconda2"
notice: [python-cfg] Checking for NumPy...
notice: [python-cfg] running command 'C:Miniconda2python.exe -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
notice: [python-cfg] NumPy enabled
notice: Searching '.' for project-config configuration file 'project-config.jam'.
notice: Loading project-config configuration file 'project-config.jam' from '.'.
notice: [msvc-cfg] msvc-14.0 detected, command: 'C:Program Files (x86)Microsoft Visual Studio 14.0VCbincl.exe'
notice: [msvc-cfg] msvc-12.0 detected, command: 'C:Program Files (x86)Microsoft Visual Studio 12.0VCbincl.exe'
notice: [msvc-cfg] msvc-11.0 detected, command: 'C:Program Files (x86)Microsoft Visual Studio 11.0VCbincl.exe'
notice: [msvc-cfg] msvc-14.1 detected, command: 'C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.10.25017binHostX64x64cl.exe'
notice: will use 'C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.10.25017binHostX64x64cl.exe' for msvc, condition <toolset>msvc-14.1
'notice: [generate-setup-cmd] 14.10.25017 is 14.1'
'notice: [generate-setup-cmd] 14.10.25017 is 14.1'
'notice: [generate-setup-cmd] 14.10.25017 is 14.1'
'notice: [generate-setup-cmd] 14.10.25017 is 14.1'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>/<address-model>', setup: 'call "C:UserstsandersAppDataLocalTempb2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>/<address-model>32', setup: 'call "C:UserstsandersAppDataLocalTempb2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>x86/<address-model>', setup: 'call "C:UserstsandersAppDataLocalTempb2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>x86/<address-model>32', setup: 'call "C:UserstsandersAppDataLocalTempb2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>/<address-model>64', setup: 'call "C:UserstsandersAppDataLocalTempb2_msvc_14.10.25017_vcvarsx86_amd64_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>x86/<address-model>64', setup: 'call "C:UserstsandersAppDataLocalTempb2_msvc_14.10.25017_vcvarsx86_amd64_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>ia64/<address-model>', setup: 'call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>ia64/<address-model>64', setup: 'call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>arm/<address-model>', setup: 'call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>arm/<address-model>32', setup: 'call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" >nul
'
notice: [zlib] Using pre-installed library
notice: [zlib] Condition
notice: [bzip2] Using pre-installed library
notice: [bzip2] Condition
Performing configuration checks
- 32-bit : yes
- arm : no
- mips1 : no
- power : no
- sparc : no
- x86 : yes
- symlinks supported : yes
Component configuration:
- atomic : not building
- chrono : not building
- container : not building
- context : not building
- coroutine : not building
- coroutine2 : not building
- date_time : not building
- exception : not building
- fiber : not building
- filesystem : not building
- graph : not building
- graph_parallel : not building
- iostreams : not building
- locale : not building
- log : not building
- math : not building
- metaparse : not building
- mpi : not building
- program_options : not building
- python : building
- random : not building
- regex : not building
- serialization : not building
- signals : not building
- system : not building
- test : not building
- thread : not building
- timer : not building
- type_erasure : not building
- wave : not building
...found 1 target...
要注意的事情:
- 我使用Miniconda而不是传统的Python安装。可能是一个问题,尽管
--debug-configuration
的输出似乎表明它正确找到了所有内容。 - 添加了一些调试消息后,我发现它发现的
1 target
是all
目标。我看不到boost.python来源的任何形式的构建输出,就像我看到是否构建了其他库。 - 添加额外的调试输出并不特别有用;即使有最大的调试输出,我也找不到与Python有关的任何错误或警告。
- 我还尝试从boost.python QuickStart开始,该QuickStart成功编译但无法链接,因为它找不到
boost_python.dll
。(尽管从技术上讲我认为应该寻找boost_python-vc141-mt-1_64.dll
之类的东西...(
我尝试了bootstrap.bat
(例如--with-libraries=python
,--with-python=C:Miniconda2python.exe
,--with-python-root=C:Miniconda2
(和b2.exe
的多种选项组合,但似乎没有任何区别。
如果我下载了预编译boost_python
库,并将它们与我构建的其余库一起放置,则我的项目将按预期构建和运行。 我自己构建Python库是我唯一仍然陷入困境的东西。
我知道我并不孤单。我用reddit线程发布了这个问题,另一个用户提到他也有同样的问题。不幸的是,他的解决方案是"最终击中Bootstrap和B2的正确选择"。
是否有人遇到过这样的问题?
我最终将其追溯到我的user-config.jam
,我的Python版本未指定。
最初,我有此配置:
using python
: # version
: C:\Miniconda2\python.exe
: C:\Miniconda2\include
: C:\Miniconda2\libs
;
该文档似乎表明"离开版本"是空的。我认为一个空版本应该是指"默认版本"或"所有版本"。但是,这导致Boost默默跳过构建Python库。
明确指定Python版本时,一切都按预期建立了:
using python
: 2.7 # version
: C:\Miniconda2\python.exe # interpreter
: C:\Miniconda2\include # include dir
: C:\Miniconda2\libs # library dir
;
构建python boost 1.64 libs with Visual Studio似乎被打破了。
替换<boost_root>/libs/python/build/Jamfile
。
我是这样构建的:
wget.exe https://dl.dropboxusercontent.com/u/59547297/Libraries/boost_1_64_0.zip -OC:thirdpartyvs2015x64boost_1_64_0.zip
7za.exe x C:thirdpartyvs2015x64boost_1_64_0.zip -oC:thirdpartyvs2015x64
xcopy /y boost_1_64_0Jamfile C:thirdpartyvs2015x64boost_1_64_0libspythonbuildJamfile
del C:thirdpartyvs2015x64boost_1_64_0.zip
call "C:Program Files (x86)Microsoft Visual Studio 14.0VCvcvarsall.bat" amd64
C:
cd C:thirdpartyvs2015x64boost_1_64_0
call bootstrap.bat
b2 --toolset=msvc-14.0 address-model=64 --build-type=complete stage -j 8
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- Pybind11:将元组列表从Python传递到C++
- 如何在c++中使用引用实现类似python的行为
- 是否可以通过C++扩展强制多个python进程共享同一内存
- 递归列出所有目录中的C++与Python与Ruby的性能
- IPC使用多个管道和分支进程来运行Python程序
- 从python中调用C++函数并获取返回值
- Python 3.7 和 excess_args 的 SWIG 问题
- Python中的for循环与C++有何不同
- 使用Pybind11向Python公开Eigen::张量
- Python str to C++ to Python str
- 如何使用Python从C++中读取谷物序列化数据
- 如何在C++中使用pybind11加载一个pickle python列表
- 如何在c++中使用system()来运行包含空格的python脚本
- python集合的C++等价物是什么.计数器
- 如果C++对象的类在另一个boost模块中声明,如何使用boost将指向该对象的指针返回到python
- 从python调用openMP共享库时,未定义opnMP函数
- 使用JsonCpp将数据返回到带有pybind11的python会在python调用中产生Symbol not foun
- 如何将真正的字符串从python c-api转换为python脚本
- Windows Boost 1.64 VS2017 missing Python libraries