[英]Windows Boost 1.64 VS2017 missing Python libraries
我正在嘗試使用VS2017在Windows上構建Boost 1.64。 一切都沒有錯誤,但我的輸出libs目錄缺少一些.lib
和.dll
。 具體來說,我需要的主要缺失庫是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:\Users\tsanders' 'C:\Users\tsanders' 'C:\boost_1_64_0\boost_1_64_0\tools/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:\Users\tsanders' 'C:\Users\tsanders' 'C:\boost_1_64_0\boost_1_64_0\tools/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:\Users\tsanders' 'C:\Users\tsanders' 'C:\boost_1_64_0\boost_1_64_0\tools/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:\Miniconda2\python.exe"
notice: [python-cfg] user-specified includes: "C:\Miniconda2\include"
notice: [python-cfg] user-specified libraries: "C:\Miniconda2\libs"
notice: [python-cfg] Checking interpreter command "C:\Miniconda2\python.exe"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Miniconda2\python.exe" 2>&1'
notice: [python-cfg] running command 'C:\Miniconda2\python.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:\Miniconda2\python.exe"
notice: [python-cfg] include path: "C:\Miniconda2\include"
notice: [python-cfg] library path: "C:\Miniconda2\libs"
notice: [python-cfg] DLL search path: "C:\Miniconda2"
notice: [python-cfg] Checking for NumPy...
notice: [python-cfg] running command 'C:\Miniconda2\python.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.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: [msvc-cfg] msvc-11.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe'
notice: [msvc-cfg] msvc-14.1 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe'
notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.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:\Users\tsanders\AppData\Local\Temp\b2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>/<address-model>32', setup: 'call "C:\Users\tsanders\AppData\Local\Temp\b2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>x86/<address-model>', setup: 'call "C:\Users\tsanders\AppData\Local\Temp\b2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>x86/<address-model>32', setup: 'call "C:\Users\tsanders\AppData\Local\Temp\b2_msvc_14.10.25017_vcvars32_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>/<address-model>64', setup: 'call "C:\Users\tsanders\AppData\Local\Temp\b2_msvc_14.10.25017_vcvarsx86_amd64_.cmd" >nul
'
notice: [msvc-cfg] condition: '<toolset>msvc-14.1/<architecture>x86/<address-model>64', setup: 'call "C:\Users\tsanders\AppData\Local\Temp\b2_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...
注意事項:
--debug-configuration
的輸出肯定表明它正在找到正確的一切。 1 target
是all
目標; 我沒有看到boost.python源的任何類型的構建輸出,就像我看到我是否構建了額外的庫。 boost_python.dll
。 (雖然從技術上講我認為它應該尋找類似boost_python-vc141-mt-1_64.dll
... boost_python-vc141-mt-1_64.dll
。) 我已經為bootstrap.bat
嘗試了許多選項組合(例如--with-libraries=python
, - --with-python=C:\\Miniconda2\\python.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
;
文檔似乎表明將“版本”留空是好的; 我認為空版本應該是指“默認版本”或“所有版本”。 然而,這導致了無聲地跳過構建python庫的推動。
在明確指定Python版本時,所有內容都按預期構建:
using python
: 2.7 # version
: C:\\Miniconda2\\python.exe # interpreter
: C:\\Miniconda2\\include # include dir
: C:\\Miniconda2\\libs # library dir
;
使用Visual Studio構建python boost 1.64 libs似乎已被打破 。
替換<boost_root>/libs/python/build/Jamfile
通過此 。
我建立它這種方式 :
wget.exe https://dl.dropboxusercontent.com/u/59547297/Libraries/boost_1_64_0.zip -OC:\thirdparty\vs2015\x64\boost_1_64_0.zip
7za.exe x C:\thirdparty\vs2015\x64\boost_1_64_0.zip -oC:\thirdparty\vs2015\x64
xcopy /y boost_1_64_0\Jamfile C:\thirdparty\vs2015\x64\boost_1_64_0\libs\python\build\Jamfile
del C:\thirdparty\vs2015\x64\boost_1_64_0.zip
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
C:
cd C:\thirdparty\vs2015\x64\boost_1_64_0
call bootstrap.bat
b2 --toolset=msvc-14.0 address-model=64 --build-type=complete stage -j 8
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.