|
Boost-Build : |
Subject: Re: [Boost-build] Building boost with Python 3.5 links to 3.6
From: Edward Diener (eldiener_at_[hidden])
Date: 2017-09-25 22:35:28
On 9/25/2017 4:04 PM, Robert via Boost-build wrote:
> On 9/22/2017 6:58 AM, SzÅts Ãkos via Boost-build wrote:
>> Dear Boost Developers,
>>
>> I'd like to compile Boost 1.65.1 with Python 3.5 support on Windows
>> with VS 2015. Python is installed from x64 Anaconda distribution into
>> a so called python virtual environment (along with v3.6 in the default
>> environment).
>>
>> I created the following user-config.jam in tools/build/src:
The user-config.jam file usually is found in the HOME directory on Linux
and Windows.
>>
>> Â Â using python
>> Â Â Â Â : 3.5 Â # Version
>>     : C:\\ProgramData\\Anaconda3\\envs\\python-35\\python.exe  #
>> Interpreter
>>     : C:\\ProgramData\\Anaconda3\\envs\\python-35\\include  #
>> include directory
>>     : C:\\ProgramData\\Anaconda3\\envs\\python-35\\libs  # link
>> libraries
>> Â Â Â Â : <address-model>64 Â # conditions
>> Â Â Â Â ;
>
> I am not sure you can separate the sections on a line by line basis.
> Someone who knows b2 much better than I can confirm.
Yes, you can have the sections on different lines. It is perfectly valid
bjam syntax.
>Â Regardless, I use
> Python 2.7 via user-config.jam. The line is:
>
> using python : 2.7 : C:\\Python27 : C:\\Python27\\include :
> C:\\Python27\\libs ;
>
> I then have the output files between Boost, Python and the compiler
> named similarly to:
>
> boost_python-vc141-mt-1_65_1.lib
>
> --Robert
>
>
>> After executing ./bootstrap.bat (with no options given to it), I call
>> the compiled b2.exe the following way:
>>
>>    b2.exe -j 16 --debug-configuration  \
>> Â Â Â Â --prefix=<my_boost_lib_dir> -sBOOST_ROOT=<my_boost_dir> \
>> Â Â Â Â threading=multi variant=debug,release link=static
>> runtime-link=static \
>> Â Â Â Â address-model=64 optimization=speed toolset=msvc \
>>     --with-python  <--with-[...]> \
>> Â Â Â Â install
>> My problem is the resulting .lib libraries somehow contain references
>> to python36.lib (and not to python35.lib):
>> $> dumpbin.exe /directives libboost_python3-vc140-mt-s-1_65_1.lib |
>> findstr python3
>> Â Â Â /DEFAULTLIB:python36.lib
>> Â Â Â /DEFAULTLIB:python36.lib
>> Â Â Â /DEFAULTLIB:python36.lib
>> Â Â Â /DEFAULTLIB:python36.lib
>> Â Â Â /DEFAULTLIB:python36.lib
>> Â Â Â [...]
>>
>> b2 outputs the following:
>> [python-cfg] Configuring python...
>> [python-cfg] Â user-specified version: "3.5"
>> [python-cfg] Â user-specified cmd-or-prefix:
>> "C:\ProgramData\Anaconda3\envs\python-35\python.exe"
>> [python-cfg] Â user-specified includes:
>> "C:\ProgramData\Anaconda3\envs\python-35\include"
>> [python-cfg] Â user-specified libraries:
>> "C:\ProgramData\Anaconda3\envs\python-35\libs"
>> [python-cfg] Â user-specified condition: "<address-model>64"
>> [python-cfg] Checking interpreter command
>> "C:\ProgramData\Anaconda3\envs\python-35\python.exe"...
>> [python-cfg] running command 'DIR /-C /A:S
>> "C:\ProgramData\Anaconda3\envs\python-35\python.exe" 2>&1'
>> [python-cfg] running command
>> 'C:\ProgramData\Anaconda3\envs\python-35\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'
>> [python-cfg] ...requested configuration matched!
>> [python-cfg] Details of this Python configuration:
>> [python-cfg] Â interpreter command:
>> "C:\ProgramData\Anaconda3\envs\python-35\python.exe"
>> [python-cfg] Â include path:
>> "C:\ProgramData\Anaconda3\envs\python-35\include"
>> [python-cfg] Â library path:
>> "C:\ProgramData\Anaconda3\envs\python-35\libs"
>> [python-cfg] Â DLL search path: "C:\ProgramData\Anaconda3\envs\python-35"
>> [python-cfg] Checking for NumPy...
>> [python-cfg] running command
>> 'C:\ProgramData\Anaconda3\envs\python-35\python.exe -c "import sys;
>> sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
>> [python-cfg] NumPy enabled
>>
>> Do you have any idea how to enable linking to Python 3.5?
>>
>> Thank you very much!
>>
>> All the best,
>>
>> Ãkos
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk