Building boost with Python 3.5 links to 3.6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Building boost with Python 3.5 links to 3.6

Boost - Build mailing list
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:

 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
      ;
 
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


_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building boost with Python 3.5 links to 3.6

Boost - Build mailing list
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:
>
>   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.  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
>
>
>
> _______________________________________________
> Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
>

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building boost with Python 3.5 links to 3.6

Boost - Build mailing list
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

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build